mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Update cl_khr_integer_dot_product tests for v2 (#1317)
* Update cl_khr_integer_dot_product tests for v2 Signed-off-by: Kevin Petit <kevin.petit@arm.com> Signed-off-by: Marco Cattani <marco.cattani@arm.com> Change-Id: I97dbd820f1f32f6b377e47d0bf638f36bb91930a * only query acceleration properties with v2+ Change-Id: I3f13a0cba7f1f686365b10adf81690e089cd3d74
This commit is contained in:
@@ -63,6 +63,40 @@ int is_extension_available(cl_device_id device, const char *extensionName)
|
||||
return false;
|
||||
}
|
||||
|
||||
cl_version get_extension_version(cl_device_id device, const char *extensionName)
|
||||
{
|
||||
cl_int err;
|
||||
size_t size;
|
||||
|
||||
err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS_WITH_VERSION, 0, nullptr,
|
||||
&size);
|
||||
if (err != CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clGetDeviceInfo(CL_DEVICE_EXTENSIONS_WITH_"
|
||||
"VERSION) failed to return size\n");
|
||||
}
|
||||
|
||||
std::vector<cl_name_version> extensions(size / sizeof(cl_name_version));
|
||||
err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS_WITH_VERSION, size,
|
||||
extensions.data(), &size);
|
||||
if (err != CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clGetDeviceInfo(CL_DEVICE_EXTENSIONS_WITH_"
|
||||
"VERSION) failed to return value\n");
|
||||
}
|
||||
|
||||
for (auto &ext : extensions)
|
||||
{
|
||||
if (!strcmp(extensionName, ext.name))
|
||||
{
|
||||
return ext.version;
|
||||
}
|
||||
}
|
||||
|
||||
throw std::runtime_error("Extension " + std::string(extensionName)
|
||||
+ " not supported by device!");
|
||||
}
|
||||
|
||||
/* Returns a string containing the supported extensions list for a device. */
|
||||
std::string get_device_extensions_string(cl_device_id device)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user