Skip to content

Commit

Permalink
cl_khr_kernel_clock: use create_single_kernel_helper (KhronosGroup#1978)
Browse files Browse the repository at this point in the history
`create_single_kernel_helper` invokes `clBuildProgram` and sets
`-cl-std` to the latest version supported by the context.

The vast majority of tests are using `create_single_kernel_helper`
instead of the `..._create_program` variant, so use the former for the
sake of consistency.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh committed Jun 18, 2024
1 parent b6941b6 commit 2b26643
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,14 @@ class KernelClockTest {

ptr = kernel_src;

error = create_single_kernel_helper_create_program(
context, &program, 1, &ptr);
error = create_single_kernel_helper(context, &program, &kernel, 1,
&ptr, "SampleClock");
test_error(error, "Failed to create program with source");

error =
clBuildProgram(program, 1, &device, nullptr, nullptr, nullptr);
test_error(error, "Failed to build program");

out_mem = clCreateBuffer(context, CL_MEM_WRITE_ONLY,
sizeof(cl_uint), nullptr, &error);
test_error(error, "clCreateBuffer failed");

kernel = clCreateKernel(program, "SampleClock", &error);
test_error(error, "Failed to create kernel");

error = clSetKernelArg(kernel, 0, sizeof(out_mem), &out_mem);
test_error(error, "clSetKernelArg failed");

Expand Down

0 comments on commit 2b26643

Please sign in to comment.