how to run openCL on one CPU?

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?

Thanks!

Which platform are you running on?

linux, fedora 10

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.