Error code selection failed in OpenCL, not in CUDA Error: Code selection failed to select

The following kernel results in a [font=“Lucida Console”]Error: Code selection failed to select: 0000000012D695F0: i1 = select 0000000012D69EA8, 000000001303F020, 0000000012D6B110[/font]

when using OpenCL on NVIDIA, works fine in CUDA as well as in the ATI Stream SDK.

[codebox]__kernel void Bug_NVIDIA_Select (

const int 	a,

__global float* out)

{

float t = 1;

if (a) t -= 1;



*out = a;

}[/codebox]

Any idea how to work around this? Tried on a Quadro FX5800 with latest drivers (197.28).

I have problem like your, but it happens at the next code

[codebox]__kernel void a(__global unsigned long *x){

unsigned long W[80];

for(int i = 16; i < 80; ++i)

W[i] = W[i-7];

//for example

*x = W[50];

}[/codebox]

Error: Code selection failed to select: 0000000049865172 i64 = bswap 0000000053D65124

It seems to me that the reason for 64-bit numbers…

I have problem like your, but it happens at the next code

[codebox]__kernel void a(__global unsigned long *x){

unsigned long W[80];

for(int i = 16; i < 80; ++i)

W[i] = W[i-7];

//for example

*x = W[50];

}[/codebox]

Error: Code selection failed to select: 0000000049865172 i64 = bswap 0000000053D65124

It seems to me that the reason for 64-bit numbers…

I have the same problem with my kernel.
Did you find a solution ? Or at least a clue about that error ?
It would be very nice that any one, and particularly Nvidia guys, provide support …

I find I get this error from type mismatches, e.g. if I try to pass a float or float vector to a function’s int argument.

I note the first example is trying to store an int into a dereferenced float pointer. Maybe casting to (float) first might help.

If that’s the case, it’s still a compiler error - such typecasts should be implicit.

Hi, I also have this problem with this code :

return ((scramble >> 8) & 0xffffff) / (float)(1 << 24);

The error :

Error: Code selection failed to select: 1B251F38: i32 = bswap 1B252FB0

Does someone has an idea ?

I have modified my code like this and it works, but don’t know why :

float u = (float)n;
float y = (((float)u) / 256);
return 0.f;

But when I try to return the good value I have the error message :

float u = (float)n;
float y = (((float)u) / 256);
return y;