ryujin 2.1.1 revision ae95f0746689649c34c5726a2385af071c7c8efd
Classes | Functions
SIMD

Classes

class  ryujin::MultiComponentVector< Number, n_comp, simd_length >
 
struct  ryujin::get_value_type< T >
 

Functions

std::shared_ptr< const dealii::Utilities::MPI::Partitioner > ryujin::create_vector_partitioner (const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &scalar_partitioner, const unsigned int n_components)
 

Type traits and packed index handling

template<typename T >
unsigned int ryujin::get_stride_size = 1
 
template<unsigned int length, typename Functor >
DEAL_II_ALWAYS_INLINE auto ryujin::generate_iterators (Functor f) -> std::array< auto, length >
 
template<typename T >
DEAL_II_ALWAYS_INLINE void ryujin::increment_iterators (T &iterators)
 

Transcendental and other mathematical operations

template<typename Number >
DEAL_II_ALWAYS_INLINE Number ryujin::positive_part (const Number number)
 
template<typename Number >
DEAL_II_ALWAYS_INLINE Number ryujin::negative_part (const Number number)
 
template<int N, typename T >
ryujin::fixed_power (const T x)
 
template<typename T >
ryujin::pow (const T x, const T b)
 
template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::pow (const dealii::VectorizedArray< T, width > x, const T b)
 
template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::pow (const dealii::VectorizedArray< T, width > x, const dealii::VectorizedArray< T, width > b)
 
template<typename T >
ryujin::fast_pow (const T x, const T b, const Bias bias=Bias::none)
 
template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::fast_pow (const dealii::VectorizedArray< T, width > x, const T b, const Bias bias=Bias::none)
 
template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::fast_pow (const dealii::VectorizedArray< T, width > x, const dealii::VectorizedArray< T, width > b, const Bias bias=Bias::none)
 

SIMD based access to vectors and arrays of vectors

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::load_value (const V &vector, unsigned int i)
 
template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::load_value (const V &vector, const unsigned int *js)
 
template<typename T , typename V >
DEAL_II_ALWAYS_INLINE void ryujin::store_value (V &vector, const T &values, unsigned int i)
 
template<int rank, int dim, std::size_t width, typename Number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< rank, dim, Number > ryujin::serialize_tensor (const dealii::Tensor< rank, dim, dealii::VectorizedArray< Number, width > > &vectorized, const unsigned int k)
 
template<int rank, int dim, typename Number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< rank, dim, Number > ryujin::serialize_tensor (const dealii::Tensor< rank, dim, Number > &serial, const unsigned int k)
 
template<int rank, int dim, std::size_t width, typename Number >
DEAL_II_ALWAYS_INLINE void ryujin::assign_serial_tensor (dealii::Tensor< rank, dim, dealii::VectorizedArray< Number, width > > &result, const dealii::Tensor< rank, dim, Number > &serial, const unsigned int k)
 
template<int rank, int dim, typename Number >
DEAL_II_ALWAYS_INLINE void ryujin::assign_serial_tensor (dealii::Tensor< rank, dim, Number > &result, const dealii::Tensor< rank, dim, Number > &serial, const unsigned int k)
 

Detailed Description

SIMD related functions and classes.

Function Documentation

◆ create_vector_partitioner()

std::shared_ptr< const dealii::Utilities::MPI::Partitioner > ryujin::create_vector_partitioner ( const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &  scalar_partitioner,
const unsigned int  n_components 
)

This function takes a scalar MPI partitioner scalar_partitioner as argument and returns a shared pointer to a new "vector" multicomponent partitioner that defines storage and MPI synchronization for a vector consisting of n_comp components. The vector partitioner is intended to efficiently store non-scalar vectors such as the state vectors U. Let (U_i)_k denote the k-th component of a state vector element U_i, we then store

\begin{align} (U_0)_0, (U_0)_1, (U_0)_2, (U_0)_3, (U_0)_4, (U_1)_0, (U_1)_1, (U_1)_2, (U_1)_3, (U_1)_4, \ldots \end{align}

Note
This function is used to efficiently set up a single vector partitioner in OfflineData used in all MultiComponentVector instances.

Definition at line 11 of file multicomponent_vector.cc.

◆ generate_iterators()

template<unsigned int length, typename Functor >
DEAL_II_ALWAYS_INLINE auto ryujin::generate_iterators ( Functor  f) -> std::array<auto, length>
inline

Given a callable object f(k), this function creates a std::array with elements initialized as follows:

{ f(0) , f(1) , ... , f(length - 1) }

We use this function to create an array of sparsity iterators that cannot be default initialized.

Definition at line 80 of file simd.h.

◆ increment_iterators()

template<typename T >
DEAL_II_ALWAYS_INLINE void ryujin::increment_iterators ( T &  iterators)
inline

Increment all iterators in an std::array simultaneously.

Definition at line 93 of file simd.h.

◆ positive_part()

template<typename Number >
DEAL_II_ALWAYS_INLINE Number ryujin::positive_part ( const Number  number)
inline

◆ negative_part()

template<typename Number >
DEAL_II_ALWAYS_INLINE Number ryujin::negative_part ( const Number  number)
inline

◆ fixed_power()

template<int N, typename T >
T ryujin::fixed_power ( const T  x)
inline

A wrapper around dealii::Utilities::fixed_power. We use a wrapper instead of calling the function directly so that we can easily change the implementation at one central place.

Definition at line 137 of file simd.h.

◆ pow() [1/3]

template<typename T >
T ryujin::pow ( const T  x,
const T  b 
)

Custom serial pow function.

◆ pow() [2/3]

template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::pow ( const dealii::VectorizedArray< T, width >  x,
const T  b 
)

Custom implementation of a vectorized pow function.

Definition at line 238 of file simd.template.h.

References ryujin::pow().

◆ pow() [3/3]

template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::pow ( const dealii::VectorizedArray< T, width >  x,
const dealii::VectorizedArray< T, width >  b 
)

Custom implementation of a vectorized pow function with vectorized exponent.

Definition at line 247 of file simd.template.h.

References ryujin::pow().

◆ fast_pow() [1/3]

template<typename T >
T ryujin::fast_pow ( const T  x,
const T  b,
const Bias  bias = Bias::none 
)

Custom serial approximate pow function.

◆ fast_pow() [2/3]

template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::fast_pow ( const dealii::VectorizedArray< T, width >  x,
const T  b,
const Bias  bias = Bias::none 
)

Custom implementation of an approximate, vectorized pow function.

Definition at line 299 of file simd.template.h.

References ryujin::fast_pow_impl().

◆ fast_pow() [3/3]

template<typename T , std::size_t width>
dealii::VectorizedArray< T, width > ryujin::fast_pow ( const dealii::VectorizedArray< T, width >  x,
const dealii::VectorizedArray< T, width >  b,
const Bias  bias = Bias::none 
)

Custom implementation of an approximate, vectorized pow function with vectorized exponent.

Definition at line 311 of file simd.template.h.

References ryujin::fast_pow_impl().

◆ load_value() [1/2]

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::load_value ( const V &  vector,
unsigned int  i 
)
inline

Return a VectorizedArray with { U[i] , U[i + 1] , ... , U[i + VectorizedArray::size() - 1] }

Definition at line 243 of file simd.h.

◆ load_value() [2/2]

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::load_value ( const V &  vector,
const unsigned int *  js 
)
inline

Return a VectorizedArray with { U[js[0] , U[js[1]] , ... , U[js[VectorizedArray::size() - 1]] }

Definition at line 269 of file simd.h.

◆ store_value()

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE void ryujin::store_value ( V &  vector,
const T &  values,
unsigned int  i 
)
inline

Write out the given VectorizedArray to the vector

Definition at line 296 of file simd.h.

◆ serialize_tensor() [1/2]

template<int rank, int dim, std::size_t width, typename Number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< rank, dim, Number > ryujin::serialize_tensor ( const dealii::Tensor< rank, dim, dealii::VectorizedArray< Number, width > > &  vectorized,
const unsigned int  k 
)
inline

Return the k-th serialized component of a Tensor of VectorizedArray

Definition at line 319 of file simd.h.

References ryujin::serialize_tensor().

Referenced by ryujin::serialize_tensor().

◆ serialize_tensor() [2/2]

template<int rank, int dim, typename Number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< rank, dim, Number > ryujin::serialize_tensor ( const dealii::Tensor< rank, dim, Number > &  serial,
const unsigned int  k 
)
inline

Variant of above function for serial Tensors that simply returns the given tensor.

Definition at line 345 of file simd.h.

◆ assign_serial_tensor() [1/2]

template<int rank, int dim, std::size_t width, typename Number >
DEAL_II_ALWAYS_INLINE void ryujin::assign_serial_tensor ( dealii::Tensor< rank, dim, dealii::VectorizedArray< Number, width > > &  result,
const dealii::Tensor< rank, dim, Number > &  serial,
const unsigned int  k 
)
inline

Update the the k-th serial component of a Tensor of VectorizedArray

Definition at line 362 of file simd.h.

References ryujin::assign_serial_tensor().

Referenced by ryujin::assign_serial_tensor().

◆ assign_serial_tensor() [2/2]

template<int rank, int dim, typename Number >
DEAL_II_ALWAYS_INLINE void ryujin::assign_serial_tensor ( dealii::Tensor< rank, dim, Number > &  result,
const dealii::Tensor< rank, dim, Number > &  serial,
const unsigned int  k 
)
inline

Variant of above function for serial Tensors that simply assigns the given tensor as is.

Definition at line 386 of file simd.h.

Variable Documentation

◆ get_stride_size

template<typename T >
unsigned int ryujin::get_stride_size = 1

Return the stride size:

Definition at line 48 of file simd.h.