ryujin 2.1.1 revision f751393c604e228afd3e8516e9e236ec609caae0
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::get_entry (const V &vector, unsigned int i)
 
template<typename T , typename T2 >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry (const std::vector< T2 > &vector, unsigned int i)
 
template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry (const V &vector, const unsigned int *js)
 
template<typename T , typename T2 >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry (const std::vector< T2 > &vector, const unsigned int *js)
 
template<typename T , typename V >
DEAL_II_ALWAYS_INLINE void ryujin::write_entry (V &vector, const T &values, unsigned int i)
 
template<typename T , typename T2 >
DEAL_II_ALWAYS_INLINE void ryujin::write_entry (std::vector< T2 > &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.

◆ 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.

Referenced by ryujin::ShallowWaterInitialStates::SlopingFriction< Description, dim, Number >::compute(), ryujin::EulerInitialStates::Rarefaction< Description, dim, Number >::compute(), ryujin::EulerInitialStates::IsentropicVortex< Description, dim, Number >::compute(), ryujin::EulerInitialStates::LeBlanc< Description, dim, Number >::compute(), ryujin::ShallowWaterInitialStates::FlowOverBump< Description, dim, Number >::compute(), ryujin::TimeLoop< Description, dim, Number >::compute_error(), ryujin::Geometries::Airfoil< dim >::create_triangulation(), ryujin::Euler::RiemannSolver< dim, Number >::df(), ryujin::Euler::RiemannSolver< dim, Number >::f(), ryujin::fast_pow_impl(), ryujin::Euler::HyperbolicSystemView< dim, Number >::harten_entropy(), ryujin::Euler::HyperbolicSystemView< dim, Number >::harten_entropy_derivative(), ryujin::Euler::Limiter< dim, Number >::limit(), ryujin::EulerAEOS::Limiter< dim, Number >::limit(), ryujin::Euler::HyperbolicSystemView< dim, Number >::mathematical_entropy(), ryujin::Euler::HyperbolicSystemView< dim, Number >::mathematical_entropy_derivative(), ryujin::EulerAEOS::RiemannSolver< dim, Number >::p_star_interpolated(), ryujin::EulerAEOS::RiemannSolver< dim, Number >::p_star_RS_full(), ryujin::EulerAEOS::RiemannSolver< dim, Number >::p_star_SS_full(), ryujin::Euler::RiemannSolver< dim, Number >::p_star_two_rarefaction(), ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputation_loop(), ryujin::Euler::HyperbolicSystemView< dim, Number >::prescribe_riemann_characteristic(), ryujin::Manifolds::GradingManifold< dim >::pull_back(), ryujin::Manifolds::GradingManifold< dim >::push_forward(), ryujin::EulerInitialStates::Rarefaction< Description, dim, Number >::Rarefaction(), ryujin::Euler::HyperbolicSystemView< dim, Number >::specific_entropy(), ryujin::EulerAEOS::HyperbolicSystemView< dim, Number >::surrogate_harten_entropy(), ryujin::EulerAEOS::HyperbolicSystemView< dim, Number >::surrogate_harten_entropy_derivative(), and ryujin::EulerAEOS::HyperbolicSystemView< dim, Number >::surrogate_specific_entropy().

◆ 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().

◆ get_entry() [1/4]

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry ( 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.

◆ get_entry() [2/4]

template<typename T , typename T2 >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry ( const std::vector< T2 > &  vector,
unsigned int  i 
)
inline

Variant of above function specialized for std::vector.

Definition at line 267 of file simd.h.

◆ get_entry() [3/4]

template<typename T , typename V >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry ( 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 305 of file simd.h.

◆ get_entry() [4/4]

template<typename T , typename T2 >
DEAL_II_ALWAYS_INLINE T ryujin::get_entry ( const std::vector< T2 > &  vector,
const unsigned int *  js 
)
inline

Variant of above function specialized for std::vector.

Definition at line 330 of file simd.h.

◆ write_entry() [1/2]

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

Write out the given VectorizedArray to the vector

Definition at line 356 of file simd.h.

Referenced by ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::read_in().

◆ write_entry() [2/2]

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

Variant of above function specialized for std::vector.

Definition at line 378 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 411 of file simd.h.

References ryujin::serialize_tensor().

Referenced by ryujin::Postprocessor< ryujin::Euler::Description, dim, double >::compute(), and 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 437 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 453 of file simd.h.

References ryujin::assign_serial_tensor().

Referenced by ryujin::assign_serial_tensor(), and ryujin::Postprocessor< ryujin::Euler::Description, dim, double >::compute().

◆ 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 477 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.