Question

My application is OpenCL 1.1 compatiable and I want to check whether each of the device has drivers for that version. There are 2 ways for this:

  1. clGetDeviceInfo() ->CL_DEVICE_VERSION
  2. clGetPlatformInfo() ->CL_PLATFORM_VERSION

I have following doubts:

  • I do not understand why method 1 is provided as method 2 seems the correct way to me?
  • Is it possible that the version given by the platform will not match with the version given by a device from the same platform?
  • What is clGetDeviceInfo::CL_DRIVER_VERSION for?
  • From all these options which one should I use to check if a device can run my OpenCL 1.1 code?
Was it helpful?

Solution

There are some features in OpenCL that have hardware requirements. This means that even if a particular vendor's OpenCL implementation (the platform) supports an OpenCL version, the device might not. So, it is entirely possible for the versions returned from the CL_DEVICE_VERSION and CL_PLATFORM_VERSION queries to differ.

This will probably start to happen more frequently when OpenCL 2.0 implementations start appearing, as there is plenty of hardware on the market that doesn't have the necessary support for OpenCL 2.0 features. Imagine a system that has two devices from Vendor X: a new Device A that can run OpenCL 2.0, and a much older Device B that can't. In this instance, the platform version may be OpenCL 2.0, but the device version could be OpenCL 2.0 for Device A and OpenCL 1.2 for Device B.

The CL_DRIVER_VERSION is for getting a vendor specific version number for the implementation. This number could using any version numbering system that the vendor uses to keep track of different software releases, and is completely independent from OpenCL version numbers (although some vendors may well include the OpenCL version here too).

So, in order to be sure that both the device and platform support your required OpenCL version, you should just need to check CL_DEVICE_VERSION.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top