How do you use double in OpenCL on MacPro?

I have a Mac Pro (late 2013) and I want to do dual-use math using OpenCL. When I used Mavericks, CL_DEVICE_EXTENSIONS

for my GPU, FirePro only showed up cl_APPLE_fp64_basic_ops

, so I couldn't use double math functions like exp()

. I recently upgraded to Yosemite and now the correct list cl_khr_fp64

is in the list of extensions, but I still cannot use exp for double. The error log shows that it is looking for an overloaded function and exp is available for float, float4, float8, ... but not 64 bit. I included the command enable fp64:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

      

Does anyone know what's going on? Why does the GPU say it cl_khr_fp64

is available, but then I cannot use it all. I can +-*/

double, but I could have done it before with just help basic_ops

. Is Apple deceiving that they have increased support fp64

?

Oddly enough, on my cpu, OpenCL also says it is cl_khr_fp64

also available, but i can't use exp on cpu.

+3


source to share


1 answer


In OpenCL C, you should call them double, not cl_khr_fp64s
for example
 double pie = M_PI;
double2 two_pies = (double2){M_PI}; // or {M_PI,M_PI};




-1


source







All Articles