Opencl语法突出显示
是否有人有解决Clion的OpenCL代码的语法突出显示的解决方案? 我将OpenCL源代码放在带有Extension .CL的文件中,并希望对此类文件进行语法突出显示。
Does anyone have a solution for syntax highlighting of OpenCL code for CLion?
I am placing the OpenCL source code in a file with the extension .cl and would like to have syntax highlighting for such files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在CLION中,您可以添加
.cl
文件为自定义文件类型并手动提供语法突出显示的OpenCL C关键字列表。可以从A
.cl
文件加载OPENCL C代码的替代方案:将其嵌入C ++中,例如此 opencl-wrapper 。虽然naive字符串
文字会破坏语法突出显示,但有一种方法可以保留语法通过字符串宏来突出显示,并使用
#define
s for opencl c函数和关键字。In CLion you can add
.cl
files as custom file types and manually provide the list of OpenCL C keywords for syntax highlighting.There is an alternative to loading the OpenCL C code from a
.cl
file at runtime: Embedding it right within C++, such as used in this OpenCL-Wrapper. While naivestring
literals would destroy syntax highlighting, there is a way to retain syntax highlighting with thestringification macro and by using
#define
s for all the OpenCL C functions and keywords.