mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 14:39:01 +00:00
Ensure is_extension_available is used where possible (#722)
(Patch2) A number of tests have got their own code for checking the presence of extensions. This change replaces that code with is_extension_available function. Contributes to #627 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> Change-Id: I17e007e5ad009e522c5006c42537bf1170550a6f
This commit is contained in:
@@ -67,37 +67,6 @@ void CResult::ResultSub( TTestResult result )
|
||||
_result = result;
|
||||
}
|
||||
|
||||
bool ExtensionCheck(const std::string &extension, cl_device_id deviceID)
|
||||
{
|
||||
std::string extensions;
|
||||
size_t size = 0;
|
||||
cl_int error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, 0, &size);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clGetDeviceInfo failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
print_error(error, "Invalid extension string size\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
extensions.resize(size);
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, size, &extensions[0], 0);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clGetDeviceInfo failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (extensions.find(extension) != std::string::npos)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void FunctionContextCreateToString(TContextFuncType contextCreateFunction, std::string &contextFunction)
|
||||
{
|
||||
switch(contextCreateFunction)
|
||||
|
||||
Reference in New Issue
Block a user