/usr/include/oneapi/tbb/detail
NameSizeModeActions
_aggregator.h75620644editdlrm
_aligned_space.h13990644editdlrm
_allocator_traits.h38070644editdlrm
_assert.h23920644editdlrm
_concurrent_queue_base.h263600644editdlrm
_concurrent_skip_list.h466280644editdlrm
_concurrent_unordered_base.h646560644editdlrm
_config.h203820644editdlrm
_containers_helpers.h26270644editdlrm
_exception.h27150644editdlrm
_export.h11990644editdlrm
_flow_graph_body_impl.h127760644editdlrm
_flow_graph_cache_impl.h136150644editdlrm
_flow_graph_impl.h153600644editdlrm
_flow_graph_indexer_impl.h165290644editdlrm
_flow_graph_item_buffer_impl.h103590644editdlrm
_flow_graph_join_impl.h828860644editdlrm
_flow_graph_nodes_deduction.h95320644editdlrm
_flow_graph_node_impl.h275450644editdlrm
_flow_graph_node_set_impl.h101770644editdlrm
_flow_graph_tagged_buffer_impl.h103180644editdlrm
_flow_graph_trace_impl.h159740644editdlrm
_flow_graph_types_impl.h156230644editdlrm
_hash_compare.h44880644editdlrm
_intrusive_list_node.h14620644editdlrm
_machine.h130420644editdlrm
_mutex_common.h23470644editdlrm
_namespace_injection.h8150644editdlrm
_node_handle.h51730644editdlrm
_pipeline_filters.h159050644editdlrm
_pipeline_filters_deduction.h15290644editdlrm
_range_common.h46430644editdlrm
_rtm_mutex.h47850644editdlrm
_rtm_rw_mutex.h72100644editdlrm
_scoped_lock.h50090644editdlrm
_segment_table.h247500644editdlrm
_small_object_pool.h35740644editdlrm
_string_resource.h38720644editdlrm
_task.h71160644editdlrm
_task_handle.h36880644editdlrm
_template_helpers.h135170644editdlrm
_utils.h133180644editdlrm
_waitable_atomic.h35320644editdlrm
Edit: /usr/include/oneapi/tbb/detail/_flow_graph_node_set_impl.h (10177B)
/* Copyright (c) 2020-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef __TBB_flow_graph_node_set_impl_H #define __TBB_flow_graph_node_set_impl_H #ifndef __TBB_flow_graph_H #error Do not #include this internal file directly; use public TBB headers instead. #endif // Included in namespace tbb::detail::d1 (in flow_graph.h) #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET // Visual Studio 2019 reports an error while calling predecessor_selector::get and successor_selector::get // Seems like the well-formed expression in trailing decltype is treated as ill-formed // TODO: investigate problems with decltype in trailing return types or find the cross-platform solution #define __TBB_MSVC_DISABLE_TRAILING_DECLTYPE (_MSC_VER >= 1900) namespace order { struct undefined {}; struct following {}; struct preceding {}; } class get_graph_helper { public: // TODO: consider making graph_reference() public and consistent interface to get a reference to the graph // and remove get_graph_helper template static graph& get(const T& object) { return get_impl(object, std::is_base_of()); } private: // Get graph from the object of type derived from graph_node template static graph& get_impl(const T& object, std::true_type) { return static_cast(&object)->my_graph; } template static graph& get_impl(const T& object, std::false_type) { return object.graph_reference(); } }; template struct node_set { typedef Order order_type; std::tuple nodes; node_set(Nodes&... ns) : nodes(ns...) {} template node_set(const node_set& set) : nodes(set.nodes) {} graph& graph_reference() const { return get_graph_helper::get(std::get<0>(nodes)); } }; namespace alias_helpers { template using output_type = typename T::output_type; template using output_ports_type = typename T::output_ports_type; template using input_type = typename T::input_type; template using input_ports_type = typename T::input_ports_type; } // namespace alias_helpers template using has_output_type = supports; template using has_input_type = supports; template using has_input_ports_type = supports; template using has_output_ports_type = supports; template struct is_sender : std::is_base_of, T> {}; template struct is_receiver : std::is_base_of, T> {}; template struct is_async_node : std::false_type {}; template struct is_async_node> : std::true_type {}; template node_set follows(FirstPredecessor& first_predecessor, Predecessors&... predecessors) { static_assert((conjunction, has_output_type...>::value), "Not all node's predecessors has output_type typedef"); static_assert((conjunction, is_sender...>::value), "Not all node's predecessors are senders"); return node_set(first_predecessor, predecessors...); } template node_set follows(node_set& predecessors_set) { static_assert((conjunction...>::value), "Not all nodes in the set has output_type typedef"); static_assert((conjunction...>::value), "Not all nodes in the set are senders"); return node_set(predecessors_set); } template node_set precedes(FirstSuccessor& first_successor, Successors&... successors) { static_assert((conjunction, has_input_type...>::value), "Not all node's successors has input_type typedef"); static_assert((conjunction, is_receiver...>::value), "Not all node's successors are receivers"); return node_set(first_successor, successors...); } template node_set precedes(node_set& successors_set) { static_assert((conjunction...>::value), "Not all nodes in the set has input_type typedef"); static_assert((conjunction...>::value), "Not all nodes in the set are receivers"); return node_set(successors_set); } template node_set make_node_set(Node& first_node, Nodes&... nodes) { return node_set(first_node, nodes...); } template class successor_selector { template static auto get_impl(NodeType& node, std::true_type) -> decltype(input_port(node)) { return input_port(node); } template static NodeType& get_impl(NodeType& node, std::false_type) { return node; } public: template #if __TBB_MSVC_DISABLE_TRAILING_DECLTYPE static auto& get(NodeType& node) #else static auto get(NodeType& node) -> decltype(get_impl(node, has_input_ports_type())) #endif { return get_impl(node, has_input_ports_type()); } }; template class predecessor_selector { template static auto internal_get(NodeType& node, std::true_type) -> decltype(output_port(node)) { return output_port(node); } template static NodeType& internal_get(NodeType& node, std::false_type) { return node;} template #if __TBB_MSVC_DISABLE_TRAILING_DECLTYPE static auto& get_impl(NodeType& node, std::false_type) #else static auto get_impl(NodeType& node, std::false_type) -> decltype(internal_get(node, has_output_ports_type())) #endif { return internal_get(node, has_output_ports_type()); } template static AsyncNode& get_impl(AsyncNode& node, std::true_type) { return node; } public: template #if __TBB_MSVC_DISABLE_TRAILING_DECLTYPE static auto& get(NodeType& node) #else static auto get(NodeType& node) -> decltype(get_impl(node, is_async_node())) #endif { return get_impl(node, is_async_node()); } }; template class make_edges_helper { public: template static void connect_predecessors(PredecessorsTuple& predecessors, NodeType& node) { make_edge(std::get(predecessors), successor_selector::get(node)); make_edges_helper::connect_predecessors(predecessors, node); } template static void connect_successors(NodeType& node, SuccessorsTuple& successors) { make_edge(predecessor_selector::get(node), std::get(successors)); make_edges_helper::connect_successors(node, successors); } }; template<> struct make_edges_helper<0> { template static void connect_predecessors(PredecessorsTuple& predecessors, NodeType& node) { make_edge(std::get<0>(predecessors), successor_selector<0>::get(node)); } template static void connect_successors(NodeType& node, SuccessorsTuple& successors) { make_edge(predecessor_selector<0>::get(node), std::get<0>(successors)); } }; // TODO: consider adding an overload for making edges between node sets template void make_edges(const node_set& s, NodeType& node) { const std::size_t SetSize = std::tuple_size::value; make_edges_helper::connect_predecessors(s.nodes, node); } template void make_edges(NodeType& node, const node_set& s) { const std::size_t SetSize = std::tuple_size::value; make_edges_helper::connect_successors(node, s.nodes); } template void make_edges_in_order(const node_set& ns, NodeType& node) { make_edges(ns, node); } template void make_edges_in_order(const node_set& ns, NodeType& node) { make_edges(node, ns); } #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET #endif // __TBB_flow_graph_node_set_impl_H