Implementation of node class from SYCL_EXT_ONEAPI_GRAPH. More...
#include <detail/graph_impl.hpp>
Public Types | |
using | id_type = uint64_t |
Public Member Functions | |
void | registerSuccessor (const std::shared_ptr< node_impl > &Node, const std::shared_ptr< node_impl > &Prev) |
Add successor to the node. More... | |
void | registerPredecessor (const std::shared_ptr< node_impl > &Node) |
Add predecessor to the node. More... | |
node_impl () | |
Construct an empty node. More... | |
node_impl (node_type NodeType, std::unique_ptr< sycl::detail::CG > &&CommandGroup) | |
Construct a node representing a command-group. More... | |
node_impl (node_impl &Other) | |
Construct a node from another node. More... | |
node_impl & | operator= (node_impl &Other) |
Copy-assignment operator. More... | |
bool | hasRequirementDependency (sycl::detail::AccessorImplHost *IncomingReq) |
Checks if this node should be a dependency of another node based on accessor requirements. More... | |
bool | isEmpty () const |
Query if this is an empty node. More... | |
std::unique_ptr< sycl::detail::CG > | getCGCopy () const |
Get a deep copy of this node's command group. More... | |
bool | isSimilar (const std::shared_ptr< node_impl > &Node, bool CompareContentOnly=false) const |
Tests if the caller is similar to Node, this is only used for testing. More... | |
void | printDotRecursive (std::fstream &Stream, std::vector< node_impl * > &Visited, bool Verbose) |
Recursive Depth first traversal of linked nodes. More... | |
void | updateAccessor (int ArgIndex, const sycl::detail::AccessorBaseHost *Acc) |
Update the value of an accessor inside this node. More... | |
void | updateArgValue (int ArgIndex, const void *NewValue, size_t Size) |
template<int Dimensions> | |
void | updateNDRange (nd_range< Dimensions > ExecutionRange) |
template<int Dimensions> | |
void | updateRange (range< Dimensions > ExecutionRange) |
void | updateFromOtherNode (const std::shared_ptr< node_impl > &Other) |
id_type | getID () const |
Public Attributes | |
id_type | MID = getNextNodeID() |
Unique identifier for this node. More... | |
std::vector< std::weak_ptr< node_impl > > | MSuccessors |
List of successors to this node. More... | |
std::vector< std::weak_ptr< node_impl > > | MPredecessors |
List of predecessors to this node. More... | |
sycl::detail::CG::CGTYPE | MCGType = sycl::detail::CG::None |
Type of the command-group for the node. More... | |
node_type | MNodeType = node_type::empty |
User facing type of the node. More... | |
std::unique_ptr< sycl::detail::CG > | MCommandGroup |
Command group object which stores all args etc needed to enqueue the node. More... | |
std::shared_ptr< exec_graph_impl > | MSubGraphImpl |
Stores the executable graph impl associated with this node if it is a subgraph node. More... | |
bool | MVisited = false |
Used for tracking visited status during cycle checks. More... | |
int | MPartitionNum = -1 |
Partition number needed to assign a Node to a a partition. More... | |
bool | MNDRangeUsed = false |
Track whether an ND-Range was used for kernel nodes. More... | |
Implementation of node class from SYCL_EXT_ONEAPI_GRAPH.
Definition at line 77 of file graph_impl.hpp.
using sycl::_V1::ext::oneapi::experimental::detail::node_impl::id_type = uint64_t |
Definition at line 79 of file graph_impl.hpp.
|
inline |
Construct an empty node.
Definition at line 141 of file graph_impl.hpp.
|
inline |
Construct a node representing a command-group.
NodeType | Type of the command-group. |
CommandGroup | The CG which stores the command information for this node. |
Definition at line 147 of file graph_impl.hpp.
References MCommandGroup, MSubGraphImpl, and sycl::_V1::ext::oneapi::experimental::subgraph.
|
inline |
Construct a node from another node.
This will perform a deep-copy of the command group object associated with this node.
Definition at line 160 of file graph_impl.hpp.
|
inline |
Get a deep copy of this node's command group.
Definition at line 224 of file graph_impl.hpp.
References sycl::_V1::detail::CG::StorageInitHelper::MArgsStorage, MCGType, and MCommandGroup.
Referenced by operator=().
|
inline |
Definition at line 525 of file graph_impl.hpp.
References MID.
|
inline |
Checks if this node should be a dependency of another node based on accessor requirements.
This is calculated using access modes if a requirement to the same buffer is found inside this node.
IncomingReq | Incoming requirement. |
Definition at line 183 of file graph_impl.hpp.
References sycl::_V1::access::atomic, MCommandGroup, sycl::_V1::access::read, and sycl::_V1::access::write.
|
inline |
Query if this is an empty node.
Barrier nodes are also considered empty nodes since they do not embed any workload but only dependencies
Definition at line 217 of file graph_impl.hpp.
References MCGType.
|
inline |
Tests if the caller is similar to Node, this is only used for testing.
Node | The node to check for similarity. |
CompareContentOnly | Skip comparisons related to graph structure, compare only the type and command groups of the nodes |
Definition at line 314 of file graph_impl.hpp.
References MCGType, MCommandGroup, MPredecessors, and MSuccessors.
|
inline |
Copy-assignment operator.
This will perform a deep-copy of the command group object associated with this node.
Definition at line 167 of file graph_impl.hpp.
References getCGCopy(), MCGType, MCommandGroup, MNodeType, MPredecessors, MSubGraphImpl, and MSuccessors.
|
inline |
Recursive Depth first traversal of linked nodes.
to print node information and connection to Stream.
Stream | Where to print node information. |
Visited | Vector of the already visited nodes. |
Verbose | If true, print additional information about the nodes such as kernel args or memory access where applicable. |
Definition at line 365 of file graph_impl.hpp.
References MPartitionNum, MPredecessors, and MSuccessors.
|
inline |
Add predecessor to the node.
Node | Node to add as a predecessor. |
Definition at line 130 of file graph_impl.hpp.
References MPredecessors.
|
inline |
Add successor to the node.
Node | Node to add as a successor. |
Prev | Predecessor to node being added as successor. |
Prev
should be a shared_ptr to an instance of this object, but can't use a raw this
pointer, so the extra \Prev parameter is passed.
Definition at line 116 of file graph_impl.hpp.
References MSuccessors.
|
inline |
Update the value of an accessor inside this node.
Accessors must be handled specifically compared to other argument values.
ArgIndex | The index of the accessor arg to be updated |
Acc | Pointer to the new accessor value |
Definition at line 390 of file graph_impl.hpp.
References sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, sycl::_V1::make_error_code(), and MCommandGroup.
|
inline |
Definition at line 439 of file graph_impl.hpp.
References MCommandGroup.
|
inline |
Definition at line 508 of file graph_impl.hpp.
References MCommandGroup.
|
inline |
Definition at line 456 of file graph_impl.hpp.
References sycl::_V1::Dimensions, MCGType, MCommandGroup, and MNDRangeUsed.
|
inline |
Definition at line 482 of file graph_impl.hpp.
References sycl::_V1::Dimensions, MCGType, MCommandGroup, and MNDRangeUsed.
sycl::detail::CG::CGTYPE sycl::_V1::ext::oneapi::experimental::detail::node_impl::MCGType = sycl::detail::CG::None |
Type of the command-group for the node.
Definition at line 90 of file graph_impl.hpp.
Referenced by getCGCopy(), isEmpty(), isSimilar(), operator=(), updateNDRange(), and updateRange().
std::unique_ptr<sycl::detail::CG> sycl::_V1::ext::oneapi::experimental::detail::node_impl::MCommandGroup |
Command group object which stores all args etc needed to enqueue the node.
Definition at line 94 of file graph_impl.hpp.
Referenced by getCGCopy(), hasRequirementDependency(), isSimilar(), node_impl(), operator=(), updateAccessor(), updateArgValue(), updateFromOtherNode(), updateNDRange(), and updateRange().
id_type sycl::_V1::ext::oneapi::experimental::detail::node_impl::MID = getNextNodeID() |
Unique identifier for this node.
Definition at line 82 of file graph_impl.hpp.
Referenced by getID().
bool sycl::_V1::ext::oneapi::experimental::detail::node_impl::MNDRangeUsed = false |
Track whether an ND-Range was used for kernel nodes.
Definition at line 108 of file graph_impl.hpp.
Referenced by updateNDRange(), and updateRange().
node_type sycl::_V1::ext::oneapi::experimental::detail::node_impl::MNodeType = node_type::empty |
User facing type of the node.
Definition at line 92 of file graph_impl.hpp.
Referenced by operator=().
int sycl::_V1::ext::oneapi::experimental::detail::node_impl::MPartitionNum = -1 |
Partition number needed to assign a Node to a a partition.
Note : This number is only used during the partitionning process and cannot be used to find out the partion of a node outside of this process.
Definition at line 105 of file graph_impl.hpp.
Referenced by printDotRecursive().
std::vector<std::weak_ptr<node_impl> > sycl::_V1::ext::oneapi::experimental::detail::node_impl::MPredecessors |
List of predecessors to this node.
Using weak_ptr here to prevent circular references between nodes.
Definition at line 88 of file graph_impl.hpp.
Referenced by isSimilar(), operator=(), printDotRecursive(), and registerPredecessor().
std::shared_ptr<exec_graph_impl> sycl::_V1::ext::oneapi::experimental::detail::node_impl::MSubGraphImpl |
Stores the executable graph impl associated with this node if it is a subgraph node.
Definition at line 97 of file graph_impl.hpp.
Referenced by node_impl(), and operator=().
std::vector<std::weak_ptr<node_impl> > sycl::_V1::ext::oneapi::experimental::detail::node_impl::MSuccessors |
List of successors to this node.
Definition at line 84 of file graph_impl.hpp.
Referenced by isSimilar(), operator=(), printDotRecursive(), and registerSuccessor().
bool sycl::_V1::ext::oneapi::experimental::detail::node_impl::MVisited = false |
Used for tracking visited status during cycle checks.
Definition at line 100 of file graph_impl.hpp.