开发者

Selecting number of CPU cores in OpenCL

开发者 https://www.devze.com 2023-03-30 07:30 出处:网络
I am comparing performance of OpenMP with that of OpenCL on CPUs and my system has 8 co开发者_如何转开发res. But I need comparisons for 2, 4, 6 and 8 cores respectively. I can activiate number of core

I am comparing performance of OpenMP with that of OpenCL on CPUs and my system has 8 co开发者_如何转开发res. But I need comparisons for 2, 4, 6 and 8 cores respectively. I can activiate number of cores in OpenMP through "set_num_threads(n)" function or an environment variable; But I dont know how could I do same in OpenCL, is there alternative of OpenMP set_num_threads API in OpenCL ?


There is no standard way to do this. OpenCL will try to use all of the resources available on an OpenCL device.

One possibility you could look into is the device fission extension. It allows you to divide the device (in this case the CPU) into smaller logical devices. It is currently supported on CPUs by AMD's implementation at least. Do a search and you'll find some more resources from AMD as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号