File indexing completed on 2025-01-18 10:13:50
0001 #ifndef VECCORE_BACKEND_SCALAR_H
0002 #define VECCORE_BACKEND_SCALAR_H
0003
0004 #include "Interface.h"
0005 #include "Implementation.h"
0006
0007 namespace vecCore {
0008
0009 template <typename T>
0010 struct TypeTraits {
0011 using ScalarType = T;
0012 using MaskType = bool;
0013 using IndexType = size_t;
0014 static constexpr size_t Size = 1;
0015 };
0016
0017 namespace backend {
0018
0019 template <typename T = Real_s>
0020 class ScalarT {
0021 public:
0022 using Real_v = T;
0023 using Float_v = float;
0024 using Double_v = double;
0025
0026 using Int_v = int;
0027 using Int16_v = int16_t;
0028 using Int32_v = int32_t;
0029 using Int64_v = int64_t;
0030
0031 using UInt_v = unsigned int;
0032 using UInt16_v = uint16_t;
0033 using UInt32_v = uint32_t;
0034 using UInt64_v = uint64_t;
0035 };
0036
0037 using Scalar = ScalarT<>;
0038
0039 }
0040
0041 template <>
0042 VECCORE_FORCE_INLINE
0043 VECCORE_ATT_HOST_DEVICE
0044 bool MaskEmpty<bool>(const bool &mask)
0045 {
0046 return !mask;
0047 }
0048
0049 template <>
0050 VECCORE_FORCE_INLINE
0051 VECCORE_ATT_HOST_DEVICE
0052 bool MaskFull<bool>(const bool &mask)
0053 {
0054 return mask;
0055 }
0056
0057 }
0058
0059 #endif