VecCore 0.8.1
C++ Library for Portable SIMD Vectorization
Loading...
Searching...
No Matches
Scalar.h
Go to the documentation of this file.
1#ifndef VECCORE_BACKEND_SCALAR_H
2#define VECCORE_BACKEND_SCALAR_H
3
4#include "Interface.h"
5#include "Implementation.h"
6
7namespace vecCore {
8
9template <typename T>
10struct TypeTraits {
11 using ScalarType = T;
12 using MaskType = bool;
13 using IndexType = size_t;
14 static constexpr size_t Size = 1;
15};
16
17namespace backend {
18
19template <typename T = Real_s>
20class ScalarT {
21public:
22 using Real_v = T;
23 using Float_v = float;
24 using Double_v = double;
25
26 using Int_v = int;
27 using Int16_v = int16_t;
28 using Int32_v = int32_t;
29 using Int64_v = int64_t;
30
31 using UInt_v = unsigned int;
32 using UInt16_v = uint16_t;
33 using UInt32_v = uint32_t;
34 using UInt64_v = uint64_t;
35};
36
38
39} // namespace backend
40
41template <>
44bool MaskEmpty<bool>(const bool &mask)
45{
46 return !mask;
47}
48
49template <>
52bool MaskFull<bool>(const bool &mask)
53{
54 return mask;
55}
56
57} // namespace vecCore
58
59#endif
#define VECCORE_ATT_HOST_DEVICE
Definition: CUDA.h:10
#define VECCORE_FORCE_INLINE
Definition: Common.h:32
unsigned int UInt_v
Definition: Scalar.h:31
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE bool MaskFull< bool >(const bool &mask)
Definition: Scalar.h:52
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE bool MaskEmpty< bool >(const bool &mask)
Definition: Scalar.h:44
static constexpr size_t Size
Definition: Scalar.h:14
size_t IndexType
Definition: Scalar.h:13