tags:

views:

72

answers:

2

Lets assume that I have a computer which has a multicore processor and a GPU. I would like to write an OpenCL program which runs on all cores of the platform. Is this possible or do I need to choose a single device on which to run the kernel?

+2  A: 

No you can't span automagically a kernel on both CPU and GPU, it's either one or the other.

You could do it but this will involve creating and managing manually two command queues (one for each device).

See this thread: http://devforums.amd.com/devforum/messageview.cfm?catid=390&threadid=124591&messid=1072238&parentid=0&FTVAR_FORUMVIEWTMP=Single

Stringer Bell
A: 

In theory yes, you can, the CL API allows it. But the platform/implementation must support it, and i don't think most CL implementatations do.

To do it, get the cl_device_id of the CPU device and the GPU device, and create a context with those two devices, using clCreateContext.

Matias Valdenegro