DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph Class Reference

#include <sycl/ext/oneapi/experimental/graph.hpp>

Inheritance diagram for sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph:
Collaboration diagram for sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph:

Public Member Functions

 modifiable_command_graph (const context &SyclContext, const device &SyclDevice, const property_list &PropList={})
 Constructor. More...
 
 modifiable_command_graph (const queue &SyclQueue, const property_list &PropList={})
 Constructor. More...
 
node add (const property_list &PropList={})
 Add an empty node to the graph. More...
 
template<typename T >
node add (T CGF, const property_list &PropList={})
 Add a command-group node to the graph. More...
 
void make_edge (node &Src, node &Dest)
 Add a dependency between two nodes. More...
 
command_graph< graph_state::executablefinalize (const property_list &PropList={}) const
 Finalize modifiable graph into an executable graph. More...
 
bool begin_recording (queue &RecordingQueue)
 Change the state of a queue to be recording and associate this graph with it. More...
 
bool begin_recording (const std::vector< queue > &RecordingQueues)
 Change the state of multiple queues to be recording and associate this graph with each of them. More...
 
bool end_recording ()
 Set all queues currently recording to this graph to the executing state. More...
 
bool end_recording (queue &RecordingQueue)
 Set a queue currently recording to this graph to the executing state. More...
 
bool end_recording (const std::vector< queue > &RecordingQueues)
 Set multiple queues currently recording to this graph to the executing state. More...
 
void print_graph (const std::string path, bool verbose=false) const
 Synchronous operation that writes a DOT formatted description of the graph to the provided path. More...
 
std::vector< nodeget_nodes () const
 Get a list of all nodes contained in this graph. More...
 
std::vector< nodeget_root_nodes () const
 Get a list of all root nodes (nodes without dependencies) in this graph. More...
 

Protected Member Functions

 modifiable_command_graph (const std::shared_ptr< detail::graph_impl > &Impl)
 Constructor used internally by the runtime. More...
 
node addImpl (std::function< void(handler &)> CGF, const std::vector< node > &Dep)
 Template-less implementation of add() for CGF nodes. More...
 
node addImpl (const std::vector< node > &Dep)
 Template-less implementation of add() for empty nodes. More...
 
void addGraphLeafDependencies (node Node)
 Adds all graph leaves as dependencies. More...
 
template<class Obj >
decltype(Obj::impl) friend sycl::detail::getSyclObjImpl (const Obj &SyclObject)
 

Protected Attributes

std::shared_ptr< detail::graph_implimpl
 

Friends

template<class T >
sycl::detail::createSyclObjFromImpl (decltype(T::impl) ImplObj)
 

Detailed Description

Definition at line 184 of file graph.hpp.

Constructor & Destructor Documentation

◆ modifiable_command_graph() [1/3]

sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::modifiable_command_graph ( const context SyclContext,
const device SyclDevice,
const property_list PropList = {} 
)

Constructor.

Parameters
SyclContextContext to use for graph.
SyclDeviceDevice all nodes will be associated with.
PropListOptional list of properties to pass.

◆ modifiable_command_graph() [2/3]

sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::modifiable_command_graph ( const queue SyclQueue,
const property_list PropList = {} 
)

Constructor.

Parameters
SyclQueueQueue to use for the graph device and context.
PropListOptional list of properties to pass.

◆ modifiable_command_graph() [3/3]

sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::modifiable_command_graph ( const std::shared_ptr< detail::graph_impl > &  Impl)
inlineprotected

Constructor used internally by the runtime.

Parameters
ImplDetail implementation class to construct object with.

Definition at line 300 of file graph.hpp.

Member Function Documentation

◆ add() [1/2]

node sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::add ( const property_list PropList = {})
inline

Add an empty node to the graph.

Parameters
PropListProperty list used to pass [0..n] predecessor nodes.
Returns
Constructed empty node which has been added to the graph.

Definition at line 202 of file graph.hpp.

◆ add() [2/2]

template<typename T >
node sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::add ( CGF,
const property_list PropList = {} 
)
inline

Add a command-group node to the graph.

Parameters
CGFCommand-group function to create node with.
PropListProperty list used to pass [0..n] predecessor nodes.
Returns
Constructed node which has been added to the graph.

Definition at line 222 of file graph.hpp.

◆ addGraphLeafDependencies()

void sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::addGraphLeafDependencies ( node  Node)
protected

Adds all graph leaves as dependencies.

