You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][OpenCL] Update E2E Graph tests to run using OpenCL, and new helper function to return early if Graphs are not supported by the device. Added OpenCL section to CommandGraph docs.
Copy file name to clipboardExpand all lines: sycl/doc/design/CommandGraph.md
+60-1Lines changed: 60 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ yet been implemented.
149
149
Implementation of UR command-buffers
150
150
for each of the supported SYCL 2020 backends.
151
151
152
-
Currently Level Zero and CUDA backends are implemented.
152
+
Backends which are implemented currently are: Level Zero, CUDA and OpenCL.
153
153
More sub-sections will be added here as other backends are supported.
154
154
155
155
### Level Zero
@@ -246,3 +246,62 @@ the executable CUDA Graph that represent this series of operations.
246
246
An executable CUDA Graph, which contains all commands and synchronization
247
247
information, is saved in the UR command-buffer to allow for efficient
248
248
graph resubmission.
249
+
250
+
### OpenCL
251
+
252
+
Command Buffers are defined in the OpenCL spec in the [cl_khr_command_buffer](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_command_buffer) extension.
253
+
254
+
There are some gaps in both the OpenCL and UR specifications for Command
255
+
Buffers shown in the list below. There are implementations in the UR OpenCL
256
+
adapter where there is matching support for each function in the list.
Many of the OpenCL functions take a `cl_command_queue` parameter which is not
284
+
present in most of the UR functions. Instead, when a new command buffer is
285
+
created in `urCommandBufferCreateExp` we also create and maintain a new
286
+
internal `ur_queue_handle_t` with a reference stored inside of the
287
+
`ur_exp_command_buffer_handle_t_` struct. This internal queue is then used with
288
+
the various append functions. The internal queue is retained and released
289
+
whenever the owning command buffer is retained or released.
290
+
291
+
With command buffers being an OpenCL extension, each function is accessed by
292
+
loading a function pointer to its implementation. These are defined in a common
293
+
header file in the UR OpenCL adapter. The symbols for the functions are however
294
+
defined in [OpenCL-Headers](https://github.com/KhronosGroup/OpenCL-Headers/blob/main/CL/cl_ext.h) but it is not known at this time what version of the headers will be used in the UR GitHub CI configuration, so loading the function
295
+
pointers will be used until this can be verified. A future piece of work would
296
+
be replacing the custom defined symbols with the ones from OpenCL-Headers.
297
+
298
+
The `UR_DEVICE_INFO_EXTENSIONS` enum can be used with `urDeviceGetInfo` to
299
+
query if a specified device supports OpenCL command buffers. This will append
300
+
`ur_exp_command_buffer` to a string pointer passed to the function if the
301
+
extension is supported.
302
+
303
+
Known implementations of cl_khr_command_buffer:
304
+
-[OneAPI-Construction-Kit](https://github.com/codeplaysoftware/oneapi-construction-kit) (must enable `OCL_EXTENSION_cl_khr_command_buffer` when building)
0 commit comments