Skip to content

Commit

Permalink
Replace additional ifs with ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensuo committed Jan 8, 2024
1 parent 9a8b046 commit aecd241
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sycl/source/detail/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ graph_impl::add(const std::shared_ptr<graph_impl> &Impl,
return Handler.MSubgraphNode;
}

node_type NodeType;
if (auto UserFacingType = Handler.MImpl->MUserFacingNodeType;
UserFacingType != node_type::empty) {
NodeType = UserFacingType;
} else {
NodeType = getNodeTypeFromCG(Handler.MCGType);
}
node_type NodeType =
Handler.MImpl->MUserFacingNodeType !=
ext::oneapi::experimental::node_type::empty
? Handler.MImpl->MUserFacingNodeType
: ext::oneapi::experimental::detail::getNodeTypeFromCG(
Handler.MCGType);

auto NodeImpl = this->add(NodeType, std::move(Handler.MGraphNodeCG), Dep);
// Add an event associated with this explicit node for mixed usage
addEventForNode(Impl, std::make_shared<sycl::detail::event_impl>(), NodeImpl);
Expand Down

0 comments on commit aecd241

Please sign in to comment.