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:
@@ -473,30 +473,7 @@ test_status InitCL( cl_device_id device )
|
||||
gForceFTZ ^= 1;
|
||||
|
||||
// check for cl_khr_fp64
|
||||
size_t extensions_size = 0;
|
||||
if( (error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensions_size )))
|
||||
{
|
||||
vlog_error( "clGetDeviceInfo(CL_DEVICE_EXTENSIONS) failed. %d\n", error );
|
||||
return TEST_FAIL;
|
||||
}
|
||||
if( extensions_size )
|
||||
{
|
||||
char *extensions = (char*)malloc(extensions_size);
|
||||
if( NULL == extensions )
|
||||
{
|
||||
vlog_error( "ERROR: Unable to allocate %ld bytes to hold extensions string\n", extensions_size );
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if( (error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensions_size, extensions, NULL )))
|
||||
{
|
||||
vlog_error( "clGetDeviceInfo(CL_DEVICE_EXTENSIONS) failed 2. %d\n", error );
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
gHasDouble = NULL != strstr( extensions, "cl_khr_fp64" );
|
||||
free( extensions );
|
||||
}
|
||||
gHasDouble = is_extension_available(device, "cl_khr_fp64" );
|
||||
|
||||
if(0 == (CL_FP_INF_NAN & floatCapabilities) )
|
||||
gSkipNanInf = 1;
|
||||
|
||||
Reference in New Issue
Block a user