Qt Creator中的CUDA语法高亮

Qt Creator中的CUDA语法高亮

问题描述:

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

+0

嗨,你是自己制作凯特版还是找到它? – GradGuy 2012-07-12 05:15:18

如果你能突出凯特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预期的位置(请参阅LocationFallback location中提到的documentation)。

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。