![]() |
C++ Library Extensions 2022.12.09
To help learn modern C++ programming
|
Implements set operations. More...
Classes | |
struct | cache_wrapper |
class | counting_iterator |
struct | st_cache_aligned_array |
struct | st_cache_wrapper |
struct | st_cache_wrapper< T, true > |
Typedefs | |
template<typename T > | |
using | cache_wrapper_t = typename st_cache_wrapper< T, std::is_class_v< T > >::type |
template<typename Type , template< typename, typename... > class Container> | |
using | cache_aligned_container_t = Container< cache_wrapper_t< Type >, tbb::cache_aligned_allocator< cache_wrapper_t< Type > > > |
template<typename Type > | |
using | cache_aligned_vector_t = cache_aligned_container_t< Type, std::vector > |
template<typename Type , size_t Size> | |
using | cache_aligned_array_t = st_cache_aligned_array< Type, Size > |
Functions | |
constexpr size_t | default_alignment () |
template<typename ElementType , typename Operation > | |
void | atomic_operation (std::atomic< ElementType > &atom, Operation &&opr) |
constexpr unsigned long long | least_power_of_2_ge_n (unsigned long long n) |
constexpr unsigned long long | fast_integer_power (unsigned long long x, unsigned long long n) |
template<typename Type > | |
bool | is_cache_aligned (Type *ptr) |
template<typename Type1 , typename Type2 > | |
bool | is_cache_aligned (Type1 *ptr1, Type2 *ptr2) |
template<typename Type1 , typename Type2 > | |
bool | is_cache_aligned (Type1 &value1, Type2 &value2) |
template<typename Type > | |
bool | is_cache_aligned (Type &value) |
bool | go_parallel (size_t element_count, size_t greater_than) |
template<typename IteratorType > | |
bool | go_parallel (IteratorType begin, IteratorType end, size_t greater_than) |
template<typename ContainerType > | |
bool | go_parallel (ContainerType &&container, size_t greater_than) |
template<typename IndexType , typename CallbackType > | |
void | for_index (IndexType begin_index, IndexType end_index, CallbackType &&callback, size_t greater_than=ConcurrencyLimit) |
template<typename ContainerType , typename CallbackType > | |
void | for_index (ContainerType &&container, CallbackType &&callback, size_t greater_than=ConcurrencyLimit) |
template<typename IndexType , typename InitType , typename SumupType , typename HandleParallelType > | |
auto | reduce_index (IndexType begin_index, IndexType end_index, InitType &&init_value, SumupType &&sum_up, HandleParallelType &&handle_parallel, size_t greater_than=ConcurrencyLimit) |
template<typename ContainerType , typename InitType , typename SumupType , typename HandleParallelType > | |
auto | reduce_index (ContainerType &&container, InitType &&init_value, SumupType &&sum_up, HandleParallelType &&handle_parallel, size_t greater_than=ConcurrencyLimit) |
Variables | |
constexpr auto | cache_line_size = 64 |
constexpr size_t | ConcurrencyLimit = 10 |
constexpr size_t | ForceSequential = ConcurrencyLimit - 1 |
constexpr size_t | ForceParallel = ConcurrencyLimit + 1 |
Implements set operations.
using tpf::parallel::cache_aligned_array_t = typedef st_cache_aligned_array<Type, Size> |
Definition at line 332 of file tpf_parallel.hpp.
using tpf::parallel::cache_aligned_container_t = typedef Container< cache_wrapper_t<Type>, tbb::cache_aligned_allocator<cache_wrapper_t<Type> >> |
Definition at line 321 of file tpf_parallel.hpp.
using tpf::parallel::cache_aligned_vector_t = typedef cache_aligned_container_t<Type, std::vector> |
Definition at line 325 of file tpf_parallel.hpp.
using tpf::parallel::cache_wrapper_t = typedef typename st_cache_wrapper<T, std::is_class_v<T> >::type |
Definition at line 318 of file tpf_parallel.hpp.
|
inline |
Definition at line 125 of file tpf_parallel.hpp.
|
inlineconstexpr |
Definition at line 121 of file tpf_parallel.hpp.
|
inlineconstexpr |
Definition at line 217 of file tpf_parallel.hpp.
void tpf::parallel::for_index | ( | ContainerType && | container, |
CallbackType && | callback, | ||
size_t | greater_than = ConcurrencyLimit |
||
) |
void tpf::parallel::for_index | ( | IndexType | begin_index, |
IndexType | end_index, | ||
CallbackType && | callback, | ||
size_t | greater_than = ConcurrencyLimit |
||
) |
Definition at line 399 of file tpf_parallel.hpp.
|
inline |
|
inline |
|
inline |
bool tpf::parallel::is_cache_aligned | ( | Type & | value | ) |
bool tpf::parallel::is_cache_aligned | ( | Type * | ptr | ) |
bool tpf::parallel::is_cache_aligned | ( | Type1 & | value1, |
Type2 & | value2 | ||
) |
bool tpf::parallel::is_cache_aligned | ( | Type1 * | ptr1, |
Type2 * | ptr2 | ||
) |
Definition at line 349 of file tpf_parallel.hpp.
|
inlineconstexpr |
Definition at line 203 of file tpf_parallel.hpp.
auto tpf::parallel::reduce_index | ( | ContainerType && | container, |
InitType && | init_value, | ||
SumupType && | sum_up, | ||
HandleParallelType && | handle_parallel, | ||
size_t | greater_than = ConcurrencyLimit |
||
) |
auto tpf::parallel::reduce_index | ( | IndexType | begin_index, |
IndexType | end_index, | ||
InitType && | init_value, | ||
SumupType && | sum_up, | ||
HandleParallelType && | handle_parallel, | ||
size_t | greater_than = ConcurrencyLimit |
||
) |
Definition at line 425 of file tpf_parallel.hpp.
|
inlineconstexpr |
Definition at line 118 of file tpf_parallel.hpp.
|
constexpr |
Definition at line 366 of file tpf_parallel.hpp.
|
constexpr |
Definition at line 370 of file tpf_parallel.hpp.
|
constexpr |
Definition at line 369 of file tpf_parallel.hpp.