7 Replies Latest reply on Aug 17, 2012 9:16 AM by dmeiser

    control over number of cpu cores used

    dmeiser

      Hi,

       

      I'm running an OpenCL program on a multi-core cpu using the AMD-APP SDK 2.7. The CPU has 48 cores (and these are all seen by the OpenCL runtime as verified with clinfo) but when I look at the system load in top I see that only 6 of the cores are being used. I'm launching about 20000 work items with a block size of 64 in a one-dimensional configuration.

       

      Is there any way to directly control how many OS threads the OpenCL runtime uses?

       

      If not, are there any guidelines for how to partition the work items in order to use a larger number of CPU cores?

       

      Thanks,

      Dominic

        • Re: control over number of cpu cores used
          Wenju

          Hi Dominic,

          Maybe your 48 cores CPU is consist of 8 devices, each device has 6 cores, just speculating. So if you want to use a larger number of cpu, you should divide your data, and create more context/commandqueue, and then calculate them. I'm not sure about this, but it should work in theory.

            • Re: control over number of cpu cores used
              dmeiser

              Hi Wenju,

               

              Thanks for your response. The 48 cores are exposed as one smp to the os. OpenCL recognizes it as such: one device with 48 compute units. With different OpenCL programs I have been able to utilize all 48 cores.

               

              There must be some heuristic built into the AMD OpenCL runtime to decide how many cores to use for a given workload. I would have thought that the above worksize (more than 20000 work items) would have been sufficient to trigger utilization of all cores. It could be because the amount of work done per work item is pretty light weight.  That's why I'm wondering if there is a way to explicitly override the internal heuristics.

               

              Dominic