Results 1 to 3 of 3

Thread: FFT 2D kernel runtime =0 in OpenCL

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    4

    FFT 2D kernel runtime =0 in OpenCL

    Hi guys

    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 .

    Code :
    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 .

  2. #2

    Re: FFT 2D kernel runtime =0 in OpenCL

    I see that your code gets the error code generated by every OpenCL function call but you don't seem to check whether that code actually equals CL_SUCCESS. I would suggest that you add such a check after every function call (doing it as a macro works well). Also check the build log after building your kernels in case that shows an error in your code.

    How are you doing the timing as I don't see any timing functions in your code?

  3. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    4

    Re: FFT 2D kernel runtime =0 in OpenCL

    Quote Originally Posted by chippies
    I see that your code gets the error code generated by every OpenCL function call but you don't seem to check whether that code actually equals CL_SUCCESS. I would suggest that you add such a check after every function call (doing it as a macro works well). Also check the build log after building your kernels in case that shows an error in your code.

    How are you doing the timing as I don't see any timing functions in your code?
    Thank you for your reply ; I'll check the error codes carefully and feedback later if I can't solve it out

    About the timing ; I monitor the event kernelDone in fftCore function , just a quick check I added later after upload the code .

Similar Threads

  1. Replies: 6
    Last Post: 04-11-2012, 07:18 PM
  2. Compilation of the Kernel is always at runtime?
    By luizdrumond in forum OpenCL
    Replies: 1
    Last Post: 07-19-2011, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •