JayBeams  0.1
Another project to have fun coding.
Classes | Functions
jb::detail Namespace Reference

Classes

struct  aligned_container
 Alias array_type based on the container_type shape to store value_type. More...
 
struct  aligned_container< value_type, boost::multi_array< T, K, A > >
 Alias array_type based on the boost::multi_array type shape to store value_type. More...
 
struct  always_aligned
 Determine if a timeseries type guarantees alignment suitable for SIMD optimizations. More...
 
struct  always_aligned< jb::fftw::aligned_multi_array< T, K > >
 Determine if a aligned_multi_array timeseries type guarantees alignment suitable for SIMD optimizations. More...
 
struct  always_aligned< jb::fftw::aligned_vector< T > >
 Determine if a aligned_vector timeseries type guarantees alignment suitable for SIMD optimizations. More...
 
struct  array_traits
 Alias element type stored on a container. More...
 
struct  array_traits< boost::multi_array< T, K, A > >
 Alias element type stored on a boost::multi_array<> containers. More...
 
struct  thread_setup_wrapper
 Hold data to startup a thread in JayBeams. More...
 

Functions

template<typename container_type >
std::size_t element_count (container_type const &a)
 Count the number of elements for a vector-like container. More...
 
template<typename container_type >
std::size_t nsamples (container_type const &a)
 Count the elements in the last dimension of a vector-like container. More...
 
template<typename container_type >
std::size_t array_shape (container_type const &a)
 Return the shape of the container in a form suitable for construction of a vector-like container. More...
 
template<typename T , std::size_t K, typename A >
std::size_t element_count (boost::multi_array< T, K, A > const &a)
 Count the number of elements for boost::multi_array<> containers. More...
 
template<typename T , std::size_t K, typename A >
std::size_t nsamples (boost::multi_array< T, K, A > const &a)
 Count the number of elements in the last dimension for boost::multi_array<> containers. More...
 
template<typename T , std::size_t K, typename A >
std::vector< std::size_t > array_shape (boost::multi_array< T, K, A > const &a)
 Return the shape of the container in a form suitable for construction of a boost::multi_array<> containers. More...
 
void os_check_error (int result, char const *msg)
 Check the value of result and raise an exception if it is -1. More...
 
void reconfigure_this_thread (thread_config const &config)
 Change the current thread parameters based on the configuration. More...
 
template<typename Callable >
thread_setup_wrapper< Callable > make_thread_setup_wrapper (thread_config const &config, Callable &&c)
 Create the right type of thread_setup_wrapper<>. More...
 

Class Documentation

◆ jb::detail::aligned_container

struct jb::detail::aligned_container

template<typename value_type, typename container_type>
struct jb::detail::aligned_container< value_type, container_type >

Alias array_type based on the container_type shape to store value_type.

The generic version implements the class assuming std::vector<> or any similar container. We provide specializations for other types (such as boost::multi_array<>) to be able to operate on them generically.

Template Parameters
value_typethe type to store on the aligned_container_type
array_typethe type of container, typically std::vector<>

Definition at line 42 of file array_traits.hpp.

Class Members
typedef typename
aligned_vector< value_type >
array_type

◆ jb::detail::aligned_container< value_type, boost::multi_array< T, K, A > >

struct jb::detail::aligned_container< value_type, boost::multi_array< T, K, A > >

template<typename value_type, typename T, std::size_t K, typename A>
struct jb::detail::aligned_container< value_type, boost::multi_array< T, K, A > >

Alias array_type based on the boost::multi_array type shape to store value_type.

Provides specializations for a boost multi array container to be able to operate on them generically.

Template Parameters
value_typethe type to store on the aligned_container_type
Tthe type stored by the boost::multi_array container
Kboost multi array dimensionality
Aan Allocator type for type T allocator storage

Definition at line 115 of file array_traits.hpp.

Class Members
typedef typename
aligned_multi_array
< value_type, K >
array_type Define the type of the elements in the container.

◆ jb::detail::array_traits

struct jb::detail::array_traits

template<typename container_type>
struct jb::detail::array_traits< container_type >

Alias element type stored on a container.

The generic version implements the class assuming std::vector<> or any similar container. We provide specializations for other types (such as boost::multi_array<>) to be able to operate on them generically.

Template Parameters
container_typethe type of container, typically std::vector<>

Definition at line 24 of file array_traits.hpp.

Class Members
typedef typename value_type element_type Define the type of the elements in the container.

◆ jb::detail::array_traits< boost::multi_array< T, K, A > >

struct jb::detail::array_traits< boost::multi_array< T, K, A > >

template<typename T, std::size_t K, typename A>
struct jb::detail::array_traits< boost::multi_array< T, K, A > >

Alias element type stored on a boost::multi_array<> containers.

Provides specializations for a boost multi array container to be able to operate on them generically.

Template Parameters
Tthe type stored by the boost::multi_array container
Kboost multi array dimensionality
Aan Allocator type for type T allocator storage

Definition at line 97 of file array_traits.hpp.

