VecCore 0.8.1
C++ Library for Portable SIMD Vectorization
Loading...
Searching...
No Matches
Deprecated.h
Go to the documentation of this file.
1#ifndef VECCORE_BACKEND_DEPRECATED_H
2#define VECCORE_BACKEND_DEPRECATED_H
3
4#include "Interface.h"
5
6// This file contains old interface functions implemented in terms
7// of the new ones. This is necessary not to break user code. Once
8// we decide if the names for the new interface are good and migrate
9// code to the new names, then these can be safely removed after a
10// version bump of the library.
11
12namespace vecCore {
13
14// old interface, scalar was added first, so is different than others...
15
16template <typename T>
18template <typename T>
20
21template <typename T>
22struct ScalarType {
24};
25
26// Get/Set
27
28template <typename T>
31Scalar<T> LaneAt(const T &v, size_t i)
32{
33 return Get(v, i);
34}
35
36template <typename T>
39void AssignLane(T &v, size_t i, Scalar<T> const val)
40{
41 Set(v, i, val);
42}
43
44// Load/Store
45
46template <typename T>
49T FromPtr(Scalar<T> const *ptr)
50{
51 T v;
53 return v;
54}
55
56template <typename M>
59void StoreMask(M const &mask, bool *ptr)
60{
61 LoadStoreImplementation<M>::template Store<bool>(mask, ptr);
62}
63
64// Masking
65
66template <typename M>
68bool MaskFull(const M &mask);
69template <typename M>
71bool MaskEmpty(const M &mask);
72
73template <typename M>
76bool MaskLaneAt(const M &mask, size_t i)
77{
78 return Get(mask, i);
79}
80
81template <typename T>
84void AssignMaskLane(T &mask, size_t i, bool val)
85{
86 Set(mask, i, val);
87}
88
89} // namespace vecCore
90
91#endif
#define VECCORE_ATT_HOST_DEVICE
Definition: CUDA.h:10
#define VECCORE_FORCE_INLINE
Definition: Common.h:32
VECCORE_ATT_HOST_DEVICE bool MaskEmpty(const M &mask)
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE Scalar< T > Get(const T &v, size_t i)
typename TypeTraits< T >::ScalarType Scalar
Definition: Interface.h:16
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE void AssignMaskLane(T &mask, size_t i, bool val)
Definition: Deprecated.h:84
typename TypeTraits< T >::MaskType Mask_v
Definition: Deprecated.h:17
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE void AssignLane(T &v, size_t i, Scalar< T > const val)
Definition: Deprecated.h:39
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE void Set(T &v, size_t i, Scalar< T > const val)
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE void StoreMask(M const &mask, bool *ptr)
Definition: Deprecated.h:59
VECCORE_ATT_HOST_DEVICE bool MaskFull(const M &mask)
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE T FromPtr(Scalar< T > const *ptr)
Definition: Deprecated.h:49
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE void Load(T &v, Scalar< T > const *ptr)
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE Scalar< T > LaneAt(const T &v, size_t i)
Definition: Deprecated.h:31
VECCORE_FORCE_INLINE VECCORE_ATT_HOST_DEVICE bool MaskLaneAt(const M &mask, size_t i)
Definition: Deprecated.h:76
typename TypeTraits< T >::IndexType Index_v
Definition: Deprecated.h:19
typename TypeTraits< T >::ScalarType Type
Definition: Deprecated.h:23
size_t IndexType
Definition: Scalar.h:13