3

I have a Mac Pro (Late 2013) and I want to do some math in double using OpenCL. When I was using Mavericks the CL_DEVICE_EXTENSIONS for my FirePro GPU only listed cl_APPLE_fp64_basic_ops so I couldn't use double math functions like exp(). I recently upgraded to Yosemite and now the proper cl_khr_fp64 is in the list of extensions but I still can't use exp for double. The error log shows that it's looking for an overloaded function and exp is available for float, float4, float8,... but not 64 bit. I have included the command to turn on fp64:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

Does anyone know what's going on? Why does the GPU say that cl_khr_fp64 is available but then I can't use all of it. I can +-*/ in double, but I could also do that before with just basic_ops. Is Apple lying to me that they upgraded support of fp64?

Strangely, on my CPU OpenCL also says that cl_khr_fp64 is also available but I can't use exp on the CPU either.

Michael Dorner
  • 17,587
  • 13
  • 87
  • 117
dusty_keyboard
  • 136
  • 1
  • 5
  • Have you tried this: http://stackoverflow.com/a/26797959/1864294 – Michael Dorner Jan 16 '15 at 21:00
  • @MichaelDorner , I tried this and it returns 63 for CL_DEVICE_DOUBLE_FP_CONFIG I also found documentation from Apple that says the D700 supports double. http://store.apple.com/us/buyFlowCTOLearnMore/ME253LL/A?group=graphics_z0pk Also, when I run this on my CPU via OpenCL it doesn't work either. The CPU also returns 63 for CL_DEVICE_DOUBLE_FP_CONFIG – dusty_keyboard Jan 19 '15 at 04:16
  • Does this answer your question? [OpenCL kernel error on Mac OSx](https://stackoverflow.com/questions/26791113/opencl-kernel-error-on-mac-osx) – talonmies Nov 30 '19 at 22:19

1 Answers1

-1

In OpenCL C, you should call them doubles not cl_khr_fp64s
e.g.
double pie = M_PI;
double2 two_pies = (double2){M_PI}; // or {M_PI,M_PI};