OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Can OpenCL running on OSX(Macbook) using CPU?

zhang_f_
Beginner
507 Views

Hello,

I use a Macbook, it has been installed the OpenCL. The Macbook has CPU:  Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz, GPU: GeForce GT 750M, and GPU: Iris Pro. But I can only use the GeForce GT 750M.

I have 2 questions:

Question 1:  If I change the device to the Intel CPU or GPU, it will fail to execute the kernel! Can I use them?

Question 2: Can I use Intel device under OSX? Do I have to reinstall the OpenCL driver or something? But I haven't found a OSX driver.

https://software.intel.com/en-us/articles/opencl-drivers

Thanks!

0 Kudos
4 Replies
Robert_I_Intel
Employee
507 Views

Intel does not provide graphics drivers for MacOSX. These questions are better directed to Apple support, but I believe the current answer under MacOSX is no to both questions (if enough people ask about this, Apple may consider adding this functionality in the future).

You can, however, install Windows 8.1 on your MacBook and in that case you should be able to use both Intel CPU and GPU devices in addition to your NVidia GPU device. Many people at Intel use MacBook in dual boot configuration.

 

Robert_I_Intel
Employee
507 Views

Hello Zhang,

Did you try advice here: https://developer.apple.com/library/mac/documentation/Performance/Conceptual/OpenCL_MacProgGuide/Usi... ? What devices are you seeing?

zhang_f_
Beginner
507 Views

Hi, Robert,

Thanks for your advice! I have found the problem. I set the group size = 256, so I got "Error: Failed to execute kernel!". But if the group size is 128, it's fine.

I think there is a max group size for the CPU. I use the following code but I get 1024. Actually, I think the max number is 128. Because I get wrong when the group size is bigger than 128.

 

105         clGetDeviceInfo(device_id, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(size_t), &p_size,
106                         NULL);
107         fprintf(stderr, "\tMax Work Group Size:\t%6d\n", p_size);

 

 

Robert Ioffe (Intel) wrote:

Hello Zhang,

Did you try advice here: https://developer.apple.com/library/mac/documentation/Performance/Conceptual/OpenCL_MacProgGuide/Usi... ? What devices are you seeing?

Robert_I_Intel
Employee
507 Views

Hi Zhang,

You can try to query the kernel itself with the following:

https://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clGetKernelWorkGroupInfo.html

There is a parameter CL_KERNEL_WORK_GROUP_SIZE that you can query: your kernel could have a smaller work group size that the maximum that device can handle.

Reply