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

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

问题描述

我正在使用 Clion 开发一个 cuda 程序.当扩展名为 .h 时,代码高亮显示效果很好.但是,当它更改为 .cuh 时,Clion 只会将新文件视为纯文本文件,而我无法启用代码突出显示.我知道完整的 Cuda 工具链是不可能的,所以我不希望 Clion 解析 mykernel<<<1024, 100>>> 之类的语句.如果它能够像解析普通的 header/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天全站免登陆