Bugs in OpenCL

I just installed the OpenCL drivers from http://developer.nvidia.com/object/get-opencl.html and the implementations seems to be full of bugs. I develop an image processing app with Snow Leopard and now I tried to run the same code on Windows 7 64bit/GTX 285 & GT 120. Already this short code sequence fails.

__kernel void process(read_only image2d_t imgSrc, write_only image2d_t imgDst)


	int2 coord;

	float4 col;

	bool pixelValid=true;

	const sampler_t samplerSrc=CLK_ADDRESS_CLAMP |  CLK_FILTER_LINEAR;

	coord.x = get_global_id(0);

	coord.y = get_global_id(1);


	if (coord.x>coord.y) pixelValid=false;

	col=read_imagef(imgSrc, samplerSrc,(float2)(coord.x,coord.y));

//	if (coord.x>coord.y) pixelValid=false;

	if (!pixelValid) col[0]=1.0;



It looks like if pixelValid is always false.

If you use the second if line after the read_imagef it works correct. Also it seems that the compiler doesn’t like more then 3 “if” statements in general. Am I missing something?