From 4ce6ab053a51d97f37097157c7c3f24b84aee8ec Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 5 Jun 2024 15:31:52 +0100 Subject: [PATCH 1/2] cl_khr_kernel_clock: use create_single_kernel_helper `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 --- .../extensions/cl_khr_kernel_clock/kernel_clock.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp b/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp index 06a262d897..d3b1ea4788 100644 --- a/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp +++ b/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp @@ -109,14 +109,10 @@ 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"); From bf07863be4bf654838a826c60f7c628473a4eea1 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Fri, 7 Jun 2024 13:22:38 +0100 Subject: [PATCH 2/2] Drop now-redundant clCreateKernel call --- .../extensions/cl_khr_kernel_clock/kernel_clock.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp b/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp index d3b1ea4788..744083a93d 100644 --- a/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp +++ b/test_conformance/extensions/cl_khr_kernel_clock/kernel_clock.cpp @@ -117,9 +117,6 @@ class KernelClockTest { 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");