mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Remove check_opencl_version function (#734)
Removing all references to check_opencl_version as similar get_device_cl_version() can be used instead. Fixes #527 Change-Id: I474b6f536033707e1beb9b5b39410de24672c040 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
@@ -750,54 +750,6 @@ const char * subtests_to_skip_with_offline_compiler[] = {
|
||||
"kernel_preprocessor_macros",
|
||||
};
|
||||
|
||||
int check_opencl_version_with_testname(const char *subtestname, cl_device_id device)
|
||||
{
|
||||
int nRequiring12 = sizeof(subtests_requiring_opencl_1_2)/sizeof(char *);
|
||||
size_t i;
|
||||
for(i=0; i < nRequiring12; ++i) {
|
||||
if(!strcmp(subtestname, subtests_requiring_opencl_1_2[i])) {
|
||||
return check_opencl_version(device, 1, 2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int check_opencl_version(cl_device_id device, cl_uint requestedMajorVersion, cl_uint requestedMinorVersion) {
|
||||
int error;
|
||||
char device_version[1024];
|
||||
cl_uint majorVersion = 0, minorVersion = 0;
|
||||
const char * required_version_ocl_12="OpenCL 1.2 ";
|
||||
|
||||
memset( device_version, 0, sizeof( device_version ) );
|
||||
error = clGetDeviceInfo( device, CL_DEVICE_VERSION, sizeof(device_version), device_version, NULL );
|
||||
test_error(error, "unable to get CL_DEVICE_VERSION");
|
||||
|
||||
if ( strncmp( device_version, "OpenCL 1.2", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) {
|
||||
majorVersion = 1;
|
||||
minorVersion = 2;
|
||||
} else if ( strncmp( device_version, "OpenCL 1.1", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) {
|
||||
majorVersion = 1;
|
||||
minorVersion = 1;
|
||||
} else if ( strncmp( device_version, "OpenCL 2.0", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) {
|
||||
majorVersion = 2;
|
||||
minorVersion = 0;
|
||||
} else if ( strncmp( device_version, "OpenCL 2.1", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) {
|
||||
majorVersion = 2;
|
||||
minorVersion = 1;
|
||||
} else {
|
||||
log_error( "ERROR: Unexpected version string: `%s'.\n", device_version );
|
||||
return 1;
|
||||
};
|
||||
|
||||
if (majorVersion >= requestedMajorVersion)
|
||||
return 0;
|
||||
|
||||
if (minorVersion >= requestedMinorVersion)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int check_functions_for_offline_compiler(const char *subtestname, cl_device_id device)
|
||||
{
|
||||
if (gCompilationMode != kOnline)
|
||||
|
||||
@@ -107,8 +107,6 @@ extern int IsChannelOrderSupported( cl_channel_order order );
|
||||
extern const char *GetAddressModeName( cl_addressing_mode mode );
|
||||
|
||||
extern const char *GetDeviceTypeName( cl_device_type type );
|
||||
int check_opencl_version_with_testname(const char *subtestname, cl_device_id device);
|
||||
int check_opencl_version(cl_device_id device, cl_uint requestedMajorVersion, cl_uint requestedMinorVersion);
|
||||
int check_functions_for_offline_compiler(const char *subtestname, cl_device_id device);
|
||||
|
||||
// NON-REENTRANT UNLESS YOU PROVIDE A BUFFER PTR (pass null to use static storage, but it's not reentrant then!)
|
||||
|
||||
@@ -204,7 +204,7 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
|
||||
gDeviceLt20 = true;
|
||||
}
|
||||
|
||||
if ((version_check = check_opencl_version(device,1,2))) {
|
||||
if (version_check = (version < Version(1,2))) {
|
||||
switch (imageType) {
|
||||
case CL_MEM_OBJECT_IMAGE1D:
|
||||
test_missing_feature(version_check, "image_1D");
|
||||
|
||||
@@ -323,7 +323,7 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
|
||||
}
|
||||
}
|
||||
|
||||
int version_check = check_opencl_version(device,1,2);
|
||||
int version_check = (get_device_cl_version(device) < Version(1,2));
|
||||
if (version_check != 0) {
|
||||
switch (imageType) {
|
||||
case CL_MEM_OBJECT_IMAGE1D:
|
||||
|
||||
Reference in New Issue
Block a user