20 #ifndef RAJA_policy_vector_register_scalar_HPP
21 #define RAJA_policy_vector_register_scalar_HPP
57 static constexpr camp::idx_t s_num_elem = 1;
176 m_value = ptr[offsets.get(0)];
197 m_value = ptr[offsets.get(0)];
279 ptr[offsets.get(0)] = m_value;
300 ptr[offsets.get(0)] = m_value;
343 m_value = src.m_value;
393 return m_value * b.m_value + c.m_value;
410 return m_value * b.m_value - c.m_value;
431 return m_value * b.m_value;
465 return self_type(RAJA::max<element_type>(m_value, a.m_value));
499 return self_type(RAJA::min<element_type>(m_value, a.m_value));
RAJA header file defining SIMD/SIMT register operations.
Definition: scalar.hpp:38
RAJA_INLINE RAJA_HOST_DEVICE self_type multiply_subtract(self_type const &b, self_type const &c) const
Fused multiply subtract: fms(b, c) = (*this)*b-c.
Definition: scalar.hpp:408
RAJA_HOST_DEVICE RAJA_INLINE self_type & load_packed(element_type const *ptr)
Load a full register from a stride-one memory location.
Definition: scalar.hpp:102
RAJA_HOST_DEVICE constexpr RAJA_INLINE Register(element_type const &c)
Copy constructor from underlying simd register.
Definition: scalar.hpp:73
RAJA_HOST_DEVICE RAJA_INLINE element_type min() const
Returns the smallest element.
Definition: scalar.hpp:475
RAJA_HOST_DEVICE RAJA_INLINE self_type const & store_packed_n(element_type *ptr, camp::idx_t N) const
Store entire register to consecutive memory locations.
Definition: scalar.hpp:226
RAJA_HOST_DEVICE RAJA_INLINE self_type vmax(self_type a) const
Returns element-wise largest values.
Definition: scalar.hpp:463
RAJA_HOST_DEVICE RAJA_INLINE self_type & load_packed_n(element_type const *ptr, camp::idx_t N)
Partially load a register from a stride-one memory location given a run-time number of elements.
Definition: scalar.hpp:116
RAJA_HOST_DEVICE RAJA_INLINE self_type const & store_strided(element_type *ptr, camp::idx_t) const
Store entire register to consecutive memory locations.
Definition: scalar.hpp:242
RAJA_HOST_DEVICE RAJA_INLINE self_type subtract(self_type const &b) const
Definition: scalar.hpp:358
RAJA_HOST_DEVICE RAJA_INLINE self_type add(self_type const &b) const
Definition: scalar.hpp:350
RAJA_INLINE RAJA_HOST_DEVICE self_type multiply_add(self_type const &b, self_type const &c) const
Fused multiply add: fma(b, c) = (*this)*b+c.
Definition: scalar.hpp:391
RAJA_HOST_DEVICE RAJA_INLINE self_type & copy(self_type const &src)
Definition: scalar.hpp:341
RAJA_HOST_DEVICE RAJA_INLINE self_type divide(self_type const &b) const
Definition: scalar.hpp:374
T register_type
Definition: scalar.hpp:45
RAJA_HOST_DEVICE constexpr RAJA_INLINE Register()
Default constructor, zeros register contents.
Definition: scalar.hpp:65
RAJA_HOST_DEVICE RAJA_INLINE self_type & broadcast(element_type const &a)
Definition: scalar.hpp:332
RAJA_HOST_DEVICE constexpr RAJA_INLINE Register(self_type const &c)
Copy constructor.
Definition: scalar.hpp:81
RAJA_HOST_DEVICE RAJA_INLINE self_type const & store_packed(element_type *ptr) const
Store entire register to consecutive memory locations.
Definition: scalar.hpp:213
RAJA_HOST_DEVICE RAJA_INLINE self_type & load_strided(element_type const *ptr, camp::idx_t)
Gather a full register from a strided memory location.
Definition: scalar.hpp:136
RAJA_INLINE RAJA_HOST_DEVICE self_type & set(element_type value, camp::idx_t)
Set scalar value in vector register.
Definition: scalar.hpp:323
RAJA_HOST_DEVICE RAJA_INLINE self_type vmin(self_type a) const
Returns element-wise largest values.
Definition: scalar.hpp:497
RAJA_HOST_DEVICE constexpr RAJA_INLINE element_type sum() const
Sum the elements of this vector.
Definition: scalar.hpp:420
RAJA_INLINE self_type & gather(element_type const *ptr, int_vector_type offsets)
Generic gather operation for full vector.
Definition: scalar.hpp:173
RAJA_HOST_DEVICE RAJA_INLINE self_type const & store_strided_n(element_type *ptr, camp::idx_t, camp::idx_t N) const
Store partial register to consecutive memory locations.
Definition: scalar.hpp:255
RAJA_HOST_DEVICE constexpr RAJA_INLINE element_type max() const
Returns the largest element.
Definition: scalar.hpp:441
RAJA_HOST_DEVICE RAJA_INLINE element_type min_n(camp::idx_t N) const
Returns the smallest element from first N lanes.
Definition: scalar.hpp:484
T element_type
Definition: scalar.hpp:44
RAJA_INLINE self_type & gather_n(element_type const *ptr, int_vector_type offsets, camp::idx_t N)
Generic gather operation for n-length subvector.
Definition: scalar.hpp:191
RAJA_INLINE self_type const & scatter_n(element_type *ptr, int_vector_type offsets, camp::idx_t N) const
Generic scatter operation for n-length subvector.
Definition: scalar.hpp:294
RAJA_INLINE self_type const & scatter(element_type *ptr, int_vector_type offsets) const
Generic scatter operation for full vector.
Definition: scalar.hpp:276
RAJA_HOST_DEVICE RAJA_INLINE self_type & operator=(self_type const &c)
Copy assignment constructor.
Definition: scalar.hpp:89
RAJA_HOST_DEVICE RAJA_INLINE self_type & load_strided_n(element_type const *ptr, camp::idx_t, camp::idx_t N)
Partially load a register from a stride-one memory location given a run-time number of elements.
Definition: scalar.hpp:150
RAJA_HOST_DEVICE constexpr RAJA_INLINE element_type dot(self_type const &b) const
Sum the elements of this vector.
Definition: scalar.hpp:429
RAJA_HOST_DEVICE RAJA_INLINE element_type max_n(camp::idx_t N) const
Returns the largest element from first N lanes.
Definition: scalar.hpp:450
RAJA_HOST_DEVICE RAJA_INLINE self_type multiply(self_type const &b) const
Definition: scalar.hpp:366
constexpr RAJA_INLINE RAJA_HOST_DEVICE element_type get(camp::idx_t) const
Get scalar value from vector register.
Definition: scalar.hpp:310
Definition: RegisterBase.hpp:39
Definition: RegisterBase.hpp:117
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
Definition: AlignedRangeIndexSetBuilders.cpp:35
RAJA_HOST_DEVICE constexpr RAJA_INLINE Result min(Args... args)
Definition: foldl.hpp:161
RAJA_HOST_DEVICE constexpr RAJA_INLINE Result max(Args... args)
Definition: foldl.hpp:155