@@ -86,11 +86,11 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
86
86
// / Unique identifier for this node.
87
87
id_type MID = getNextNodeID();
88
88
// / List of successors to this node.
89
- std::vector<std::weak_ptr< node_impl> > MSuccessors;
89
+ std::vector<node_impl * > MSuccessors;
90
90
// / List of predecessors to this node.
91
91
// /
92
92
// / Using weak_ptr here to prevent circular references between nodes.
93
- std::vector<std::weak_ptr< node_impl> > MPredecessors;
93
+ std::vector<node_impl * > MPredecessors;
94
94
// / Type of the command-group for the node.
95
95
sycl::detail::CGType MCGType = sycl::detail::CGType::None;
96
96
// / User facing type of the node.
@@ -116,26 +116,22 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
116
116
// / Add successor to the node.
117
117
// / @param Node Node to add as a successor.
118
118
void registerSuccessor (node_impl &Node) {
119
- if (std::find_if (MSuccessors.begin (), MSuccessors.end (),
120
- [&Node](const std::weak_ptr<node_impl> &Ptr) {
121
- return Ptr.lock ().get () == &Node;
122
- }) != MSuccessors.end ()) {
119
+ if (std::find (MSuccessors.begin (), MSuccessors.end (), &Node) !=
120
+ MSuccessors.end ()) {
123
121
return ;
124
122
}
125
- MSuccessors.push_back (Node. weak_from_this () );
123
+ MSuccessors.push_back (& Node);
126
124
Node.registerPredecessor (*this );
127
125
}
128
126
129
127
// / Add predecessor to the node.
130
128
// / @param Node Node to add as a predecessor.
131
129
void registerPredecessor (node_impl &Node) {
132
- if (std::find_if (MPredecessors.begin (), MPredecessors.end (),
133
- [&Node](const std::weak_ptr<node_impl> &Ptr) {
134
- return Ptr.lock ().get () == &Node;
135
- }) != MPredecessors.end ()) {
130
+ if (std::find (MPredecessors.begin (), MPredecessors.end (), &Node) !=
131
+ MPredecessors.end ()) {
136
132
return ;
137
133
}
138
- MPredecessors.push_back (Node. weak_from_this () );
134
+ MPredecessors.push_back (& Node);
139
135
}
140
136
141
137
// / Construct an empty node.
@@ -386,15 +382,13 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
386
382
Visited.push_back (this );
387
383
388
384
printDotCG (Stream, Verbose);
389
- for (const auto &Dep : MPredecessors) {
390
- auto NodeDep = Dep.lock ();
391
- Stream << " \" " << NodeDep.get () << " \" -> \" " << this << " \" "
392
- << std::endl;
385
+ for (node_impl *Pred : MPredecessors) {
386
+ Stream << " \" " << Pred << " \" -> \" " << this << " \" " << std::endl;
393
387
}
394
388
395
- for (std::weak_ptr< node_impl> Succ : MSuccessors) {
396
- if (MPartitionNum == Succ. lock () ->MPartitionNum )
397
- Succ. lock () ->printDotRecursive (Stream, Visited, Verbose);
389
+ for (node_impl * Succ : MSuccessors) {
390
+ if (MPartitionNum == Succ->MPartitionNum )
391
+ Succ->printDotRecursive (Stream, Visited, Verbose);
398
392
}
399
393
}
400
394
0 commit comments