template<typename VectorizedArrayType, std::size_t width>
class VectorizedArrayBase< VectorizedArrayType, width >
A base class for the various VectorizedArray template specializations, containing common functionalities.
- Template Parameters
-
| VectorizedArrayType | Type of the actual vectorized array this class is operating on. We are using the Curiously Recurring Template Pattern (see https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) in this class to avoid having to resort to virtual member functions. In other words, VectorizedArrayType is a class derived from the current class. |
Definition at line 251 of file vectorization.h.
template<typename VectorizedArrayType, std::size_t width>
template<typename U>
| VectorizedArrayBase< VectorizedArrayType, width >::VectorizedArrayBase |
( |
const std::initializer_list< U > & | list | ) |
|
|
inlineconstexpr |
Construct an array with the given initializer list.
The initializer list must have at most as many elements as the vector length. Elements not listed in the initializer list are zero-initialized.
Definition at line 267 of file vectorization.h.
template<typename VectorizedArrayType, std::size_t width>
| auto VectorizedArrayBase< VectorizedArrayType, width >::dot_product |
( |
const VectorizedArrayType & | v | ) |
const |
|
inline |
A default implementation for computing the dot product between two vectorized arrays. It first forms the lane-by-lane product between the current object and the argument, and then the across-lanes sum of the product. The function returns the kind of object that the VectorizedArray::sum() function returns.
This function is inherited by all derived classes and provides the dot product to them unless they override it with their own implementation (presumably using a more efficient approach).
Definition at line 345 of file vectorization.h.