Reputation: 754
I’m working on a homework project compare performance of Fast Fourier Transform on CPU vs GPU . I’m done with the CPU part , but with GPU , I have a problem.
The trouble is the kernel runtime is zero , the input is the same as the output image . I use VS2010 on win7 with AMD APP SDK . Here is the host code , the kernel , an addition header to handle the image , they can be found in The OpenCL Programming Book (Ryoji Tsuchiyama…)
My guess the error is in the phase where we pass values from the image pixels to the cl_float2 *xm
(line 169-174 in the host code). I can’t access the vector component to check it either , the compiler ain’t accept .sX
or .xy
, throws an error about it . Other parts –kernel,header…- looks fine with me .
for (i=0; i < n; i++) {
for (j=0; j < n; j++) {
((float*)xm)[(2*n*j)+2*i+0] = (float)ipgm.buf[n*j+i]; //real
((float*)xm)[(2*n*j)+2*i+1] = (float)0; //imag
}
}
So hope you guys help me out . Any ideas will be appreciated .
Upvotes: 2
Views: 574
Reputation: 4739
OpenCL provides a lot of different error codes.
You already retrieve them by doing ret = clInstruction();
on each call, but you are not analysing it.
Please check on each call if this value is equal to CL_SUCCESS
.
It may always happen, that the memory is not sufficient, the hardware is already in use or there is a simple error in your source code. The return value will tell you.
Also: Please check your cl_context
, cl_program
, etc. for NULL
values.
Upvotes: 3