@@ -308,7 +308,6 @@ graph_impl::~graph_impl() {
308308}
309309
310310std::shared_ptr<node_impl> graph_impl::addNodesToExits (
311- const std::shared_ptr<graph_impl> &Impl,
312311 const std::list<std::shared_ptr<node_impl>> &NodeList) {
313312 // Find all input and output nodes from the node list
314313 std::vector<std::shared_ptr<node_impl>> Inputs;
@@ -327,18 +326,18 @@ std::shared_ptr<node_impl> graph_impl::addNodesToExits(
327326 for (auto &NodeImpl : MNodeStorage) {
328327 if (NodeImpl->MSuccessors .size () == 0 ) {
329328 for (auto &Input : Inputs) {
330- NodeImpl->registerSuccessor (Input, NodeImpl );
329+ NodeImpl->registerSuccessor (Input);
331330 }
332331 }
333332 }
334333
335334 // Add all the new nodes to the node storage
336335 for (auto &Node : NodeList) {
337336 MNodeStorage.push_back (Node);
338- addEventForNode (Impl, std::make_shared<sycl::detail::event_impl>(), Node);
337+ addEventForNode (std::make_shared<sycl::detail::event_impl>(), Node);
339338 }
340339
341- return this ->add (Impl, Outputs);
340+ return this ->add (Outputs);
342341}
343342
344343void graph_impl::addRoot (const std::shared_ptr<node_impl> &Root) {
@@ -350,8 +349,7 @@ void graph_impl::removeRoot(const std::shared_ptr<node_impl> &Root) {
350349}
351350
352351std::shared_ptr<node_impl>
353- graph_impl::add (const std::shared_ptr<graph_impl> &Impl,
354- const std::vector<std::shared_ptr<node_impl>> &Dep) {
352+ graph_impl::add (const std::vector<std::shared_ptr<node_impl>> &Dep) {
355353 // Copy deps so we can modify them
356354 auto Deps = Dep;
357355
@@ -361,17 +359,16 @@ graph_impl::add(const std::shared_ptr<graph_impl> &Impl,
361359
362360 addDepsToNode (NodeImpl, Deps);
363361 // Add an event associated with this explicit node for mixed usage
364- addEventForNode (Impl, std::make_shared<sycl::detail::event_impl>(), NodeImpl);
362+ addEventForNode (std::make_shared<sycl::detail::event_impl>(), NodeImpl);
365363 return NodeImpl;
366364}
367365
368366std::shared_ptr<node_impl>
369- graph_impl::add (const std::shared_ptr<graph_impl> &Impl,
370- std::function<void (handler &)> CGF,
367+ graph_impl::add (std::function<void (handler &)> CGF,
371368 const std::vector<sycl::detail::ArgDesc> &Args,
372369 const std::vector<std::shared_ptr<node_impl>> &Dep) {
373370 (void )Args;
374- sycl::handler Handler{Impl };
371+ sycl::handler Handler{shared_from_this () };
375372 CGF (Handler);
376373
377374 if (Handler.getType () == sycl::detail::CGType::Barrier) {
@@ -394,7 +391,7 @@ graph_impl::add(const std::shared_ptr<graph_impl> &Impl,
394391 this ->add (NodeType, std::move (Handler.impl ->MGraphNodeCG ), Dep);
395392 NodeImpl->MNDRangeUsed = Handler.impl ->MNDRangeUsed ;
396393 // Add an event associated with this explicit node for mixed usage
397- addEventForNode (Impl, std::make_shared<sycl::detail::event_impl>(), NodeImpl);
394+ addEventForNode (std::make_shared<sycl::detail::event_impl>(), NodeImpl);
398395
399396 // Retrieve any dynamic parameters which have been registered in the CGF and
400397 // register the actual nodes with them.
@@ -414,8 +411,7 @@ graph_impl::add(const std::shared_ptr<graph_impl> &Impl,
414411}
415412
416413std::shared_ptr<node_impl>
417- graph_impl::add (const std::shared_ptr<graph_impl> &Impl,
418- const std::vector<sycl::detail::EventImplPtr> Events) {
414+ graph_impl::add (const std::vector<sycl::detail::EventImplPtr> Events) {
419415
420416 std::vector<std::shared_ptr<node_impl>> Deps;
421417
@@ -430,7 +426,7 @@ graph_impl::add(const std::shared_ptr<graph_impl> &Impl,
430426 }
431427 }
432428
433- return this ->add (Impl, Deps);
429+ return this ->add (Deps);
434430}
435431
436432std::shared_ptr<node_impl>
@@ -594,7 +590,7 @@ void graph_impl::makeEdge(std::shared_ptr<node_impl> Src,
594590 }
595591
596592 // We need to add the edges first before checking for cycles
597- Src->registerSuccessor (Dest, Src );
593+ Src->registerSuccessor (Dest);
598594
599595 // We can skip cycle checks if either Dest has no successors (cycle not
600596 // possible) or cycle checks have been disabled with the no_cycle_check
@@ -1061,7 +1057,7 @@ void exec_graph_impl::duplicateNodes() {
10611057 // register those as successors with the current copied node
10621058 for (auto &NextNode : OriginalNode->MSuccessors ) {
10631059 auto Successor = NodesMap.at (NextNode.lock ());
1064- NodeCopy->registerSuccessor (Successor, NodeCopy );
1060+ NodeCopy->registerSuccessor (Successor);
10651061 }
10661062 }
10671063
@@ -1103,7 +1099,7 @@ void exec_graph_impl::duplicateNodes() {
11031099
11041100 for (auto &NextNode : SubgraphNode->MSuccessors ) {
11051101 auto Successor = SubgraphNodesMap.at (NextNode.lock ());
1106- NodeCopy->registerSuccessor (Successor, NodeCopy );
1102+ NodeCopy->registerSuccessor (Successor);
11071103 }
11081104 }
11091105
@@ -1137,7 +1133,7 @@ void exec_graph_impl::duplicateNodes() {
11371133 // Add all input nodes from the subgraph as successors for this node
11381134 // instead
11391135 for (auto &Input : Inputs) {
1140- PredNode->registerSuccessor (Input, PredNode );
1136+ PredNode->registerSuccessor (Input);
11411137 }
11421138 }
11431139
@@ -1157,7 +1153,7 @@ void exec_graph_impl::duplicateNodes() {
11571153 // Add all Output nodes from the subgraph as predecessors for this node
11581154 // instead
11591155 for (auto &Output : Outputs) {
1160- Output->registerSuccessor (SuccNode, Output );
1156+ Output->registerSuccessor (SuccNode);
11611157 }
11621158 }
11631159
@@ -1531,7 +1527,7 @@ node modifiable_command_graph::addImpl(const std::vector<node> &Deps) {
15311527 }
15321528
15331529 graph_impl::WriteLock Lock (impl->MMutex );
1534- std::shared_ptr<detail::node_impl> NodeImpl = impl->add (impl, DepImpls);
1530+ std::shared_ptr<detail::node_impl> NodeImpl = impl->add (DepImpls);
15351531 return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
15361532}
15371533
@@ -1544,8 +1540,7 @@ node modifiable_command_graph::addImpl(std::function<void(handler &)> CGF,
15441540 }
15451541
15461542 graph_impl::WriteLock Lock (impl->MMutex );
1547- std::shared_ptr<detail::node_impl> NodeImpl =
1548- impl->add (impl, CGF, {}, DepImpls);
1543+ std::shared_ptr<detail::node_impl> NodeImpl = impl->add (CGF, {}, DepImpls);
15491544 return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
15501545}
15511546
0 commit comments