在Clion中启用Cuda的代码索引 [英] Enable code indexing of Cuda in Clion

查看:293
本文介绍了在Clion中启用Cuda的代码索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Clion开发cuda程序。当扩展名为.h时,代码突出显示效果很好。但是,将其更改为.cuh时,Clion只是将新文件视为纯文本文件,而我却无法启用代码突出显示功能。我知道完整的Cuda工具链是不可能的,所以我不希望Clion解析mykernel<<< 1024,100 >>>之类的语句。如果它能够像解析普通的标头/ cpp文件一样解析文件,我仍然会感到非常满意。

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.

非常感谢

推荐答案

在项目工具窗口中右键单击文件->与文件类型关联-> C ++

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

但是,Clion不会'现在不正式支持cuda,它无法解析cuda语法。

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

更新:

从CLion 2020.1起,我们获得了官方CUDA C / C ++支持。 CLion现在可以正确处理它们。

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

这篇关于在Clion中启用Cuda的代码索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