OpenCL kernel error on Mac OSx

为君一笑 提交于 2019-12-02 02:24:05

I suspect you are trying to run this on an integrated Intel GPU which does not support double precision. I can only reproduce your error on my own Macbook Pro if I compile your kernel code for the Intel HD 4000 - it compiles just fine when I target the CPU or the discrete NVIDIA GPU.

You can check if the device supports double precision by querying the CL_DEVICE_DOUBLE_FP_CONFIG device information parameter:

cl_device_fp_config cfg;
clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(cfg), &cfg, NULL);
printf("Double FP config = %llu\n", cfg);

If this function returns the value 0, then double precision is not supported. This explains why the compiler log is only reporting float variants of the log function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!