CUDA Syntax Highlighting in Eclipse 2012-11-19
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:
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.