Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does any OpenCL host have more than one platform?

Tags:

opencl

The definition of a platform in Khronos' OpenCL 1.0 and 1.1 specification:

Platform: The host plus a collection of devices managed by the OpenCL framework that allow an application to share resources and execute kernels on devices in the platform.

The OpenCL function clGetPlatformIDs creates an array of platforms, implying that multiple platforms are possible. Is it safe to assume that a given OpenCL host has only one platform?

In other words, will I lose anything on any host by doing this:

cl_platform_id platform_id;
cl_uint num_platforms;
errcode = clGetPlatformIDs(1, &platform_id, &num_platforms);
like image 768
Jacob Marble Avatar asked Aug 09 '10 22:08

Jacob Marble


1 Answers

I wouldn't rely on there being only one Platform. When you have multiple OpenCL implementations on one system (which should be possible with the OpenCL ICD, although I'm not sure if that is only planned or already finished), you should get multiple platforms, one for each opencl implementation. One example where there could be multiple opencl implementations would be an nvidia implementation to run opencl on gpu and an amd implementation to run on cpu, so that it not that far fetched either.

edit: look at http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71 for (better) desciption of this

like image 55
Grizzly Avatar answered Oct 19 '22 20:10

Grizzly