/
usr
/
include
/
oneapi
/
tbb
/
/usr/include/oneapi/tbb
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
blocked_range.h
6453
0644
edit
dl
rm
blocked_range2d.h
3369
0644
edit
dl
rm
blocked_range3d.h
4455
0644
edit
dl
rm
blocked_rangeNd.h
5508
0644
edit
dl
rm
cache_aligned_allocator.h
6905
0644
edit
dl
rm
collaborative_call_once.h
9053
0644
edit
dl
rm
combinable.h
1969
0644
edit
dl
rm
concurrent_hash_map.h
71893
0644
edit
dl
rm
concurrent_lru_cache.h
13737
0644
edit
dl
rm
concurrent_map.h
13416
0644
edit
dl
rm
concurrent_priority_queue.h
19531
0644
edit
dl
rm
concurrent_queue.h
24030
0644
edit
dl
rm
concurrent_set.h
10241
0644
edit
dl
rm
concurrent_unordered_map.h
18697
0644
edit
dl
rm
concurrent_unordered_set.h
14850
0644
edit
dl
rm
concurrent_vector.h
46199
0644
edit
dl
rm
enumerable_thread_specific.h
42403
0644
edit
dl
rm
flow_graph.h
128339
0644
edit
dl
rm
flow_graph_abstractions.h
1446
0644
edit
dl
rm
global_control.h
6139
0644
edit
dl
rm
info.h
4179
0644
edit
dl
rm
memory_pool.h
9973
0644
edit
dl
rm
mutex.h
2628
0644
edit
dl
rm
null_mutex.h
2149
0644
edit
dl
rm
null_rw_mutex.h
2514
0644
edit
dl
rm
parallel_for.h
23451
0644
edit
dl
rm
parallel_for_each.h
27064
0644
edit
dl
rm
parallel_invoke.h
7783
0644
edit
dl
rm
parallel_pipeline.h
5755
0644
edit
dl
rm
parallel_reduce.h
37078
0644
edit
dl
rm
parallel_scan.h
22810
0644
edit
dl
rm
parallel_sort.h
11114
0644
edit
dl
rm
partitioner.h
28500
0644
edit
dl
rm
profiling.h
10005
0644
edit
dl
rm
queuing_mutex.h
6391
0644
edit
dl
rm
queuing_rw_mutex.h
6631
0644
edit
dl
rm
rw_mutex.h
8150
0644
edit
dl
rm
scalable_allocator.h
11655
0644
edit
dl
rm
spin_mutex.h
3513
0644
edit
dl
rm
spin_rw_mutex.h
7839
0644
edit
dl
rm
task.h
1090
0644
edit
dl
rm
task_arena.h
17853
0644
edit
dl
rm
task_group.h
27329
0644
edit
dl
rm
task_scheduler_observer.h
4585
0644
edit
dl
rm
tbbmalloc_proxy.h
1907
0644
edit
dl
rm
tbb_allocator.h
3782
0644
edit
dl
rm
tick_count.h
3201
0644
edit
dl
rm
version.h
4007
0644
edit
dl
rm
Edit:
/usr/include/oneapi/tbb/parallel_pipeline.h
(5755B)
/* Copyright (c) 2005-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_parallel_pipeline_H #define __TBB_parallel_pipeline_H #include "detail/_pipeline_filters.h" #include "detail/_config.h" #include "detail/_namespace_injection.h" #include "task_group.h" #include <cstddef> #include <atomic> #include <type_traits> namespace tbb { namespace detail { namespace r1 { TBB_EXPORT void __TBB_EXPORTED_FUNC parallel_pipeline(task_group_context&, std::size_t, const d1::filter_node&); } namespace d1 { enum class filter_mode : unsigned int { //! processes multiple items in parallel and in no particular order parallel = base_filter::filter_is_out_of_order, //! processes items one at a time; all such filters process items in the same order serial_in_order = base_filter::filter_is_serial, //! processes items one at a time and in no particular order serial_out_of_order = base_filter::filter_is_serial | base_filter::filter_is_out_of_order }; //! Class representing a chain of type-safe pipeline filters /** @ingroup algorithms */ template<typename InputType, typename OutputType> class filter { filter_node_ptr my_root; filter( filter_node_ptr root ) : my_root(root) {} friend void parallel_pipeline( size_t, const filter<void,void>&, task_group_context& ); template<typename T_, typename U_, typename Body> friend filter<T_,U_> make_filter( filter_mode, const Body& ); template<typename T_, typename V_, typename U_> friend filter<T_,U_> operator&( const filter<T_,V_>&, const filter<V_,U_>& ); public: filter() = default; filter( const filter& rhs ) : my_root(rhs.my_root) {} filter( filter&& rhs ) : my_root(std::move(rhs.my_root)) {} void operator=(const filter& rhs) { my_root = rhs.my_root; } void operator=( filter&& rhs ) { my_root = std::move(rhs.my_root); } template<typename Body> filter( filter_mode mode, const Body& body ) : my_root( new(r1::allocate_memory(sizeof(filter_node_leaf<InputType, OutputType, Body>))) filter_node_leaf<InputType, OutputType, Body>(static_cast<unsigned int>(mode), body) ) { } filter& operator&=( const filter<OutputType,OutputType>& right ) { *this = *this & right; return *this; } void clear() { // Like operator= with filter() on right side. my_root = nullptr; } }; //! Create a filter to participate in parallel_pipeline /** @ingroup algorithms */ template<typename InputType, typename OutputType, typename Body> filter<InputType, OutputType> make_filter( filter_mode mode, const Body& body ) { return filter_node_ptr( new(r1::allocate_memory(sizeof(filter_node_leaf<InputType, OutputType, Body>))) filter_node_leaf<InputType, OutputType, Body>(static_cast<unsigned int>(mode), body) ); } //! Create a filter to participate in parallel_pipeline /** @ingroup algorithms */ template<typename Body> filter<filter_input<Body>, filter_output<Body>> make_filter( filter_mode mode, const Body& body ) { return make_filter<filter_input<Body>, filter_output<Body>>(mode, body); } //! Composition of filters left and right. /** @ingroup algorithms */ template<typename T, typename V, typename U> filter<T,U> operator&( const filter<T,V>& left, const filter<V,U>& right ) { __TBB_ASSERT(left.my_root,"cannot use default-constructed filter as left argument of '&'"); __TBB_ASSERT(right.my_root,"cannot use default-constructed filter as right argument of '&'"); return filter_node_ptr( new (r1::allocate_memory(sizeof(filter_node))) filter_node(left.my_root,right.my_root) ); } #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT template<typename Body> filter(filter_mode, Body) ->filter<filter_input<Body>, filter_output<Body>>; #endif // __TBB_CPP17_DEDUCTION_GUIDES_PRESENT //! Parallel pipeline over chain of filters with user-supplied context. /** @ingroup algorithms **/ inline void parallel_pipeline(size_t max_number_of_live_tokens, const filter<void,void>& filter_chain, task_group_context& context) { r1::parallel_pipeline(context, max_number_of_live_tokens, *filter_chain.my_root); } //! Parallel pipeline over chain of filters. /** @ingroup algorithms **/ inline void parallel_pipeline(size_t max_number_of_live_tokens, const filter<void,void>& filter_chain) { task_group_context context; parallel_pipeline(max_number_of_live_tokens, filter_chain, context); } //! Parallel pipeline over sequence of filters. /** @ingroup algorithms **/ template<typename F1, typename F2, typename... FiltersContext> void parallel_pipeline(size_t max_number_of_live_tokens, const F1& filter1, const F2& filter2, FiltersContext&&... filters) { parallel_pipeline(max_number_of_live_tokens, filter1 & filter2, std::forward<FiltersContext>(filters)...); } } // namespace d1 } // namespace detail inline namespace v1 { using detail::d1::parallel_pipeline; using detail::d1::filter; using detail::d1::make_filter; using detail::d1::filter_mode; using detail::d1::flow_control; } } // tbb #endif /* __TBB_parallel_pipeline_H */
Save
cmd:
run