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 (#721)
(Patch1) 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 Change-Id: I8dd2233719aa8c84841ac61776437d7f6e3fafe6 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
@@ -394,33 +394,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
||||
gInfNanSupport = 0;
|
||||
|
||||
// check the extensions list to see if ulong and long are supported
|
||||
size_t extensionsStringSize = 0;
|
||||
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensionsStringSize ) ))
|
||||
{
|
||||
print_error( err, "Unable to get extensions string size for embedded device" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
char *extensions_string = (char*) malloc(extensionsStringSize);
|
||||
if( NULL == extensions_string )
|
||||
{
|
||||
print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
BufferOwningPtr<char> extensions_stringBuf(extensions_string);
|
||||
|
||||
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensionsStringSize, extensions_string, NULL ) ))
|
||||
{
|
||||
print_error( err, "Unable to get extensions string for embedded device" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if( extensions_string[extensionsStringSize-1] != '\0' )
|
||||
{
|
||||
log_error( "FAILURE: extensions string for embedded device is not NUL terminated" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if( NULL == strstr( extensions_string, "cles_khr_int64" ))
|
||||
if( !is_extension_available(device, "cles_khr_int64" ))
|
||||
gHasLong = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user