Parameters
NodeDestination node to which the leaves of the graph will be added as dependencies.

Definition at line 1131 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and impl.

◆ addImpl() [1/2]

node sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::addImpl ( const std::vector< node > &  Dep)
protected

Template-less implementation of add() for empty nodes.

Parameters
DepList of predecessor nodes.
Returns
Node added to the graph.

Definition at line 1105 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and impl.

◆ addImpl() [2/2]

node sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::addImpl ( std::function< void(handler &)>  CGF,
const std::vector< node > &  Dep 
)
protected

Template-less implementation of add() for CGF nodes.

Parameters
CGFCommand-group function to add.
DepList of predecessor nodes.
Returns
Node added to the graph.

Definition at line 1117 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and impl.

◆ begin_recording() [1/2]

bool sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::begin_recording ( const std::vector< queue > &  RecordingQueues)

Change the state of multiple queues to be recording and associate this graph with each of them.

Parameters
RecordingQueuesThe queues to change state on and associate this graph with.
Returns
True if any queue had its state changed from executing to recording.

Definition at line 1209 of file graph_impl.cpp.

References begin_recording().

◆ begin_recording() [2/2]

bool sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::begin_recording ( queue RecordingQueue)

Change the state of a queue to be recording and associate this graph with it.

Parameters
RecordingQueueThe queue to change state on and associate this graph with.
Returns
True if the queue had its state changed from executing to recording.

Definition at line 1163 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), impl, and sycl::_V1::invalid.

Referenced by begin_recording().

◆ end_recording() [1/3]

bool sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::end_recording ( )

Set all queues currently recording to this graph to the executing state.

Returns
True if any queue had its state changed from recording to executing.

Definition at line 1218 of file graph_impl.cpp.

References impl.

Referenced by end_recording().

◆ end_recording() [2/3]

bool sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::end_recording ( const std::vector< queue > &  RecordingQueues)

Set multiple queues currently recording to this graph to the executing state.

Parameters
RecordingQueuesThe queues to change state on.
Returns
True if any queue had its state changed from recording to executing.

Definition at line 1241 of file graph_impl.cpp.

References end_recording().

◆ end_recording() [3/3]

bool sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::end_recording ( queue RecordingQueue)

Set a queue currently recording to this graph to the executing state.

Parameters
RecordingQueueThe queue to change state on.
Returns
True if the queue had its state changed from recording to executing.

Definition at line 1223 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), impl, and sycl::_V1::invalid.

◆ finalize()

command_graph< graph_state::executable > sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::finalize ( const property_list PropList = {}) const

Finalize modifiable graph into an executable graph.

Parameters
PropListProperty list used to pass properties for finalization.
Returns
Executable graph object.

Definition at line 1155 of file graph_impl.cpp.

References impl.

◆ get_nodes()

std::vector< node > sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::get_nodes ( ) const

Get a list of all nodes contained in this graph.

Definition at line 1262 of file graph_impl.cpp.

References impl.

◆ get_root_nodes()

std::vector< node > sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::get_root_nodes ( ) const

Get a list of all root nodes (nodes without dependencies) in this graph.

Definition at line 1265 of file graph_impl.cpp.

References impl.

◆ make_edge()

void sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::make_edge ( node Src,
node Dest 
)

Add a dependency between two nodes.

Parameters
SrcNode which will be a dependency of Dest.
DestNode which will be dependent on Src.

Definition at line 1144 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and impl.

◆ print_graph()

void sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::print_graph ( const std::string  path,
bool  verbose = false 
) const

Synchronous operation that writes a DOT formatted description of the graph to the provided path.

By default, this includes the graph topology, node types, node id and kernel names.

Parameters
pathThe path to write the DOT file to.
verboseIf true, print additional information about the nodes such as kernel args or memory access where applicable.

Definition at line 1250 of file graph_impl.cpp.

References impl, and sycl::_V1::invalid.

◆ sycl::detail::getSyclObjImpl()

template<class Obj >
decltype(Obj::impl) friend sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::sycl::detail::getSyclObjImpl ( const Obj &  SyclObject)
protected

Friends And Related Function Documentation

◆ sycl::detail::createSyclObjFromImpl

template<class T >
T sycl::detail::createSyclObjFromImpl ( decltype(T::impl)  ImplObj)
friend

Member Data Documentation

◆ impl

std::shared_ptr<detail::graph_impl> sycl::_V1::ext::oneapi::experimental::detail::modifiable_command_graph::impl
protected

The documentation for this class was generated from the following files: