View Full Version : how to run openCL on one CPU?

12-25-2009, 10:57 AM
hi all, very simple question, just want to know how to run openCL on just one CPU.

say, my machine is multi-core, and when I set CL_DEVICE_TYPE_CPU in clCreateContextFromType, I can see the openCL program uses many cores. I want to see the performance of just one CPU. What else should I set?


12-27-2009, 01:13 PM
Which platform are you running on?

12-28-2009, 08:57 AM
linux, fedora 10

01-04-2010, 07:03 AM
The only generic way to do this is to set the global work size to 1 (or use enqueue task, which does effectively the same thing). I believe there is a non-standard way to control how many CPUs the AMD implementation uses, but since OpenCL is data-parallel, there is no standard way to do this. OpenCL treats the CPUs as one data-parallel compute device and runs as many work-items across them at the same time as it can.