| 2047 | } |
| 2048 | |
| 2049 | static cl_uint getContextPlatformVersion(cl_context context) |
| 2050 | { |
| 2051 | // The platform cannot be queried directly, so we first have to grab a |
| 2052 | // device and obtain its context |
| 2053 | size_type size = 0; |
| 2054 | clGetContextInfo(context, CL_CONTEXT_DEVICES, 0, nullptr, &size); |
| 2055 | if (size == 0) |
| 2056 | return 0; |
| 2057 | vector<cl_device_id> devices(size/sizeof(cl_device_id)); |
| 2058 | clGetContextInfo(context, CL_CONTEXT_DEVICES, size, devices.data(), nullptr); |
| 2059 | return getDevicePlatformVersion(devices[0]); |
| 2060 | } |
| 2061 | #endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120 |
| 2062 | |
| 2063 | template <typename T> |
no test coverage detected