summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEdB <[email protected]>2014-07-27 23:07:38 +0200
committerFrancisco Jerez <[email protected]>2014-07-28 14:45:29 +0200
commit39869423cb082c5feaa5ecf9119d3b97b5cdda88 (patch)
tree8968e039e9a372c9340eb051e8a1599f1e48d36c /src/gallium
parentbe8bc588b93286dff6a6c1e8594ec40da50658ff (diff)
clover: Add clCreateProgramWithBuiltInKernels.
[ Francisco Jerez: Check for devices not associated with the specified context. Style fix. ] Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/api/dispatch.cpp2
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp22
2 files changed, 23 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/dispatch.cpp b/src/gallium/state_trackers/clover/api/dispatch.cpp
index 488e65491bf..43b5537106a 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.cpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.cpp
@@ -121,7 +121,7 @@ namespace clover {
clRetainDevice,
clReleaseDevice,
clCreateImage,
- NULL, // clCreateProgramWithBuiltInKernels
+ clCreateProgramWithBuiltInKernels,
NULL, // clCompileProgram
NULL, // clLinkProgram
NULL, // clUnloadPlatformCompiler
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index a14baa30e06..293a61fdfa8 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -106,6 +106,28 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n,
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
clRetainProgram(cl_program d_prog) try {
obj(d_prog).retain();