Bothering strange behavior... :'( A really annoying one

Hello,

I compile my .cl source with :
clCreateProgramWithSource
clBuildProgram

and then I use clCreateKernel for some kernels in my .cl files.

[b]The problem

  • If there is a C+±style comment in .cl file ‘//’, clCreateKernel fails (it’s ok with old style multiline comments “/* comment */”)
  • If there is a #define in .cl file, clBuildProgram fails[/b]

The examples from the SDK are OK, but they use neither clCreateProgramWithSource nor clCreateKernel.

Any idea ? This is quite impossible to work with these restrictions :pirate: :pirate:

(I use OpenCL 1.1)

It seems I must use clCreateKernelsInProgram for now, but I don’t understand how to get a specific kernel among all ? (for example, what is the third kernel in the array returned by clCreateKernelsInProgram ? I only have the names of the kernels)

You can have problems with // and #define if you source is writen on only one line.
Each line must be terminated by ‘\n’.

What a shame… thank you very much for your help !