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

@@ -400,41 +400,10 @@ cl_int HarnessD3D11_CreateKernelFromSource(
const char *sourceTexts[] = {source};
size_t sourceLengths[] = {strlen(source) };
status = create_single_kernel_helper_create_program(context, &program, 1, &sourceTexts[0]);
TestRequire(
CL_SUCCESS == status,
"clCreateProgramWithSource failed");
status = create_single_kernel_helper(context, &program, &kernel, 1,
&sourceTexts[0], entrypoint);
TestRequire(CL_SUCCESS == status, "Kernel creation failed");
}
status = clBuildProgram(
program,
0,
NULL,
NULL,
NULL,
NULL);
if (CL_SUCCESS != status)
{
char log[2048] = {0};
status = clGetProgramBuildInfo(
program,
device,
CL_PROGRAM_BUILD_LOG,
sizeof(log),
log,
NULL);
TestPrint("error: %s\n", log);
TestRequire(
CL_SUCCESS == status,
"Compilation error log:\n%s\n", log);
}
kernel = clCreateKernel(
program,
entrypoint,
&status);
TestRequire(
CL_SUCCESS == status,
"clCreateKernel failed");
clReleaseProgram(program);
*outKernel = kernel;