mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09: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:
@@ -74,15 +74,7 @@ HarnessD3D11_ExtensionCheck()
|
||||
cl_uint num_devices_d3d11 = 0; // Number of devices supporting cl_khr_d3d11_sharing.
|
||||
for ( cl_uint i = 0; i < devices.size(); ++ i )
|
||||
{
|
||||
std::vector< char > buffer;
|
||||
size_t size = 0;
|
||||
result = clGetDeviceInfo( devices[ i ], CL_DEVICE_EXTENSIONS, 0, NULL, & size );
|
||||
NonTestRequire( result == CL_SUCCESS, "Failed to get size of extension string." );
|
||||
buffer.resize( size );
|
||||
result = clGetDeviceInfo( devices[ i ], CL_DEVICE_EXTENSIONS, buffer.size(), & buffer.front(), & size );
|
||||
NonTestRequire( result == CL_SUCCESS, "Failed to get extension string." );
|
||||
std::string extensions = std::string( " " ) + & buffer.front() + " ";
|
||||
if ( extensions.find( " cl_khr_d3d11_sharing " ) != std::string::npos )
|
||||
if (is_extension_available( devices[i], " cl_khr_d3d11_sharing " ))
|
||||
{
|
||||
++ num_devices_d3d11;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user