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:
@@ -95,31 +95,9 @@ test_status InitCL( cl_device_id device )
|
||||
gDeviceFrequency = 1;
|
||||
|
||||
// Check extensions
|
||||
size_t extSize = 0;
|
||||
int hasDouble = 0;
|
||||
if((error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extSize)))
|
||||
{ vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); }
|
||||
else
|
||||
{
|
||||
char *ext = (char *)malloc( extSize );
|
||||
if( NULL == ext )
|
||||
{ vlog_error( "malloc failed at %s:%d\nUnable to determine if double present.\n", __FILE__, __LINE__ ); }
|
||||
else
|
||||
{
|
||||
if((error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extSize, ext, NULL)))
|
||||
{ vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); }
|
||||
else
|
||||
{
|
||||
if( strstr( ext, "cl_khr_fp64" ))
|
||||
hasDouble = 1;
|
||||
}
|
||||
free(ext);
|
||||
}
|
||||
}
|
||||
int hasDouble = is_extension_available(device, "cl_khr_fp64");
|
||||
gTestDouble ^= hasDouble;
|
||||
|
||||
|
||||
|
||||
//detect whether profile of the device is embedded
|
||||
char profile[64] = "";
|
||||
if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL ) ) )
|
||||
|
||||
Reference in New Issue
Block a user