142#ifndef VSPLINE_VECTOR_H
143#define VSPLINE_VECTOR_H
161#if defined USE_STDSIMD
190#ifndef VSPLINE_VECTOR_NBYTES
194#define VSPLINE_VECTOR_NBYTES (2*sizeof(Vc::Vector<float>))
198#define VSPLINE_VECTOR_NBYTES 64
217template <
typename T >
220 template <
size_t sz >
using type =
221 typename std::conditional < sz == 1 ,
249template<> struct simd_traits<T> \
251 static const size_t hsize = Vc::Vector < T > :: size() ; \
252 template < size_t sz > using type = \
253 typename std::conditional \
256 vc_simd_type < T , sz > \
258 enum { default_size = sizeof ( T ) > VSPLINE_VECTOR_NBYTES \
260 : VSPLINE_VECTOR_NBYTES / sizeof ( T ) } ; \
283template<> struct simd_traits<T> \
285 static const size_t hsize = 0 ; \
286 template < size_t sz > using type = \
287 typename std::conditional \
290 typename std::conditional \
291 < ( sz & ( sz - 1 ) ) == 0 , \
292 hwy_simd_type < T , sz > , \
293 vspline::simd_type < T , sz > \
296 enum { default_size = sizeof ( T ) > VSPLINE_VECTOR_NBYTES \
298 : VSPLINE_VECTOR_NBYTES / sizeof ( T ) } ; \
304HWY_SIMD(
unsigned long)
306HWY_SIMD(
unsigned int)
308HWY_SIMD(
unsigned short)
310HWY_SIMD(
unsigned char)
340template <
typename T ,
342 typename Enable =
void >
350 enum {
size = _vsize == 0
361 template <
typename U ,
size_t sz >
380template <
typename T ,
size_t _vsize >
384 typename
std::enable_if
385 < vspline::is_element_expandable < T > :: value
411 enum {
size = _vsize == 0
426 template <
typename U ,
size_t sz >
438 typedef vigra::TinyVector < ele_v , dimension >
nd_ele_v ;
447 typedef typename std::conditional
448 < std::is_fundamental < T > :: value ,
458template <
typename T ,
size_t N >
472template <
typename T ,
typename U >
481template <
typename T ,
typename U ,
int N >
482void assign ( vigra::TinyVector < T , N > & t ,
483 const vigra::TinyVector < U , N > & u )
485 for (
int i = 0 ; i < N ; i++ )
493template <
typename VT1 ,
typename PT ,
typename VT2 >
495 const PT & predicate ,
498 target ( predicate ) = source ;
501template <
typename T >
503 const bool & predicate ,
class template simd_type provides a fixed-size container type for small sets of fundamentals which ar...
definitions common to all files in this project, utility code
#define VSPLINE_VECTOR_NBYTES
void assign(T &t, const U &u)
void assign_if(VT1 &target, const PT &predicate, const VT2 &source)
typename vector_traits< T, N > ::type simdized_type
this alias is used as a shorthand to pick the vectorized type for a given type T and a size N from 'v...
SIMD type using small loops.
traits class simd_traits provides three traits:
typename std::conditional< sz==1, T, vspline::simd_type< T, sz > > ::type type
static const size_t hsize
vigra::ExpandElementResult< T >::type ele_type
vector< ele_type, vsize > ele_v
vigra::TinyVector< ele_v, dimension > nd_ele_v
typename simd_traits< U > ::template type< sz > vector
std::conditional< std::is_fundamental< T >::value, ele_v, nd_ele_v >::type type
vigra::TinyVector< ele_type, dimension > nd_ele_type
with the definition of 'simd_traits', we can proceed to implement 'vector_traits': struct vector_trai...
vigra::TinyVector< ele_type, 1 > nd_ele_type
vigra::TinyVector< ele_v, 1 > nd_ele_v
typename simd_traits< U > ::template type< sz > vector
vector< ele_type, vsize > ele_v
SIMD type derived from Vc::SimdArray.