passing cl_bool as kernel argument

Discussion created by cgorac on Sep 13, 2009
Latest reply on Sep 14, 2009 by cgorac

I have bool variable declared in my host code:

bool foo;

I try then to pass it as an argument to my kernel:

error = clSetKernelArg(kernel, 0, sizeof(cl_bool), &foo);
assert(error == CL_SUCCESS);

And I have my kernel signature as follows:

__kernel void myKernel(const bool foo, ...)

However, it seems that a bit other than the least-significant bit get set in this bool variable when passed down to the kernel, so I get either 0x800000 or 0x800001 as the contents of this variable in my kernel, thus it's always true.  So - is this bug, or some kind of error of mine in passing this argument?