From a891ed8dcf28c4e52910338fc1a069ecb51a570a Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 8 Aug 2024 19:35:51 +0200 Subject: [PATCH] rusticl/queue: add clSetCommandQueueProperty The CL CTS started to call this API, luckily we don't have to actually implement it, because we don't intent to support CL 1.0 only devices in the first place (probably). Cc: mesa-stable Part-of: (cherry picked from commit cd2dc4f70c35b6981789b02c32a9f1d71562638c) --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/api/icd.rs | 2 +- src/gallium/frontends/rusticl/api/queue.rs | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e8bbada3593..62aa4302e3f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2654,7 +2654,7 @@ "description": "rusticl/queue: add clSetCommandQueueProperty", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/api/icd.rs b/src/gallium/frontends/rusticl/api/icd.rs index 7af9b53266c..7ee5ff62382 100644 --- a/src/gallium/frontends/rusticl/api/icd.rs +++ b/src/gallium/frontends/rusticl/api/icd.rs @@ -32,7 +32,7 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch { clRetainCommandQueue: Some(cl_retain_command_queue), clReleaseCommandQueue: Some(cl_release_command_queue), clGetCommandQueueInfo: Some(cl_get_command_queue_info), - clSetCommandQueueProperty: None, + clSetCommandQueueProperty: Some(cl_set_command_queue_property), clCreateBuffer: Some(cl_create_buffer), clCreateImage2D: Some(cl_create_image_2d), clCreateImage3D: Some(cl_create_image_3d), diff --git a/src/gallium/frontends/rusticl/api/queue.rs b/src/gallium/frontends/rusticl/api/queue.rs index 957faffaa55..14244e03706 100644 --- a/src/gallium/frontends/rusticl/api/queue.rs +++ b/src/gallium/frontends/rusticl/api/queue.rs @@ -41,6 +41,22 @@ impl CLInfo for cl_command_queue { } } +#[cl_entrypoint(clSetCommandQueueProperty)] +fn set_command_queue_property( + _command_queue: cl_command_queue, + _properties: cl_command_queue_properties, + _enable: cl_bool, + _old_properties: *mut cl_command_queue_properties, +) -> CLResult<()> { + // clSetCommandQueueProperty may unconditionally return an error if no devices in the context + // associated with command_queue support modifying the properties of a command-queue. Support + // for modifying the properties of a command-queue is required only for OpenCL 1.0 devices. + // + // CL_INVALID_OPERATION if no devices in the context associated with command_queue support + // modifying the properties of a command-queue. + Err(CL_INVALID_OPERATION) +} + fn valid_command_queue_properties(properties: cl_command_queue_properties) -> bool { let valid_flags = cl_bitfield::from( CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE