CUDA Syntax Highlighting in Eclipse
Enable syntax highlighting for CUDA files in Eclipse:
- Window -> Preferences -> in C/C++ -> File Types -> New
- Enter “*.cu” and select “C++ Source File”
- Repeat and enter “*.cuh” and select “C++ Header File”
Prevent Eclipse from complaining about global and others: In your code, either include cuda_runtime.h or add the following:
#ifdef __CDT_PARSER__ #define __global__ #define __device__ #define __shared__ #endif
See http://forums.nvidia.com/index.php?showtopic=90943&view=findpost&p=1249657 for a similar trick related to kernel invocations, but note that its use is discouraged.