Class Members
typedef typename multi_array
< T, K, A >::element
element_type Define the type of the elements in the array.

Function Documentation

◆ array_shape() [1/2]

template<typename container_type >
std::size_t jb::detail::array_shape ( container_type const &  a)
inline

Return the shape of the container in a form suitable for construction of a vector-like container.

The generic version implements the class assuming std::vector<> or any similar container.

Template Parameters
container_typethe type of container, typically std::vector<>

Definition at line 82 of file array_traits.hpp.

Referenced by jb::testing::delay_timeseries(), jb::fftw::time_delay_estimator_many< array_t >::estimate_delay(), jb::fftw::tde_result< boost::multi_array< T, K, A >, value_t >::tde_result(), and jb::fftw::time_delay_estimator_many< array_t >::time_delay_estimator_many().

◆ array_shape() [2/2]

template<typename T , std::size_t K, typename A >
std::vector<std::size_t> jb::detail::array_shape ( boost::multi_array< T, K, A > const &  a)
inline

Return the shape of the container in a form suitable for construction of a boost::multi_array<> containers.

Provides specializations for a boost multi array container to be able to operate on them generically.

Template Parameters
Tthe type stored by the boost::multi_array container
Kboost multi array dimensionality
Aan Allocator type for type T allocator storage

Definition at line 164 of file array_traits.hpp.

◆ element_count() [1/2]

template<typename container_type >
std::size_t jb::detail::element_count ( container_type const &  a)
inline

Count the number of elements for a vector-like container.

The generic version implements the class assuming std::vector<> or any similar container.

Template Parameters
container_typethe type of container, typically std::vector<>

Definition at line 55 of file array_traits.hpp.

Referenced by jb::fftw::create_backward_plan(), jb::fftw::create_forward_plan(), jb::testing::create_triangle_timeseries(), jb::testing::delay_timeseries(), jb::fftw::time_delay_estimator_many< array_t >::estimate_delay(), jb::fftw::plan< timeseries_type, frequency_timeseries_type >::execute(), jb::testing::extrapolate_timeseries(), jb::fftw::tde_result< boost::multi_array< T, K, A >, value_t >::size(), and jb::testing::sum_square().

◆ element_count() [2/2]

template<typename T , std::size_t K, typename A >
std::size_t jb::detail::element_count ( boost::multi_array< T, K, A > const &  a)
inline

Count the number of elements for boost::multi_array<> containers.

Provides specializations for a boost multi array container to be able to operate on them generically.

Template Parameters
Tthe type stored by the boost::multi_array container
Kboost multi array dimensionality
Aan Allocator type for type T allocator storage

Definition at line 131 of file array_traits.hpp.

◆ make_thread_setup_wrapper()

template<typename Callable >
thread_setup_wrapper<Callable> jb::detail::make_thread_setup_wrapper ( thread_config const &  config,
Callable &&  c 
)

Create the right type of thread_setup_wrapper<>.

Definition at line 51 of file thread_setup_wrapper.hpp.

Referenced by jb::launch_thread().

◆ nsamples() [1/2]

template<typename container_type >
std::size_t jb::detail::nsamples ( container_type const &  a)
inline

Count the elements in the last dimension of a vector-like container.

The generic version implements the class assuming std::vector<> or any similar container.

Template Parameters
container_typethe type of container, typically std::vector<>

Definition at line 68 of file array_traits.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(), jb::fftw::create_backward_plan(), jb::fftw::create_forward_plan(), jb::testing::create_random_timeseries(), jb::testing::create_square_timeseries(), jb::testing::create_triangle_timeseries(), jb::fftw::plan< timeseries_type, frequency_timeseries_type >::execute(), main(), and jb::testing::sum_square().

◆ nsamples() [2/2]

template<typename T , std::size_t K, typename A >
std::size_t jb::detail::nsamples ( boost::multi_array< T, K, A > const &  a)
inline

Count the number of elements in the last dimension for boost::multi_array<> containers.

Provides specializations for a boost multi array container to be able to operate on them generically.

Template Parameters
Tthe type stored by the boost::multi_array container
Kboost multi array dimensionality
Aan Allocator type for type T allocator storage

Definition at line 147 of file array_traits.hpp.

◆ os_check_error()

void jb::detail::os_check_error ( int  result,
char const *  msg 
)

Check the value of result and raise an exception if it is -1.

Definition at line 5 of file os_error.cpp.

Referenced by reconfigure_this_thread().

◆ reconfigure_this_thread()

void jb::detail::reconfigure_this_thread ( jb::thread_config const &  config)

Change the current thread parameters based on the configuration.

Parameters
configthe thread configuration
Exceptions
std::exceptionif the thread cannot be configured as desired

Definition at line 7 of file reconfigure_thread.cpp.

References jb::thread_config::affinity, jb::thread_config::ignore_setup_errors, jb::thread_config::name, jb::thread_config::native_priority(), jb::thread_config::native_scheduling_policy(), and os_check_error().

Referenced by jb::detail::thread_setup_wrapper< Callable >::operator()(), and jb::testing::microbenchmark< Fixture >::run().