Hi,
I'm trying to find a way to debug the OpenCL code... with any "trace" and no "debugger" it is really a pain once the algorithm is a little bit complex.
I only work with CPU (for development) and under XP....
I have find the following article about OpenCL debugging...
http://samritmaity.wordpress.com/2009/11/20/debugging-opencl-program-with-gdb
But my application crash once I set the "-g" parameter during the Build !
Does someone has find a way ?
Thanks
Hi,
There is no GPU on this machine, it is an Intel CPU and an Intel graphic card.
What can I do to debug ?
Hi,
you can send data back to host and output there.
Thanks, but how ?
I have create a 'char buffer' that I send to the OpenCL kernel...
But how can I concat string into this buffer ?
(And how can I convert an int to a string) ?
Thx
You can use
to get a const char* to the first char of the string use stringname.c_str().
use a loop and char in=pointer to copy the const char pointer to the cl_buffer.
To get an int to a string use stirng s=""+intname;
Thanks,
Ar you sure the it is "KERNEL code" ?
But it tells that 'string' is undefined !!
Here is my pseudo-code :
char * output;
output = "hello world";
output = output + " test ";
integerValue = 5;
output = output + integerValue;
Do you know how I can do this in the OpenCL kernel ?
Thanks
Hi,
you cannot you variable array length.
So you have to write this in a new array: output = output + " test " is not posiible.
you have to create a second char array to do this.
MFG Sheeep
I am trying to replicate sheep's suggestions and getting similiar error...
eg for the kernel code :
__kernel void test(__global char * debug)
{
string s = "" + d;
debug = s.c_str();
}
I receive that 'string' is undefined :
C:\Users\jfranta\AppData\Local\Temp\OCL6467.tmp.cl(116): error: identifier
"string" is undefined
string s = "" + d;
^
C:\Users\jfranta\AppData\Local\Temp\OCL6467.tmp.cl(108): warning: parameter
"debug" was set but never used
__global char * debug)