Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:50

0001 #ifndef VECCORE_BACKEND_INTERFACE_H
0002 #define VECCORE_BACKEND_INTERFACE_H
0003 
0004 namespace vecCore {
0005 
0006 template <typename T>
0007 struct TypeTraits;
0008 
0009 template <typename T>
0010 using Mask = typename TypeTraits<T>::MaskType;
0011 
0012 template <typename T>
0013 using Index = typename TypeTraits<T>::IndexType;
0014 
0015 template <typename T>
0016 using Scalar = typename TypeTraits<T>::ScalarType;
0017 
0018 // Iterators
0019 
0020 template <typename T>
0021 VECCORE_FORCE_INLINE
0022 VECCORE_ATT_HOST_DEVICE
0023 Scalar<T> *Begin(T &v);
0024 
0025 template <typename T>
0026 VECCORE_FORCE_INLINE
0027 VECCORE_ATT_HOST_DEVICE
0028 Scalar<T> *End(T &v);
0029 
0030 template <typename T>
0031 VECCORE_FORCE_INLINE
0032 VECCORE_ATT_HOST_DEVICE
0033 Scalar<T> const *Begin(T const &v);
0034 
0035 template <typename T>
0036 VECCORE_FORCE_INLINE
0037 VECCORE_ATT_HOST_DEVICE
0038 Scalar<T> const *End(T const &v);
0039 
0040 // Vector Size
0041 
0042 template <typename T>
0043 VECCORE_FORCE_INLINE
0044 VECCORE_ATT_HOST_DEVICE
0045 constexpr size_t VectorSize();
0046 
0047 // Get/Set
0048 
0049 template <typename T>
0050 VECCORE_FORCE_INLINE
0051 VECCORE_ATT_HOST_DEVICE
0052 Scalar<T> Get(const T &v, size_t i);
0053 
0054 template <typename T>
0055 VECCORE_FORCE_INLINE
0056 VECCORE_ATT_HOST_DEVICE
0057 void Set(T &v, size_t i, Scalar<T> const val);
0058 
0059 // Load/Store
0060 
0061 template <typename T>
0062 VECCORE_FORCE_INLINE
0063 VECCORE_ATT_HOST_DEVICE
0064 void Load(T &v, Scalar<T> const *ptr);
0065 
0066 template <typename T>
0067 VECCORE_FORCE_INLINE
0068 VECCORE_ATT_HOST_DEVICE
0069 void Store(T const &v, Scalar<T> *ptr);
0070 
0071 // Gather/Scatter
0072 
0073 template <typename T, typename S = Scalar<T>>
0074 VECCORE_FORCE_INLINE
0075 VECCORE_ATT_HOST_DEVICE
0076 T Gather(S const *ptr, Index<T> const &idx);
0077 
0078 template <typename T, typename S = Scalar<T>>
0079 VECCORE_FORCE_INLINE
0080 VECCORE_ATT_HOST_DEVICE
0081 void Scatter(T const &v, S *ptr, Index<T> const &idx);
0082 
0083 // Masking/Blending
0084 
0085 template <typename M>
0086 VECCORE_FORCE_INLINE
0087 VECCORE_ATT_HOST_DEVICE
0088 bool MaskFull(M const &mask);
0089 
0090 template <typename M>
0091 VECCORE_FORCE_INLINE
0092 VECCORE_ATT_HOST_DEVICE
0093 bool MaskEmpty(M const &mask);
0094 
0095 template <typename T>
0096 VECCORE_FORCE_INLINE
0097 VECCORE_ATT_HOST_DEVICE
0098 void MaskedAssign(T &dst, const Mask<T> &mask, const T &src);
0099 
0100 template <typename T>
0101 VECCORE_FORCE_INLINE
0102 VECCORE_ATT_HOST_DEVICE
0103 T Blend(const Mask<T> &mask, const T &src1, const T &src2);
0104 
0105 VECCORE_FORCE_INLINE
0106 VECCORE_ATT_HOST_DEVICE
0107 constexpr bool EarlyReturnAllowed();
0108 
0109 template <typename T>
0110 VECCORE_FORCE_INLINE
0111 VECCORE_ATT_HOST_DEVICE
0112 constexpr bool EarlyReturnMaxLength(T &, size_t);
0113 
0114 // Reduction
0115 
0116 template <typename T>
0117 VECCORE_FORCE_INLINE
0118 VECCORE_ATT_HOST_DEVICE
0119 Scalar<T> ReduceAdd(const T& v);
0120 
0121 template <typename T>
0122 VECCORE_FORCE_INLINE
0123 VECCORE_ATT_HOST_DEVICE
0124 Scalar<T> ReduceMin(const T& v);
0125 
0126 template <typename T>
0127 VECCORE_FORCE_INLINE
0128 VECCORE_ATT_HOST_DEVICE
0129 Scalar<T> ReduceMax(const T& v);
0130 
0131 } // namespace vecCore
0132 
0133 #endif