From 8eb1cae266487e5d5730c435f64e620d9544084e Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Wed, 17 May 2023 09:03:53 +0100 Subject: [PATCH 1/2] [SYCL][Doc] Device query for graphs support Although we have an emulation mode for when a SYCL backend doesn't support PI/UR command-buffers, we don't have good implementation coverage across it's usage on all possible backends. Providing a support query would allow us to limit the backends we support while an experimental extension to say CUDA and Level Zero, and maybe OpenCL. Rather than having users with FPGA and esimd_emulator trying to use the extension and crashing because we've not tested these platforms even with emulation mode. We could remove this query once the implementation is more mature and we can trust emulation mode support on all backends, but I don't think that's the case at the moment. --- .../proposed/sycl_ext_oneapi_graph.asciidoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc index ff131b324ac85..6b682be730f84 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc @@ -404,6 +404,20 @@ public: } // namespace sycl ---- +=== Device Info Query + +Due to the experimental nature of the extension, support is not available across +all devices. The following device support query is added to report devices which +are currently supported. + +[source, c++] +---- +sycl::ext::oneapi::experimental::info::device::graph_support; +---- + +When passed to `device::get_info<...>()`, the function returns `true` if the SYCL +`device` supports using this graph extension. + === Node :crs: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:reference-semantics @@ -548,6 +562,9 @@ Exceptions: * Throws synchronously with error code `invalid` if `syclDevice` is not associated with `syclContext`. +* Throws synchronously with error code `invalid` if `syclDevice` does not + <>. + |=== Table {counter: tableNumber}. Member functions of the `command_graph` class. From bab9c2b3494736d17ef180e02b630111f7c210a8 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Thu, 18 May 2023 09:00:12 +0100 Subject: [PATCH 2/2] Return an enum rather than bool from device query This provides extra information about how support is implemented. --- .../proposed/sycl_ext_oneapi_graph.asciidoc | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc index 6b682be730f84..1d46317e32f6b 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc @@ -323,6 +323,20 @@ class depends_on { } // namespace node } // namespace property +// Device query for level of support +namespace info { +namespace device { +struct graphs_support; + +enum class graph_support_level { + unsupported = 0, + native, + emulated +}; + +} // namespace device +} // namespace info + class node {}; // State of a graph @@ -408,15 +422,25 @@ public: Due to the experimental nature of the extension, support is not available across all devices. The following device support query is added to report devices which -are currently supported. +are currently supported, and how that support is implemented. -[source, c++] ----- -sycl::ext::oneapi::experimental::info::device::graph_support; ----- -When passed to `device::get_info<...>()`, the function returns `true` if the SYCL -`device` supports using this graph extension. +Table {counter: tableNumber}. Device Info Queries. +[%header] +|=== +| Device Descriptors | Return Type | Description + +|`info::device::graph_support` +|`info::device::graph_support_level` +|When passed to `device::get_info<...>()`, the function returns `native` +if there is an underlying SYCL backend command-buffer construct which is used +to propagate the graph to the backend. If no backend construct exists, or +building on top of it has not yet been implemented, then `emulated` is +returned. Otherwise `unsupported` is returned if the SYCL device doesn't +support using this graph extension. + +|=== + === Node @@ -562,8 +586,8 @@ Exceptions: * Throws synchronously with error code `invalid` if `syclDevice` is not associated with `syclContext`. -* Throws synchronously with error code `invalid` if `syclDevice` does not - <>. +* Throws synchronously with error code `invalid` if `syclDevice` + <>. |===