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:
Grzegorz Wawiorko
2021-01-11 14:54:19 +01:00
committed by GitHub
parent f02cbad2e3
commit 2597027737
53 changed files with 247 additions and 165 deletions

View File

@@ -23,7 +23,6 @@
bool gDebugTrace;
bool gTestSmallImages;
bool gTestMaxImages;
bool gDeviceLt20 = false;
cl_channel_type gChannelTypeToUse = (cl_channel_type)-1;
cl_channel_order gChannelOrderToUse = (cl_channel_order)-1;

View File

@@ -15,7 +15,6 @@
//
#include "../testBase.h"
extern bool gDeviceLt20;
struct image_kernel_data
{
@@ -98,7 +97,8 @@ static int test_get_1Dimage_info_single(cl_context context,
if (error)
print_error(error, "clFinish failed.\n");
const char *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 kernel to test against" );
// Create an output buffer

View File

@@ -15,7 +15,6 @@
//
#include "../testBase.h"
extern bool gDeviceLt20;
struct image_kernel_data
{
@@ -102,7 +101,8 @@ int test_get_1Dimage_array_info_single(cl_context context,
if (error)
print_error(error, "clFinish failed.\n");
const char *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 kernel to test against" );
// Create an output buffer

View File

@@ -15,7 +15,6 @@
//
#include "../testBase.h"
extern bool gDeviceLt20;
struct image_kernel_data
{
@@ -133,7 +132,8 @@ int test_get_image_info_single(cl_context context, cl_command_queue queue,
if (error)
print_error(error, "clFinish failed.\n");
const char *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 kernel to test against" );
// Create an output buffer

View File

@@ -15,7 +15,6 @@
//
#include "../testBase.h"
extern bool gDeviceLt20;
struct image_kernel_data
{
@@ -108,7 +107,8 @@ int test_get_2Dimage_array_info_single(cl_context context,
if (error)
print_error(error, "clFinish failed.\n");
const char *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 kernel to test against" );
// Create an output buffer

View File

@@ -16,7 +16,6 @@
#include "../testBase.h"
#include "../common.h"
extern bool gDeviceLt20;
extern int test_get_image_info_1D(cl_device_id device, cl_context context,
cl_command_queue queue,
@@ -117,9 +116,6 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
{
int version_check;
auto version = get_device_cl_version(device);
if (version < Version(2, 0)) {
gDeviceLt20 = true;
}
if ((version_check = (version < Version(1, 2))))
{