Commit 39869423 authored by Serge Martin's avatar Serge Martin Committed by Francisco Jerez
Browse files

clover: Add clCreateProgramWithBuiltInKernels.



[ Francisco Jerez: Check for devices not associated with the specified
  context.  Style fix. ]
Reviewed-by: Francisco Jerez's avatarFrancisco Jerez <currojerez@riseup.net>
parent be8bc588
...@@ -121,7 +121,7 @@ namespace clover { ...@@ -121,7 +121,7 @@ namespace clover {
clRetainDevice, clRetainDevice,
clReleaseDevice, clReleaseDevice,
clCreateImage, clCreateImage,
NULL, // clCreateProgramWithBuiltInKernels clCreateProgramWithBuiltInKernels,
NULL, // clCompileProgram NULL, // clCompileProgram
NULL, // clLinkProgram NULL, // clLinkProgram
NULL, // clUnloadPlatformCompiler NULL, // clUnloadPlatformCompiler
......
...@@ -106,6 +106,28 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n, ...@@ -106,6 +106,28 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n,
return NULL; return NULL;
} }
CLOVER_API cl_program
clCreateProgramWithBuiltInKernels(cl_context d_ctx, cl_uint n,
const cl_device_id *d_devs,
const char *kernel_names,
cl_int *r_errcode) try {
auto &ctx = obj(d_ctx);
auto devs = objs(d_devs, n);
if (any_of([&](const device &dev) {
return !count(dev, ctx.devices());
}, devs))
throw error(CL_INVALID_DEVICE);
// No currently supported built-in kernels.
throw error(CL_INVALID_VALUE);
} catch (error &e) {
ret_error(r_errcode, e);
return NULL;
}
CLOVER_API cl_int CLOVER_API cl_int
clRetainProgram(cl_program d_prog) try { clRetainProgram(cl_program d_prog) try {
obj(d_prog).retain(); obj(d_prog).retain();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment