3

Will a host ever have more than one CPU-type device? Multi-core CPUs will come up as a single device, but what about dual-socket motherboards? Will there be two separate devices in OpenCL for each processor?

I'm trying to plan ahead with an application I'm working on.

plackemacher
  • 4,216
  • 1
  • 23
  • 26

3 Answers3

4

Besed on my experience, on dual-socket motherboards you still have one CPU device. The OS usually hides from user whether cores are located on same physical CPU or on different ones, even on NUMA machines (of course you can get detailed info, but it's not all that straightforward). And I think this behaviour is quite logical, at least on SMP machines, since there is not much difference how cores are located physically (in case of GPU, accessing other device memory is quite troublesome; on CPUs pinning all your threads to same physical CPU rarely worth worrying), so there are barely any disadvantages in melting two physical CPUs into one OpenCL device, and it has advantage of simplifying its usage.

However I've not seen this mentioned in OpenCL specification, so it's all implementation-specific, and is not guaranteed to always hold true.

Community
  • 1
  • 1
aland
  • 4,829
  • 2
  • 24
  • 42
  • 1
    @T3hD0gg Yep, in case you have two or more platforms installed (Intel's and AMD's, or two versions of AMD's), you have one CPU device per platform. OpenCL platforms are absolutely independent from one another. – aland Oct 04 '11 at 07:40
2

It is possible that in a multiple CPU environment on even on a multicore CPU there are more than one device. Take IBM's cell for an example, the 9 core CPU is seen by the OpenCL driver as 2 different devices. One is the PPU's device and the other represents the SPUs and has a CL_DEVICE_TYPE_ACCELERATOR profile).

http://oscarbg.blogspot.com/2009/11/about-imd-open.html

1

A compute cluster (multiple physical machines with separate memory) could possibly be abstracted as multiple OpenCL devices on a single "master" node, though I don't know if any implementations actually do that.

Wyzard
  • 33,849
  • 3
  • 67
  • 87
  • There is [MOSIX VCL](http://gpgpu.org/2010/09/13/mosix-virtual-opencl-vcl), which promises to do exactly what you said, but I haven't heard anything about how it performs on real-life applications. – aland Oct 04 '11 at 07:39