qwer
August 18, 2011, 6:21am
1
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);
(vd2[index]=2);
(vd0[index]=(2+pown(vd2[index],3)));
(vd1[index]=index);
}
what is wrong?
qwer
August 19, 2011, 12:27am
2
Solution: I had 2 cards and only one of them had double-precision support, so while creating context one needs only to mention one:
devices.push_back(context.getInfo<CL_CONTEXT_DEVICES>()[0]);
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.