double with select() function doesn't compile

Hi, I have following code:

float a,b,c;

select(a,b,c>0.1);

that works fine on Tesla C1060 with float and float4 but with double and double4 it gives this error: call to ‘select’ is ambiguous … what could be the problem? Extension for doubles is enabled. This code (with double and double4) works also on CPU using AMD’s driver. Could somebody test in on Tesla, please?

Thanks in advance

qwer

Float constants usually require an “f” suffix, like “0.1f”, else the number is treated as a double. However, it seems that some OpenCL implementations treat floating-point numbers without a suffix also as floats for convenience. So when you enable doubles, “0.1” is still a float, and thus the call to select() is ambiguous. Try explicitly casting 0.1 to a double, like:

double a,b,c;

select(a,b,c>(double)(0.1));