Community
cancel
Showing results for 
Search instead for 
Did you mean: 
td__chen
Beginner
44 Views

There are 2 CPU in my computer.How to use them simultaniously?

There are 2 CPU in my computer.Each of them has several cores.

Now I can use one of them, but I want to know how to use them for a single kernel simultaniously.

Even more, if my computer has several CPUs and several GPUs, how to use them to do data parallel computing simultaniously.

BTW, I use windows 7 and OpenCL1.1 .

If the only way I can go is using windows threads? That seems too complicated to impliment!

Any suggestion will be appreciated.

Thank you in advance!

tdchen

0 Kudos
1 Reply
Michael_C_Intel1
Moderator
44 Views

Hi ChenT,

It's definitely possible to use OpenCL kernels with multiple OpenCL devices in the same system.

Multithreading is not needed. *edit* Multithreading not needed for OpenCL components to access multiple devices... it can be useful for performance of non OpenCL portions of  a program.

In OpenCL 1.1 spec... a context is associated with one to many devices, an individual command queue is associated with one of those devices in the context. Developers can use events to block and manage execution in the queues. A single program can enqueue OpenCL transfer and kernel calls into more than one command queue. The runtime's query calls should allow users to enumerate capable devices and create the context(s) accordingly. In using multiple queues... a developer can partition their workload memory on a per queue basis and execute his/her jobs on the parallel elements of the queue.

We don't actively support Windows 7 OpenCL runtime stacks but if users have some available stack on that system it can be worth giving it a shot.

https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/

See:

clEnqueueNDRangeKernel(...)
clCreateCommandQueue(...)
clCreateContext(...)
clGetPlatformIDs(...)
clGetPlatformInfo(...)
clGetDeviceIDs(...)
clGetDeviceInfo(...)

 

 

-MichaelC