Reference documentation for deal.II version GIT relicensing-214-g6e74dec06b 2024-03-27 18:10:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Variables
internal::TensorImplementation Namespace Reference

Variables

template<int rank, int dim, typename Number >
constexpr bool can_treat_values_as_vectorized_array
 
template<int rank, int dim, typename Number >
constexpr size_t tensor_alignment
 

Variable Documentation

◆ can_treat_values_as_vectorized_array

template<int rank, int dim, typename Number >
constexpr bool internal::TensorImplementation::can_treat_values_as_vectorized_array
constexprprivate
Initial value:
=
((rank == 1) &&
(dim > 1) && (dim <= 4) &&
(std::is_same_v<Number, double> || std::is_same_v<Number, float>)&&
(dim <= 2 ? 2 : 4)))

Whether or not the 'values' array of Tensor can be treated as (i.e., bitcasted to) a vectorized array (of possibly more than 'dim' elements, where the padding elements would then have to be ignored by all functions).

We can store the values as an array that can be casted to VectorizedArray if we are considering a rank-1 tensor, and if it stores double or float values, and if there are at most 4 values – we do not try to vectorize the uncommon case of dim>4. We also don't consider the case dim==1 because in that case vectorization does not provide any benefit.

Note that this leads to a platform dependent alignment given that we want to treat the elements as VectorizedArray and that whether or not a VectorizedArray of sufficiently large size exists depends on the platform we're on.

Definition at line 418 of file tensor.h.

◆ tensor_alignment

template<int rank, int dim, typename Number >
constexpr size_t internal::TensorImplementation::tensor_alignment
constexprprivate
Initial value:
=
(can_treat_values_as_vectorized_array<1, dim, Number> ?
(dim <= 2 ? 2 : 4) * sizeof(Number) :
alignof(Number))

Compute the alignment to be used for Tensor objects. We align it by 2 or 4 times the size of the scalar object for rank-1 tensors if rank-1 tensors can be treated as vectorized arrays (which makes sure that the higher-rank tensors are then also so aligned). Otherwise, set the alignment to the alignment of Number.

Definition at line 437 of file tensor.h.