CL_INVALID_BINARY (-42) while trying to use double on Tesla

I get CL_INVALID_BINARY (-42) in Program::build() while trying to use double on Tesla C1060, here is the code:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

__kernel void compute(__global double *vd0,
__global double *vd1,
__global double *vd2)
uint index = get_global_id(0);

what is wrong?

Solution: I had 2 cards and only one of them had double-precision support, so while creating context one needs only to mention one:


Funny, I was going to ask you to query whether the device actually supported doubles using clGetDeviceInfo(). I didn’t post the message because you already mentioned it was a Tesla.