Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,29 @@ _Throws:_ Synchronously `exception` with error code `invalid` if the device
associated with
`syclQueue` <<device-info-query, reports this extension as unsupported>>.

[source,c++]
----
command_graph(const device& syclDevice,
const property_list& propList = {});
----

_Effects:_ Simplified constructor form where only device `syclDevice` is provided
without explicitly passing a context. The graph uses the platform's default context.
Zero or more properties can be provided to the constructed SYCL `command_graph`
via an instance of `property_list`. All other properties of the queue are
ignored for the purposes of graph creation. See the
<<Queue Properties, Queue Properties>> section for more general information
about how queue properties interact with `command_graph` objects.

_Constraints:_ This constructor is only available when the `command_graph` state is
`graph_state::modifiable`.

_Preconditions:_ Valid `command_graph` constructor properties are listed in
Section <<graph-properties, Graph Properties>>.

_Throws:_ Synchronously `exception` with error code `invalid` if `syclDevice`
<<device-info-query, reports this extension as unsupported>>.

===== Member functions of the `command_graph` class

[source,c++]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ class command_graph : public detail::modifiable_command_graph {
const property_list &PropList = {})
: modifiable_command_graph(SyclQueue, PropList) {}

/// Constructor with default context.
/// @param SyclDevice Device all nodes will be associated with.
/// @param PropList Optional list of properties to pass.
explicit command_graph(const device &SyclDevice,
const property_list &PropList = {})
: modifiable_command_graph(SyclDevice, PropList) {}

private:
/// Constructor used internally by the runtime.
/// @param Impl Detail implementation class to construct object with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class __SYCL_EXPORT modifiable_command_graph
modifiable_command_graph(const queue &SyclQueue,
const property_list &PropList = {});

/// Constructor with default context.
/// @param SyclDevice Device all nodes will be associated with.
/// @param PropList Optional list of properties to pass.
modifiable_command_graph(const device &SyclDevice,
const property_list &PropList = {});

/// Add an empty node to the graph.
/// @param PropList Property list used to pass [0..n] predecessor nodes.
/// @return Constructed empty node which has been added to the graph.
Expand Down
6 changes: 6 additions & 0 deletions sycl/source/detail/graph/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,12 @@ modifiable_command_graph::modifiable_command_graph(
: impl(std::make_shared<detail::graph_impl>(
SyclQueue.get_context(), SyclQueue.get_device(), PropList)) {}

modifiable_command_graph::modifiable_command_graph(
const sycl::device &SyclDevice, const sycl::property_list &PropList)
: impl(std::make_shared<detail::graph_impl>(
SyclDevice.get_platform().khr_get_default_context(), SyclDevice,
PropList)) {}

node modifiable_command_graph::addImpl(dynamic_command_group &DynCGF,
const std::vector<node> &Deps) {
impl->throwIfGraphRecordingQueue("Explicit API \"Add()\" function");
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/Inputs/basic_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main() {
calculate_reference_data(Iterations, Size, ReferenceA, ReferenceB,
ReferenceC);

exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};
exp_ext::command_graph Graph{Queue.get_device()};

T *PtrA = malloc_device<T>(Size, Queue);
T *PtrB = malloc_device<T>(Size, Queue);
Expand Down
2 changes: 2 additions & 0 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3113,8 +3113,10 @@ _ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph7addImplER
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph7addImplESt8functionIFvRNS0_7handlerEEERKSt6vectorINS3_4nodeESaISC_EE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph9make_edgeERNS3_4nodeES7_
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC1ERKNS0_5queueERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC1ERKNS0_6deviceERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC1ERKNS0_7contextERKNS0_6deviceERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC2ERKNS0_5queueERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC2ERKNS0_6deviceERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graphC2ERKNS0_7contextERKNS0_6deviceERKNS0_13property_listE
_ZN4sycl3_V13ext6oneapi12experimental6detail27dynamic_local_accessor_base19updateLocalAccessorENS0_5rangeILi3EEE
_ZN4sycl3_V13ext6oneapi12experimental6detail27dynamic_local_accessor_baseC1ENS0_5rangeILi3EEEiiRKNS0_13property_listE
Expand Down
1 change: 1 addition & 0 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV0123456@@Z
??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV0123456@@Z
??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVcontext@56@AEBVdevice@56@AEBVproperty_list@56@@Z
??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVdevice@56@AEBVproperty_list@56@@Z
??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVqueue@56@AEBVproperty_list@56@@Z
??0node@experimental@oneapi@ext@_V1@sycl@@AEAA@AEBV?$shared_ptr@Vnode_impl@detail@experimental@oneapi@ext@_V1@sycl@@@std@@@Z
??0node@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV012345@@Z
Expand Down