Helper Functions
-
template<typename VectorT, EnableIfVector<VectorT> = 0>
inline VectorT genericload(const VectorToScalarT<VectorT> *source) Function that allows VectorTriple to load a SIMD register.
- Template Parameters
VectorT – the SIMD type to be loaded
- Parameters
source – scalar array to be loaded from
- Returns
SIMD datatype
-
template<typename T, EnableIfFloating<T> = 0>
inline T genericload(const T *source) Function that allows VectorTriple to load a scalar coordinate.
- Template Parameters
T – the type to be loaded (float or double)
- Parameters
source – scalar array to be loaded from
- Returns
scalar value
-
template<typename T, unsigned char stride, EnableIfFloating<T> = 0>
inline void genericidxload(const T *source, const std::size_t *idxs, T &x, T &y, T &z) Function that allows VectorTriple to load into a scalar datatype from a coordinate array by index before deinterleaving.
- Template Parameters
VectorT – the SIMD type to be loaded
stride – a step into the idxs array, load every n’th index
- Parameters
source – scalar coordinate array to load from
idxs – indices for the coordinate array
x – x coordinates are returned in this scalar
y – y coordinates are returned in this scalar
z – z coordinates are returned in this scalar
-
template<typename VectorT, unsigned char stride, EnableIfVector<VectorT> = 0>
inline void genericidxload(const VectorToScalarT<VectorT> *source, const std::size_t *idxs, VectorT &x, VectorT &y, VectorT &z) Function that allows VectorTriple to load into a SIMD datatype from a coordinate array by index before deinterleaving.
- Template Parameters
VectorT – the SIMD type to be loaded
stride – a step into the idxs array, load every n’th index
- Parameters
source – scalar coordinate array to load from
idxs – indices for the coordinate array
x – x coordinates are returned deinterleaved in this register
y – y coordinates are returned deinterleaved in this register
z – z coordinates are returned deinterleaved in this register
-
template<typename VectorT, EnableIfVector<VectorT> = 0>
inline void genericstore(VectorToScalarT<VectorT> *target, const VectorT val) Function that allows VectorTriple to store a SIMD datatype into an array.
- Template Parameters
VectorT – the SIMD type to be stored
- Parameters
target – scalar coordinate array to store to
val – SIMD datatype to store
-
template<typename T, EnableIfFloating<T> = 0>
inline void genericstore(T *target, const T val) Function that allows VectorTriple to store a scalar datatype into an array.
- Template Parameters
T – the scalar type to be stored
- Parameters
target – scalar coordinate array to store to
val – SIMD datatype to store
-
template<typename VectorT, EnableIfVector<VectorT> = 0>
inline void genericstream(VectorToScalarT<VectorT> *target, const VectorT val) Function that allows VectorTriple to stream a SIMD datatype into an array.
- Template Parameters
VectorT – the SIMD type to be stored
- Parameters
target – scalar coordinate array to stream to
val – SIMD datatype to stream
-
template<typename T, EnableIfFloating<T> = 0>
inline void genericstream(T *target, const T val) Function that allows VectorTriple to stream a scalar datatype into an array.
- Template Parameters
T – the scalar type to be stored
- Parameters
target – scalar coordinate array to stream to
val – SIMD datatype to stream