mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Use highest OpenCL C version (#1081)
* Set the highest supported OpenCL C version. * Remove gDeviceLt20 variable - not used anymore. * Fix formatting issues
This commit is contained in:
committed by
GitHub
parent
f02cbad2e3
commit
2597027737
@@ -35,7 +35,6 @@ bool gTestSmallImages;
|
||||
bool gTestMaxImages;
|
||||
bool gTestImage2DFromBuffer;
|
||||
bool gTestMipmaps;
|
||||
bool gDeviceLt20 = false;
|
||||
cl_filter_mode gFilterModeToUse = (cl_filter_mode)-1;
|
||||
// Default is CL_MEM_USE_HOST_PTR for the test
|
||||
cl_mem_flags gMemFlagsToUse = CL_MEM_USE_HOST_PTR;
|
||||
@@ -107,10 +106,6 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que
|
||||
bool tDisableOffsets = false;
|
||||
bool tNormalizedModeToUse = false;
|
||||
cl_filter_mode tFilterModeToUse = (cl_filter_mode)-1;
|
||||
auto version = get_device_cl_version(device);
|
||||
if (version < Version(2, 0)) {
|
||||
gDeviceLt20 = true;
|
||||
}
|
||||
|
||||
if( testTypesToRun & kReadTests )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@ extern bool gTestImage2DFromBuffer;
|
||||
extern uint64_t gRoundingStartValue;
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
// Utility function to clamp down image sizes for certain tests to avoid
|
||||
// using too much memory.
|
||||
@@ -1664,7 +1663,8 @@ int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_
|
||||
gTestMipmaps?", lod":" ");
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if( gTestSmallImages )
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
extern uint64_t gRoundingStartValue;
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
const char *read1DKernelSourcePattern =
|
||||
"__kernel void sample_kernel( read_only image1d_t input,%s __global float *xOffsets, __global %s4 *results %s)\n"
|
||||
@@ -1056,7 +1055,8 @@ int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_
|
||||
|
||||
ptr = programSrc;
|
||||
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
if(error)
|
||||
{
|
||||
exit(1);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
extern uint64_t gRoundingStartValue;
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
const char *read1DArrayKernelSourcePattern =
|
||||
"__kernel void sample_kernel( read_only image1d_array_t input,%s __global float *xOffsets, __global float *yOffsets, __global %s4 *results %s)\n"
|
||||
@@ -1165,7 +1164,8 @@ int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_co
|
||||
gTestMipmaps ? ", lod" : "" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if( gTestSmallImages )
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
// Utility function to clamp down image sizes for certain tests to avoid
|
||||
// using too much memory.
|
||||
@@ -1392,7 +1391,8 @@ int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_co
|
||||
gTestMipmaps ? ", lod" : " " );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
// Utility function to clamp down image sizes for certain tests to avoid
|
||||
// using too much memory.
|
||||
@@ -1230,7 +1229,8 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_
|
||||
gTestMipmaps? ",lod":" ");
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo );
|
||||
extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor* imageInfo );
|
||||
@@ -580,7 +579,8 @@ int test_write_image_1D_set( cl_device_id device, cl_context context, cl_command
|
||||
gTestMipmaps ? ", lod" :"" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo );
|
||||
extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo );
|
||||
@@ -603,7 +602,8 @@ int test_write_image_1D_array_set( cl_device_id device, cl_context context, cl_c
|
||||
gTestMipmaps ? ", lod" :"" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo );
|
||||
extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo );
|
||||
@@ -630,7 +629,8 @@ int test_write_image_2D_array_set( cl_device_id device, cl_context context, cl_c
|
||||
gTestMipmaps ? ", lod" : "" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo );
|
||||
extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo );
|
||||
@@ -636,7 +635,8 @@ int test_write_image_3D_set( cl_device_id device, cl_context context, cl_command
|
||||
gTestMipmaps ? ", lod" : "" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
extern bool gTestImage2DFromBuffer;
|
||||
extern cl_mem_flags gMemFlagsToUse;
|
||||
extern int gtestTypesToRun;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern int test_write_image_1D_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d );
|
||||
extern int test_write_image_3D_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d );
|
||||
@@ -682,7 +681,8 @@ int test_write_image_set( cl_device_id device, cl_context context, cl_command_qu
|
||||
gTestMipmaps ? ", lod" : "" );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0");
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
"sample_kernel");
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
// Run tests
|
||||
|
||||
Reference in New Issue
Block a user