Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef VECCORE_BACKEND_DEPRECATED_H
0002 #define VECCORE_BACKEND_DEPRECATED_H
0003 
0004 #include "Interface.h"
0005 
0006 // This file contains old interface functions implemented in terms
0007 // of the new ones. This is necessary not to break user code. Once
0008 // we decide if the names for the new interface are good and migrate
0009 // code to the new names, then these can be safely removed after a
0010 // version bump of the library.
0011 
0012 namespace vecCore {
0013 
0014 // old interface, scalar was added first, so is different than others...
0015 
0016 template <typename T>
0017 using Mask_v = typename TypeTraits<T>::MaskType;
0018 template <typename T>
0019 using Index_v = typename TypeTraits<T>::IndexType;
0020 
0021 template <typename T>
0022 struct ScalarType {
0023   using Type = typename TypeTraits<T>::ScalarType;
0024 };
0025 
0026 // Get/Set
0027 
0028 template <typename T>
0029 VECCORE_FORCE_INLINE
0030 VECCORE_ATT_HOST_DEVICE
0031 Scalar<T> LaneAt(const T &v, size_t i)
0032 {
0033   return Get(v, i);
0034 }
0035 
0036 template <typename T>
0037 VECCORE_FORCE_INLINE
0038 VECCORE_ATT_HOST_DEVICE
0039 void AssignLane(T &v, size_t i, Scalar<T> const val)
0040 {
0041   Set(v, i, val);
0042 }
0043 
0044 // Load/Store
0045 
0046 template <typename T>
0047 VECCORE_FORCE_INLINE
0048 VECCORE_ATT_HOST_DEVICE
0049 T FromPtr(Scalar<T> const *ptr)
0050 {
0051   T v;
0052   LoadStoreImplementation<T>::template Load(v, ptr);
0053   return v;
0054 }
0055 
0056 template <typename M>
0057 VECCORE_FORCE_INLINE
0058 VECCORE_ATT_HOST_DEVICE
0059 void StoreMask(M const &mask, bool *ptr)
0060 {
0061   LoadStoreImplementation<M>::template Store<bool>(mask, ptr);
0062 }
0063 
0064 // Masking
0065 
0066 template <typename M>
0067 VECCORE_ATT_HOST_DEVICE
0068 bool MaskFull(const M &mask);
0069 template <typename M>
0070 VECCORE_ATT_HOST_DEVICE
0071 bool MaskEmpty(const M &mask);
0072 
0073 template <typename M>
0074 VECCORE_FORCE_INLINE
0075 VECCORE_ATT_HOST_DEVICE
0076 bool MaskLaneAt(const M &mask, size_t i)
0077 {
0078   return Get(mask, i);
0079 }
0080 
0081 template <typename T>
0082 VECCORE_FORCE_INLINE
0083 VECCORE_ATT_HOST_DEVICE
0084 void AssignMaskLane(T &mask, size_t i, bool val)
0085 {
0086   Set(mask, i, val);
0087 }
0088 
0089 } // namespace vecCore
0090 
0091 #endif