4 Replies Latest reply on Feb 24, 2012 1:52 PM by thesmileman

    Kernel with write only image crashes if not written to


      I have a kernel with a read only image and a write only image. I was testing computation time differences and I didn't want the texture write time to be calculated so I commented all my image write calls out. The kernel will compile but will always crash. This seems to happen even if you have an empty kernel. Not really a big deal for me because I wont run with that code. I could foresee a kernel where you might not want to skip the image write in some cases so it seems like you might want to look into it.

        • Re: Kernel with write only image crashes if not written to

          Actually it seems the problem is something else. The following code locks up my system even if I run it over a global and local work size of (1,1). Can someone tell me what the heck is wrong with this kernel. I had a kernel that was working and I modified it and I can't find out what the heck is wrong so I boiled it down until just the following. I am not using one of the input images but it doesn't seem to matter. Maybe I am just having one of those days NOTE: I may have made a typo because the code is on a machine that isn't on the network so I had to retype it but the following is the basic code:


          __kernel void Example(__read_only image2d_t imgA, __read_only image2d_t imgB, __write_only image2d_t imgC, sampler_t sampler, int width, int height)
               int column = get_global_id(0);
               int row = get_global_id(1);
               int2 coords = (int2)(column, row);
               int value;
               value = read_imagei( imgA, sampler, coords ).x;
               if(row < height && column < width) {
                    write_imagei( imgC, coords, value );