mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
fixes test_opencl_c_versions logic error (#2377)
Found while developing #2376. Parts of "test_opencl_c_versions" were intending to build programs for different OpenCL C versions, but unfortunately the helper function the test was calling only created the program and did not build it. Switch to a helper function that builds the program, instead.
This commit is contained in:
@@ -56,9 +56,9 @@ static int test_CL_DEVICE_OPENCL_C_VERSION(cl_device_id device,
|
|||||||
// For OpenCL 2.x, the minimum required OpenCL C version is OpenCL C 2.0.
|
// For OpenCL 2.x, the minimum required OpenCL C version is OpenCL C 2.0.
|
||||||
// For other OpenCL versions, the minimum required OpenCL C version is
|
// For other OpenCL versions, the minimum required OpenCL C version is
|
||||||
// the same as the API version.
|
// the same as the API version.
|
||||||
const Version min_clc_version = api_version == Version(3, 0)
|
const Version min_clc_version = api_version == Version(3, 0) ? Version(1, 2)
|
||||||
? Version(1, 2)
|
: api_version >= Version(2, 0) ? Version(2, 0)
|
||||||
: api_version >= Version(2, 0) ? Version(2, 0) : api_version;
|
: api_version;
|
||||||
if (clc_version < min_clc_version)
|
if (clc_version < min_clc_version)
|
||||||
{
|
{
|
||||||
log_error("The minimum required OpenCL C version for API version %s is "
|
log_error("The minimum required OpenCL C version for API version %s is "
|
||||||
@@ -88,9 +88,9 @@ static int test_CL_DEVICE_OPENCL_C_VERSION(cl_device_id device,
|
|||||||
if (clc_version >= testcase.version)
|
if (clc_version >= testcase.version)
|
||||||
{
|
{
|
||||||
clProgramWrapper program;
|
clProgramWrapper program;
|
||||||
cl_int error =
|
clKernelWrapper kernel;
|
||||||
create_single_kernel_helper_create_program_for_device(
|
cl_int error = create_single_kernel_helper(
|
||||||
context, device, &program, 1, &test_kernel,
|
context, &program, &kernel, 1, &test_kernel, "test",
|
||||||
testcase.buildOptions);
|
testcase.buildOptions);
|
||||||
test_error(error, "Unable to build program!");
|
test_error(error, "Unable to build program!");
|
||||||
|
|
||||||
@@ -152,8 +152,9 @@ static int test_CL_DEVICE_OPENCL_C_ALL_VERSIONS(cl_device_id device,
|
|||||||
buildOptions += std::to_string(minor);
|
buildOptions += std::to_string(minor);
|
||||||
|
|
||||||
clProgramWrapper program;
|
clProgramWrapper program;
|
||||||
error = create_single_kernel_helper_create_program_for_device(
|
clKernelWrapper kernel;
|
||||||
context, device, &program, 1, &test_kernel,
|
error = create_single_kernel_helper(context, &program, &kernel, 1,
|
||||||
|
&test_kernel, "test",
|
||||||
buildOptions.c_str());
|
buildOptions.c_str());
|
||||||
test_error(error, "Unable to build program!");
|
test_error(error, "Unable to build program!");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user