cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

thesmileman
Journeyman III

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.

0 Likes
4 Replies
thesmileman
Journeyman III

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 );

     }

}

0 Likes

Can anyone confirm that the above code fails for them? It compiles and runs it just locks up my machine I realize it doesn't do anything but that is because I simplified it to as simple as I could.


I have tried it on a number of ati cards and systems with the same result.It runs on Nvidia hardware (just mentioning for reference). Thank you.

0 Likes

You misspell _read_only as _ready_only, so it is not a valid kernel.

0 Likes

Micah, thank you for your answer but as I mentioned in the post with the code I may have mistyped something in the posted version as I have taken it from a computer which is not connected to the internet but it is not mistyped in the actual version which fails. Also it compiles correctly and without error.

0 Likes