aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2018-03-12 11:04:38 +0100
committerMarge Bot <[email protected]>2020-02-04 18:09:23 +0000
commit333c9d5bb054d5ac5518e830b535e8a4f3f80187 (patch)
treed3017916a97d3b9009dd263ad5dd5b6f337a53cc
parentb064697af1dc8927756986f396c793e0e23c42e9 (diff)
clover: add trivial clCreateCommandQueueWithProperties implementation
It's not adding 2.0 features, but it's enough to run the 2.0 CTS on top of clover and probably most CL applications using it. We just fail if we hit unknown properties and that's probably good enough until we implement the other bits properly. Signed-off-by: Karol Herbst <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Pierre Moreau <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2370> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2370>
-rw-r--r--src/gallium/state_trackers/clover/api/dispatch.cpp2
-rw-r--r--src/gallium/state_trackers/clover/api/queue.cpp21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/dispatch.cpp b/src/gallium/state_trackers/clover/api/dispatch.cpp
index 5671fe39814..a2d270ea05b 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.cpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.cpp
@@ -147,7 +147,7 @@ namespace clover {
NULL, // clEnqueueAcquireEGLObjectsKHR
NULL, // clEnqueueReleaseEGLObjectsKHR
NULL, // clCreateEventFromEGLSyncKHR
- NULL, // clCreateCommandQueueWithProperties
+ clCreateCommandQueueWithProperties,
NULL, // clCreatePipe
NULL, // clGetPipeInfo
NULL, // clSVMAlloc
diff --git a/src/gallium/state_trackers/clover/api/queue.cpp b/src/gallium/state_trackers/clover/api/queue.cpp
index 06a28638002..65b271b216f 100644
--- a/src/gallium/state_trackers/clover/api/queue.cpp
+++ b/src/gallium/state_trackers/clover/api/queue.cpp
@@ -112,3 +112,24 @@ clFlush(cl_command_queue d_q) try {
} catch (error &e) {
return e.get();
}
+
+CLOVER_API cl_command_queue
+clCreateCommandQueueWithProperties(cl_context context, cl_device_id device,
+ const cl_queue_properties *properties,
+ cl_int *errcode_ret) try {
+ cl_command_queue_properties props = 0;
+ if (properties) {
+ for (auto idx = 0; properties[idx]; idx += 2) {
+ if (properties[idx] == CL_QUEUE_PROPERTIES)
+ props |= properties[idx + 1];
+ else
+ throw error(CL_INVALID_VALUE);
+ }
+ }
+
+ return clCreateCommandQueue(context, device, props, errcode_ret);
+
+} catch (error &e) {
+ ret_error(errcode_ret, e);
+ return NULL;
+}