/usr/include/oneapi/tbb
NameSizeModeActions
detail/-0755rm
blocked_range.h64530644editdlrm
blocked_range2d.h33690644editdlrm
blocked_range3d.h44550644editdlrm
blocked_rangeNd.h55080644editdlrm
cache_aligned_allocator.h69050644editdlrm
collaborative_call_once.h90530644editdlrm
combinable.h19690644editdlrm
concurrent_hash_map.h718930644editdlrm
concurrent_lru_cache.h137370644editdlrm
concurrent_map.h134160644editdlrm
concurrent_priority_queue.h195310644editdlrm
concurrent_queue.h240300644editdlrm
concurrent_set.h102410644editdlrm
concurrent_unordered_map.h186970644editdlrm
concurrent_unordered_set.h148500644editdlrm
concurrent_vector.h461990644editdlrm
enumerable_thread_specific.h424030644editdlrm
flow_graph.h1283390644editdlrm
flow_graph_abstractions.h14460644editdlrm
global_control.h61390644editdlrm
info.h41790644editdlrm
memory_pool.h99730644editdlrm
mutex.h26280644editdlrm
null_mutex.h21490644editdlrm
null_rw_mutex.h25140644editdlrm
parallel_for.h234510644editdlrm
parallel_for_each.h270640644editdlrm
parallel_invoke.h77830644editdlrm
parallel_pipeline.h57550644editdlrm
parallel_reduce.h370780644editdlrm
parallel_scan.h228100644editdlrm
parallel_sort.h111140644editdlrm
partitioner.h285000644editdlrm
profiling.h100050644editdlrm
queuing_mutex.h63910644editdlrm
queuing_rw_mutex.h66310644editdlrm
rw_mutex.h81500644editdlrm
scalable_allocator.h116550644editdlrm
spin_mutex.h35130644editdlrm
spin_rw_mutex.h78390644editdlrm
task.h10900644editdlrm
task_arena.h178530644editdlrm
task_group.h273290644editdlrm
task_scheduler_observer.h45850644editdlrm
tbbmalloc_proxy.h19070644editdlrm
tbb_allocator.h37820644editdlrm
tick_count.h32010644editdlrm
version.h40070644editdlrm
Edit: /usr/include/oneapi/tbb/blocked_rangeNd.h (5508B)
/* Copyright (c) 2017-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_blocked_rangeNd_H #define __TBB_blocked_rangeNd_H #if !TBB_PREVIEW_BLOCKED_RANGE_ND #error Set TBB_PREVIEW_BLOCKED_RANGE_ND to include blocked_rangeNd.h #endif #include // std::any_of #include #include #include // std::is_same, std::enable_if #include "detail/_config.h" #include "detail/_template_helpers.h" // index_sequence, make_index_sequence #include "detail/_range_common.h" #include "blocked_range.h" namespace tbb { namespace detail { namespace d1 { /* The blocked_rangeNd_impl uses make_index_sequence to automatically generate a ctor with exactly N arguments of the type tbb::blocked_range. Such ctor provides an opportunity to use braced-init-list parameters to initialize each dimension. Use of parameters, whose representation is a braced-init-list, but they're not std::initializer_list or a reference to one, produces a non-deduced context within template argument deduction. NOTE: blocked_rangeNd must be exactly a templated alias to the blocked_rangeNd_impl (and not e.g. a derived class), otherwise it would need to declare its own ctor facing the same problem that the impl class solves. */ template> __TBB_requires(blocked_range_value) class blocked_rangeNd_impl; template __TBB_requires(blocked_range_value) class blocked_rangeNd_impl> { public: //! Type of a value. using value_type = Value; private: //! Helper type to construct range with N tbb::blocked_range objects. template using dim_type_helper = tbb::blocked_range; public: blocked_rangeNd_impl() = delete; //! Constructs N-dimensional range over N half-open intervals each represented as tbb::blocked_range. blocked_rangeNd_impl(const dim_type_helper&... args) : my_dims{ {args...} } {} //! Dimensionality of a range. static constexpr unsigned int ndims() { return N; } //! Range in certain dimension. const tbb::blocked_range& dim(unsigned int dimension) const { __TBB_ASSERT(dimension < N, "out of bound"); return my_dims[dimension]; } //------------------------------------------------------------------------ // Methods that implement Range concept //------------------------------------------------------------------------ //! True if at least one dimension is empty. bool empty() const { return std::any_of(my_dims.begin(), my_dims.end(), [](const tbb::blocked_range& d) { return d.empty(); }); } //! True if at least one dimension is divisible. bool is_divisible() const { return std::any_of(my_dims.begin(), my_dims.end(), [](const tbb::blocked_range& d) { return d.is_divisible(); }); } blocked_rangeNd_impl(blocked_rangeNd_impl& r, proportional_split proportion) : my_dims(r.my_dims) { do_split(r, proportion); } blocked_rangeNd_impl(blocked_rangeNd_impl& r, split proportion) : my_dims(r.my_dims) { do_split(r, proportion); } private: static_assert(N != 0, "zero dimensional blocked_rangeNd can't be constructed"); //! Ranges in each dimension. std::array, N> my_dims; template void do_split(blocked_rangeNd_impl& r, split_type proportion) { static_assert((std::is_same::value || std::is_same::value), "type of split object is incorrect"); __TBB_ASSERT(r.is_divisible(), "can't split not divisible range"); auto my_it = std::max_element(my_dims.begin(), my_dims.end(), [](const tbb::blocked_range& first, const tbb::blocked_range& second) { return (first.size() * second.grainsize() < second.size() * first.grainsize()); }); auto r_it = r.my_dims.begin() + (my_it - my_dims.begin()); my_it->my_begin = tbb::blocked_range::do_split(*r_it, proportion); // (!(my_it->my_begin < r_it->my_end) && !(r_it->my_end < my_it->my_begin)) equals to // (my_it->my_begin == r_it->my_end), but we can't use operator== due to Value concept __TBB_ASSERT(!(my_it->my_begin < r_it->my_end) && !(r_it->my_end < my_it->my_begin), "blocked_range has been split incorrectly"); } }; template using blocked_rangeNd = blocked_rangeNd_impl; } // namespace d1 } // namespace detail inline namespace v1 { using detail::d1::blocked_rangeNd; } // namespace v1 } // namespace tbb #endif /* __TBB_blocked_rangeNd_H */