Using helper functions for clCreateKernel (#1064)

* Using helper functions for clCreateKernel

Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.

Contributes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Skip tests using clCompileProgram in offline mode

Contributes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Using type wrappers when using kernel helper functions

Also includes fix for windows build

Fixes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Remove clReleaseKernel for wrapped kernel

Fixes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
ellnor01
2021-01-07 11:34:42 +00:00
committed by GitHub
parent 85bae70f81
commit 25d9ff5d6e
13 changed files with 111 additions and 231 deletions

View File

@@ -89,13 +89,9 @@ int test_fmath(cl_device_id deviceID,
{
// Run the cl kernel for reference results
clProgramWrapper prog;
err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL);
SPIRV_CHECK_ERROR(err, "Failed to create cl program");
err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL);
SPIRV_CHECK_ERROR(err, "Failed to build program");
clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err);
clKernelWrapper kernel;
err = create_single_kernel_helper(context, &prog, &kernel, 1,
&kernelBuf, "fmath_cl");
SPIRV_CHECK_ERROR(err, "Failed to create cl kernel");
clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err);