OpenCL kernel source support

Answered

Is there support for OpenCL kernel source code planned for future versions (syntax highlighting and maybe some error inspections)?

And is there a way to activate C syntax highting for .cl kernels, but without the error inspections for C source code files?

5 comments
Comment actions Permalink

Hi!

Unfortunately, this feature hasn't been implemented in CLion yet: https://youtrack.jetbrains.com/issue/CPP-1070 and it's not on our priority list for now. Nevertheless, feel free to comment or upvote.

0
Comment actions Permalink

Hi. I understand that and can live with that with my relatively simple kernels for the moment. However, printf instructions in the kernel apparently do not work and it think they should. Printf should go the stdout stream, which - if I am not wrong - should be the "Run" console in IntelliJ IDEA - at least that's where the print output goes from my regular Java or Kotlin code. 

I am working with OpenCL 2.0, so the printf extension has become part of the standard. But I have enabled it in the kernel with "#pragma OPENCL EXTENSION cl_amd_printf : enable" anyway - no success. 

Any suggestion?

0
Comment actions Permalink

Roland Schützig does printf work fine in a simple "Hello, World!" project (`File | New Project` > `C++ Executable` > `Create`)?

0
Comment actions Permalink

Hi Anna

The problem was that the printf did not work in an openCL GPU kernel. See the more extensive investigation in https://forum.byte-welt.net/t/opencl-on-intellij-idea/22102.

In such a kernel the printf needs at least one argument, like: printf("%s\n", "hello world\n");

In the host program I do not have any issue. Hope that helps to answer your question.

0
Comment actions Permalink

Roland Schützig thanks for sharing the information!

0

Please sign in to leave a comment.