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.