double precision math builtins on OSX

I am trying to use math builtin functions (exp, cos) with double precision on OSX (macbook pro, nvidia GT 330M). My sample code looks like

#pragma OPENCL EXTENSION cl_khr_fp64 : enable
__kernel void g(
__global double* input,
__global double* output,
const unsigned int count)
int i = get_global_id(0);
if(i < count) {
output[i] = exp(.1*input[i]);

i get a failure when trying to build the opencl executable with a message like:

error: more than one matching function found in __builtin_overload
output[i] = exp((.1*input[i]));

i have tried exp, native_exp, and have also tried various typecastings as was suggested on some other posts. it seems like i am not giving the compiler enough info to pick out the double precision routine? i am able to make this all work using float, but need to move to double.

any ideas? thanks.

Can a GT 330M actually do double precision? I didn’t think it could.

ah…you may well be right… seems to support this.

appreciate the quick response, i don’t need to beat my head against this if it is never going to work!

You should always check which extensions supported using clGetDeviceInfo(CL_DEVICE_EXTENSIONS). In this case you are looking for “cl_khr_fp64”.

thanks. checked this out and indeed this device doesn’t support double. thanks for the pointers. moving on towards better hardware…