Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::parallel_detail Namespace Reference

Functions

size_t chunk_size (const size_t n, const size_t num_threads, const size_t min_chunk=64)
 Calculate optimal chunk size based on data size and thread count.
 
template<typename Container >
constexpr bool has_random_access ()
 Check if container supports random access.
 
template<typename Container >
auto ensure_random_access (const Container &c)
 For containers with random access, just return a pointer to it For non-random access, copy to vector.
 
template<typename T >
decltype(autoderef (T &&ptr)
 Get reference from pointer or unique_ptr.
 

Function Documentation

◆ chunk_size()

size_t Aleph::parallel_detail::chunk_size ( const size_t  n,
const size_t  num_threads,
const size_t  min_chunk = 64 
)
inline

Calculate optimal chunk size based on data size and thread count.

Definition at line 130 of file ah-parallel.H.

References Aleph::maps(), and Aleph::size().

Referenced by Aleph::pall(), Aleph::pfilter(), Aleph::pfoldl(), Aleph::pfor_each(), Aleph::pfor_each(), and Aleph::pmaps().

◆ deref()

template<typename T >
decltype(auto) Aleph::parallel_detail::deref ( T &&  ptr)

Get reference from pointer or unique_ptr.

Definition at line 161 of file ah-parallel.H.

Referenced by Aleph::pall(), Aleph::pfilter(), Aleph::pfoldl(), Aleph::pfor_each(), and Aleph::pmaps().

◆ ensure_random_access()

template<typename Container >
auto Aleph::parallel_detail::ensure_random_access ( const Container c)

For containers with random access, just return a pointer to it For non-random access, copy to vector.

Definition at line 151 of file ah-parallel.H.

References Aleph::maps().

Referenced by Aleph::pall(), Aleph::pfilter(), Aleph::pfoldl(), Aleph::pfor_each(), and Aleph::pmaps().

◆ has_random_access()

template<typename Container >
constexpr bool Aleph::parallel_detail::has_random_access ( )
constexpr

Check if container supports random access.

Definition at line 141 of file ah-parallel.H.