Hi,

I trying a simple gray scale to image but the result is a striped image( applying voluntarily at the bottom only ):



Kernel :

Code :
	"__kernel void copy(__read_only image2d_t imageIn,__write_only image2d_t imageOut)",
	"{",
		"const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_CLAMP|CLK_FILTER_NEAREST;",
		"int gid0 = get_global_id(0);",
		"int gid1 = get_global_id(1);",
		"uint4 pixel;",
 
		"pixel=read_imageui(imageIn,sampler,(int2)(gid0,gid1));",
 
		"if(gid1 < 50 )",
		"{",
			"pixel = (uint4)(0.299*pixel.x + 0.587*pixel.y + 0.114*pixel.z);",
//			"pixel = (uint4)(0.6*pixel.x + 0.3*pixel.y + 0.1*pixel.z);",
//			"pixel = (uint4)pixel/2;",
 
		"}",
		"write_imageui(imageOut,(int2)(gid0,gid1),pixel);",
	"}",

when I have :


pixel = (uint4)pixel/2; //work

-> I can see that :
pixel.xyz = pixel.xyz / 2

idem for :
pixel = (uint4)((pixel.x + pixel.y + pixel.z)/3) //work



pixel = (uint4)(0.6*pixel.x + 0.3*pixel.y + 0.1*pixel.z) //don't work correctly, striped

So, is somebody had the same problem, and how can I resolve it?
What I'm really want is understand how it works.

Thanks.