manual cast to (float) needed for numbers


I have a small problem with the OpenCL compiler.

supposed I call the function sqrt(2.0), with no double precision extensions enabled… then the compiler complains with

error: no matching overload found for arguments of type ‘double’

Shouldn’t it cast the number to a float automatically?? (of course, calling sqrt((float)2.0) works without problems)

best regards,

The function is overloaded, there is no way for compiler to know to which type to cast; instead of explicit casting, you could just put “2.0f” there.