Skip to content

Commit 6a3b016

Browse files
author
Ewan Crawford
authored
[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.
1 parent 70cf19a commit 6a3b016

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,20 @@ class depends_on {
323323
} // namespace node
324324
} // namespace property
325325
326+
// Device query for level of support
327+
namespace info {
328+
namespace device {
329+
struct graphs_support;
330+
331+
enum class graph_support_level {
332+
unsupported = 0,
333+
native,
334+
emulated
335+
};
336+
337+
} // namespace device
338+
} // namespace info
339+
326340
class node {};
327341
328342
// State of a graph
@@ -404,6 +418,30 @@ public:
404418
} // namespace sycl
405419
----
406420

421+
=== Device Info Query
422+
423+
Due to the experimental nature of the extension, support is not available across
424+
all devices. The following device support query is added to report devices which
425+
are currently supported, and how that support is implemented.
426+
427+
428+
Table {counter: tableNumber}. Device Info Queries.
429+
[%header]
430+
|===
431+
| Device Descriptors | Return Type | Description
432+
433+
|`info::device::graph_support`
434+
|`info::device::graph_support_level`
435+
|When passed to `device::get_info<...>()`, the function returns `native`
436+
if there is an underlying SYCL backend command-buffer construct which is used
437+
to propagate the graph to the backend. If no backend construct exists, or
438+
building on top of it has not yet been implemented, then `emulated` is
439+
returned. Otherwise `unsupported` is returned if the SYCL device doesn't
440+
support using this graph extension.
441+
442+
|===
443+
444+
407445
=== Node
408446

409447
:crs: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:reference-semantics
@@ -548,6 +586,9 @@ Exceptions:
548586
* Throws synchronously with error code `invalid` if `syclDevice` is not
549587
associated with `syclContext`.
550588

589+
* Throws synchronously with error code `invalid` if `syclDevice`
590+
<<device-info-query, reports this extension as unsupported>>.
591+
551592
|===
552593

553594
Table {counter: tableNumber}. Member functions of the `command_graph` class.

0 commit comments

Comments
 (0)