1#ifndef VECCORE_BACKEND_VC_VECTOR_H
2#define VECCORE_BACKEND_VC_VECTOR_H
6template <
typename T,
class Abi>
10 static constexpr size_t Size = Vc::Mask<T, Abi>::Size;
13template <
typename T,
class Abi>
16 using MaskType =
typename Vc::Vector<T, Abi>::MaskType;
17 using IndexType =
typename Vc::Vector<T, Abi>::IndexType;
18 static constexpr size_t Size = Vc::Vector<T, Abi>::Size;
23template <
typename T = Real_s,
class Abi = Vc::VectorAbi::Best<T>>
30 using Int_v = Vc::Vector<int, Abi>;
35 using UInt_v = Vc::Vector<unsigned int, Abi>;
45template <
typename T,
class Abi>
49 return mask.isEmpty();
52template <
typename T,
class Abi>
59template <
typename T,
class Abi>
61 using M = Vc::Mask<T, Abi>;
62 static inline bool Get(
const M &mask,
size_t i) {
return mask[i]; }
64 static inline void Set(
M &mask,
size_t i,
const bool val) { mask[i] = val; }
67template <
typename T,
class Abi>
69 using V = Vc::Vector<T, Abi>;
70 template <
typename S = Scalar<V>>
71 static inline void Load(
V &v, S
const *ptr)
76 template <
typename S = Scalar<V>>
77 static inline void Store(
V const &v, S *ptr)
83template <
typename T,
class Abi>
85 using M = Vc::Mask<T, Abi>;
87 template <
typename S = Scalar<T>>
88 static inline void Load(
M &mask,
bool const *ptr)
93 template <
typename S = Scalar<T>>
94 static inline void Store(
M const &mask, S *ptr)
100template <
typename T,
class Abi>
102 using M = Vc::Mask<T, Abi>;
103 using V = Vc::Vector<T, Abi>;
105 static inline void Assign(
V &dst,
M const &mask,
V const &src) { dst(mask) = src; }
107 static inline void Blend(
V &dst,
M const &mask,
V const &src1,
V const src2)
114inline namespace math {
116template <
typename T,
class Abi>
118Vc::Vector<T, Abi>
CopySign(
const Vc::Vector<T, Abi> &x,
const Vc::Vector<T, Abi> &y)
120 return Vc::copysign(x, y);
123#define VC_MATH_UNARY_FUNCTION(F, f) \
124template <typename T, class Abi> \
125VECCORE_FORCE_INLINE \
126Vc::Vector<T, Abi> F(const Vc::Vector<T, Abi> &x) \
127{ return Vc::f(x); } \
146#undef VC_MATH_UNARY_FUNCTION
148template <
typename T,
class Abi>
150Vc::Vector<T, Abi>
Tan(
const Vc::Vector<T, Abi> &x)
152 Vc::Vector<T, Abi> s, c;
153 Vc::sincos(x, &s, &c);
157template <
typename T,
class Abi>
159Vc::Mask<T, Abi>
IsInf(
const Vc::Vector<T, Abi> &x)
#define VECCORE_FORCE_INLINE
#define VC_MATH_UNARY_FUNCTION(F, f)
Vc::Vector< int16_t, Abi > Int16_v
Vc::Vector< float, Abi > Float_v
Vc::Vector< uint16_t, Abi > UInt16_v
Vc::Vector< T, Abi > Real_v
Vc::Vector< int32_t, Abi > Int32_v
Vc::Vector< unsigned int, Abi > UInt_v
Vc::Vector< double, Abi > Double_v
Vc::Vector< int64_t, Abi > Int64_v
Vc::Vector< uint32_t, Abi > UInt32_v
Vc::Vector< int, Abi > Int_v
Vc::Vector< uint64_t, Abi > UInt64_v
VECCORE_FORCE_INLINE UME::SIMD::SIMDVecMask< N > IsInf(const UME::SIMD::SIMDVec_f< T, N > &x)
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE T Rsqrt(const T &x)
VECCORE_FORCE_INLINE Vc::SimdArray< T, N > CopySign(const Vc::SimdArray< T, N > &x, const Vc::SimdArray< T, N > &y)
VECCORE_FORCE_INLINE Vc::SimdArray< T, N > Tan(const Vc::SimdArray< T, N > &x)
VECCORE_ATT_HOST_DEVICE bool MaskEmpty(const M &mask)
typename TypeTraits< T >::MaskType Mask
VECCORE_ATT_HOST_DEVICE bool MaskFull(const M &mask)
static void Set(M &mask, size_t i, const bool val)
static bool Get(const M &mask, size_t i)
static void Store(M const &mask, S *ptr)
static void Load(M &mask, bool const *ptr)
static void Store(V const &v, S *ptr)
static void Load(V &v, S const *ptr)
static void Blend(V &dst, M const &mask, V const &src1, V const src2)
static void Assign(V &dst, M const &mask, V const &src)
typename Vc::Vector< T, Abi >::IndexType IndexType
typename Vc::Vector< T, Abi >::MaskType MaskType
static constexpr size_t Size