PDA

View Full Version : Debug OpenCL Kernel ?



viewon01
02-02-2010, 01:01 AM
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

dbs2
02-06-2010, 08:21 AM
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().

mollitz
02-16-2010, 07:29 PM
Hey,

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

dbs2
02-20-2010, 04:50 AM
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.)

suhoruig
12-07-2011, 01:25 PM
You can use this article to debug OpenCL kernel and Java openCL API call:
http://suhorukov.blogspot.com/2011/12/o ... -host.html (http://suhorukov.blogspot.com/2011/12/opencl-kernel-debugging-for-java-host.html)