Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable code indexing of Cuda in Clion

Tags:

cuda

clion

I am using Clion to develop a cuda program. The code highlight works fine when the extension is .h. However, when it is changed to .cuh, Clion just consider the new file a plain text file, and I have not been able to enable code highlight. I understand a complete Cuda toolchain is out of the question, so I will not hope Clion to parse statements like mykernel<<<1024, 100>>>. Still I will be more than satisfied if it can parse the file just like parsing a normal header/cpp file.

Many thanks

like image 494
Ran Wang Avatar asked Oct 11 '16 15:10

Ran Wang


1 Answers

Right click file in project tool window -> Associate with file type -> C++

However, Clion doesn't support cuda officially now, it cannot parse cuda syntax.

UPDATE:

From CLion 2020.1, we have official CUDA C/C++ support. CLion could handle them correctly now.

like image 88
halfelf Avatar answered Oct 23 '22 04:10

halfelf