Debug OpenCL Kernel ?

Hi,

I would like to debug my OpenCL Kernel code… so, I have create a ‘char array’ that I send to my kernel.

But how can I :

  • Add a string ?
  • Convert int to string ?

Thanks

There are no built-in string methods in OpenCL. You’ll have to write them yourself to do so. I would suggest a more primitive approach of using error codes to indicate status and using that instead. Remember that either way you are going to need to make sure that the work-items don’t overwrite each other when returning information. Another good approach is to just use the CPU device which (at least on Mac OS X) supports printf().

Hey,

There is a tool called gDebugger which supports debugging OpenCL kernels. It is in its beta phase and for this time for free

I don’t know if gDebugger will let you debug kernels or just API calls. Debugging the kernel requires getting access to breakpoints on the device. (These don’t exist for GPU hardware, so you would have to use a CPU.)

You can use this article to debug OpenCL kernel and Java openCL API call:
http://suhorukov.blogspot.com/2011/12/o … -host.html