cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

boxerab
Challenger

Bug in write_imagei routine ?

I have a simple kernel that writes to a write only opencl image.

I execute this line in my kernel:

  write_imagei(output, pos,(1,2,3,1));

However, when I map the output image, and look at the data, it looks like:

    0x01 0x01 0x01 0x01 ......

It seems that all channels are filled with the alpha value.

0 Likes
4 Replies
boxerab
Challenger

sorry, my bad. Please ignore this.

0 Likes


boxerab wrote:



sorry, my bad. Please ignore this.


Can I assume your problem has been solved?

Regards,

0 Likes

write_imagei(output, pos,(1,2,3,1)); is equivalent to write write_imagei(output, pos, 1);

compiling following code in gcc

int p = (1,2,4,1);

you get this warning: right operand of comma operator has no effect [-Wunused-value]

     int p = (1,2,4,1);

                  ^

in other word operator comma evaluate everything. the value of whole expression is then expression after last comma.

Comma operator - Wikipedia, the free encyclopedia

0 Likes

@dipak yes this is solved

@nou thanks - yes this is what was happening. I solved it by casting to (int4)

0 Likes