Qt Creator中的CUDA语法高亮显示

时间:2011-12-28 17:40:22

标签: cuda syntax-highlighting qt-creator

有人知道在使用Qt Creator时突出显示CUDA代码的方法吗?我可以在vim和kate中这样做,但不是在Qt Creator中我必须使用它。

2 个答案:

答案 0 :(得分:5)

如果您可以在Kate中突出显示CUDA代码,那么您也可以在Qt Creator中执行此操作,因为在Qt Creator中generic highlighting is based on highlight definition files that are provided by the Kate Editor.

虽然Qt Creator可以帮助您下​​载高亮定义文件(请参阅documentation),但遗憾的是我无法在“下载定义”对话框中看到CUDA,因此您必须将手动使用的CUDA高亮定义文件复制到Qt Creator期望它们的位置(请参阅提到的documentation中的LocationFallback location)。

答案 1 :(得分:0)

A quick workaround is to add .cu and .cuh in cpp.xml in qt creator's generic-highlighter folder as below. 一个快速的解决方法是在qt creator的generic-highlighter文件夹中的cpp.xml中添加.cu和.cuh。