Hi,
I'm trying out the beta4 release of OpenCL and I was wondering if it is possible to use less than all the available cores in a CPU device. In my particular case I'm using a quad core, but I want my application to use just two cores. Is this possible? I haven't found a configuration option that allows me to do this in the OpenCL standard.
I would really appreciate if you have any example or suggestion.
Thanks in advance,
Federico
try set enviroment variable CPU_MAX_COMPUTE_UNITS to number of cores you want use.
Thanks a lot nou! That works ok. Anyway, is there any way to do this programmatically with the OpenCL API, without changing environment variables?
Thanks again!
Federico
Originally posted by: fmilano Thanks a lot nou! That works ok. Anyway, is there any way to do this programmatically with the OpenCL API, without changing environment variables?
Thanks again!
Federico
Currently there is no way to set number of cores from OpenCL. It is expected to be released in future.
Currently there is no way to set number of cores from OpenCL. It is expected to be released in future.
Are you sure about this? I was under the assumption that by setting the global_work_size in clEnqueueNDRangeKernel, then that would correspond to the number of cores used. If local_work_size is 1, and global_work_size is 4, this would correspond to utilizing all 4 cores. Can anyone confirm if this is correct or not?
Maybe I am mistaken though, because I have been noticing some work I have been doing hasn't been scaling well as I increase global_work_size.
Originally posted by: RyFo18Are you sure about this?
I am sure that there is no way to set number of cores from OpenCL
I was under the assumption that by setting the global_work_size in clEnqueueNDRangeKernel, then that would correspond to the number of cores used. If local_work_size is 1, and global_work_size is 4, this would correspond to utilizing all 4 cores. Can anyone confirm if this is correct or not?
Maybe I am mistaken though, because I have been noticing some work I have been doing hasn't been scaling well as I increase global_work_size.
This is not ture.
See this slide : http://img3.imageshack.us/img3/1153/openclarchitecture.jpg
According to it a work-group corresponds to a hardware thread on CPU. Hence 4 work-groups in your example should map to 4 cores.
Thanks for the info.