Search code examples
macosopenclcompatibility

OpenCL Compatibility Discrepancy


So I ran the code found in How can i test for OpenCL compability? for an iMac (Late 2012) and I got the following result:

Device Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz supports OpenCL 1.2
Device GeForce GTX 675MX supports OpenCL 1.1

Does this mean that in order for me to run code utilizing CPU and GPU at once, I will have to use OpenCL 1.1? What if I want to code using OpenCL 1.2 specification? Will that mean that the code will only utilize the CPU?

Thanks a lot!


Solution

  • Your understanding is mostly correct. You will have to ensure that functions you use are part of both OpenCL 1.1 and 1.2, i.e. functions that have been deprecated in 1.2 should be avoided since there is no guarantee that they will be provided on OpenCL 1.2 devices. Looking at the pretty short list of deprecated features, I don't think that this will be a significant problem.

    If you absolutely have to use an OpenCL 1.2 feature then you will have to use your CPU and forget the GPU. However, I have yet to find anything in the 1.2 standard that has forced me to do this.

    Just a warning, if you use any libraries that use OpenCL, make sure which version they target or if they have code to switch between the two. Using functions from 1.2 on your Nvidia GPU will cause a segfault.