cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

OpenCL newbie question

I am trying to use the openCL examples in DirectGMA SDK 1.1.  Although in general it seems to be working, but I am finding weird behaviours when I try to change the OpenCL kernel code, so I would appreciate some feedback.  I get no error message (basically it seems the kernel is compiled fine, and the code runs, but I don't get any correct output either.

// Modified kernel code

    const char* pKernelSrc = "__kernel void copyImage(__global uint* rgbaIn, __global uint* rgbaOut, int2 vDim)          \n \

                              {                                                                                         \n \

                                    uint posX = get_global_id(0);                                                       \n \

                                    uint posY = get_global_id(1);                                                       \n \

                                    uint value4 = 0;                                                                    \n \

                                                                                                                        \n \

                                    value4 = rgbaIn[posY] ;                                      \n \

                                    rgbaOut[(posY * (vDim.y)) + posX]  = value4;                                      \n \

                                } ";

.......

  

///////////////////

(1)    If I modify the value4 to
      value4=rgbaIn[posY] + 0xffff ; // this works
      value4=rgbaIn[posY]  & 0xffff  ; //  this doesn't work

(2) If I modify the input parameter from __global uint * rgbIn to __global uchar* rgbIn,  it doesn't work, even if I typecast it ..
       so value4 = (uint) rgbIn[posY];  //( causes things not to work correctly. kernel compiles fine, just that it seems to be doing nothing)
(3) assigning constant values seems to break things too,. I tried doing a simple colorfill, but just doing 
     value4 = 0x555555;  // this doesn't wrk either

I am trying to basically do format conversion with OpenCL. Basically I've 2 cl_mem buffers in GPU memory, and I am doing 16bpp - 32bpp conversion, and copying the results to an OpenGL texture to display. I tried some sample OpenCL code I got from web, but none really behaves really well either. Could this be just that the OpenCL stuff in the DirectGMA 1.1 SDK is too. So far only the enqueueread/write copy works consistently, anything else seems to have very tight requirements. But I am a newbie, so maybe I am missing something. Most of the time the kernel compileswith no issues, it just doesn't work. (if I purposely inject errors in to the kernel, it then it will fail kernel compilation)

Any help would be much appreciated.

0 Likes
1 Solution

I can see your another post here OpenCL newbie questions . I think both are same. In that case, it's good that you've figured out the issues and resolved it.

Regards,

View solution in original post

0 Likes
3 Replies
dipak
Big Boss

Hi Patrick,

You've been white-listed. So, you should be able to post in any forum appropriate to your issue.

Is the above issue specific to DirectGMA SDK or do you observe the same for any OpenCL code (i.e without DirectGMA SDK also)? 

0 Likes

I am testing with the DirectGMA SDK 1.1 code and it's OpenCL projects as I needed to use DirectGMA along with either OpenCL or something else to do format conversion. I haven't tried running using different environment (aka without DirectGMA SDK)

0 Likes

I can see your another post here OpenCL newbie questions . I think both are same. In that case, it's good that you've figured out the issues and resolved it.

Regards,

0 Likes