RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
types.hpp
Go to the documentation of this file.
1 
13 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
14 // Copyright (c) Lawrence Livermore National Security, LLC and other
15 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
16 // files for dates and other details. No copyright assignment is required
17 // to contribute to RAJA.
18 //
19 // SPDX-License-Identifier: (BSD-3-Clause)
20 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
21 
22 #ifndef RAJA_Types_HPP
23 #define RAJA_Types_HPP
24 
25 #include "RAJA/config.hpp"
26 
27 #include <cstddef>
28 
29 #if defined(RAJA_USE_COMPLEX)
30 #include <complex>
31 #endif
32 
33 #include "camp/helpers.hpp"
34 
35 #include "RAJA/util/macros.hpp"
36 
37 namespace RAJA
38 {
39 
43 enum named_usage : int
44 {
45  ignored = -1,
46  unspecified = 0
47 };
48 
52 enum struct named_dim : int
53 {
54  x = 0,
55  y = 1,
56  z = 2
57 };
58 
62 enum struct kernel_sync_requirement : int
63 {
64  none = 0,
65  sync = 1
66 };
67 
71 namespace iteration_mapping
72 {
73 
75 {};
76 
77 struct DirectBase
78 {};
79 
80 struct LoopBase
81 {};
82 
84 {};
85 
87 {};
88 
90 {};
91 
93 {};
94 
95 template<size_t t_max_iterations>
97 {
98  static constexpr size_t max_iterations = t_max_iterations;
99 };
100 
119 {};
120 
143 {};
144 
170 template<size_t max_iterations>
173  std::conditional_t<(max_iterations != named_usage::unspecified),
174  SizedLoopSpecifyingBase<max_iterations>,
175  UnsizedLoopBase>
176 {};
177 
203 template<size_t max_iterations>
205  : StridedLoopBase,
206  std::conditional_t<(max_iterations != named_usage::unspecified),
207  SizedLoopSpecifyingBase<max_iterations>,
208  UnsizedLoopBase>
209 {};
210 
211 } // namespace iteration_mapping
212 
218 {
220  Owned
221 };
222 
226 using Index_type = std::ptrdiff_t;
227 
232 const int UndefinedValue = -9999999;
233 
237 template<Index_type... Sizes>
238 struct SizeList
239 {};
240 
244 template<typename int_t, int_t numerator, int_t denominator>
245 struct Fraction
246 {
247  static_assert(denominator != int_t(0), "denominator must not be zero");
248 
250 
251  template<typename new_int_t>
252  using rebind =
253  Fraction<new_int_t, new_int_t(numerator), new_int_t(denominator)>;
254 
255  static constexpr int_t multiply(int_t val) noexcept
256  {
257  return (val / denominator) * numerator +
258  (val % denominator) * numerator / denominator;
259  }
260 };
261 
270 #if defined(RAJA_USE_DOUBLE)
272 using Real_type = double;
273 
274 #elif defined(RAJA_USE_FLOAT)
276 using Real_type = float;
277 
278 #else
279 #error RAJA Real_type is undefined!
280 
281 #endif
282 
283 #if defined(RAJA_USE_COMPLEX)
285 using Complex_type = std::complex<Real_type>;
286 #endif
287 
288 /*
289  ******************************************************************************
290  *
291  * The following items include some setup items for definitions that follow.
292  *
293  ******************************************************************************
294  */
295 
296 #if defined(RAJA_COMPILER_ICC)
297 //
298 // alignment attribute supported for versions > 12
299 //
300 #if __ICC >= 1300
301 using TDRAReal_ptr =
302  Real_type* RAJA_RESTRICT __attribute__((align_value(RAJA::DATA_ALIGN)));
303 
304 using const_TDRAReal_ptr = const TDRAReal_ptr;
305 #endif
306 
307 #elif defined(RAJA_COMPILER_GNU)
308 
309 #elif defined(RAJA_COMPILER_CLANG)
310 using TDRAReal_ptr =
311  Real_type* RAJA_RESTRICT __attribute__((aligned(RAJA::DATA_ALIGN)));
312 
313 using const_TDRAReal_ptr = const TDRAReal_ptr;
314 
315 #else
316 
317 using TDRAReal_ptr = Real_type* RAJA_RESTRICT;
318 
320 
321 #endif
322 
323 #if defined(RAJA_USE_PTR_CLASS)
331 class ConstRestrictRealPtr
332 {
333 public:
337 
338  constexpr ConstRestrictRealPtr() : dptr(0) { ; }
339 
340  constexpr ConstRestrictRealPtr(const Real_type* d) : dptr(d) { ; }
341 
342  constexpr ConstRestrictRealPtr& operator=(const Real_type* d)
343  {
344  ConstRestrictRealPtr copy(d);
345  std::swap(dptr, copy.dptr);
346  return *this;
347  }
348 
352 
356  constexpr operator const Real_type*() { return dptr; }
357 
362  constexpr const Real_type* get() const { return dptr; }
363 
367  constexpr const Real_type& operator[](Index_type i) const
368  {
369  return ((const Real_type* RAJA_RESTRICT)dptr)[i];
370  }
371 
375  constexpr const Real_type* operator+(Index_type i) const { return dptr + i; }
376 
377 private:
378  const Real_type* dptr;
379 };
380 
388 class RestrictRealPtr
389 {
390 public:
394 
395  constexpr RestrictRealPtr() : dptr(0) { ; }
396 
397  constexpr RestrictRealPtr(Real_type* d) : dptr(d) { ; }
398 
399  constexpr RestrictRealPtr& operator=(Real_type* d)
400  {
401  RestrictRealPtr copy(d);
402  std::swap(dptr, copy.dptr);
403  return *this;
404  }
405 
409 
413  constexpr operator Real_type*() { return dptr; }
414 
418  constexpr operator const Real_type*() const { return dptr; }
419 
424  constexpr Real_type* get() { return dptr; }
425 
430  constexpr const Real_type* get() const { return dptr; }
431 
436  constexpr operator ConstRestrictRealPtr()
437  {
438  return ConstRestrictRealPtr(dptr);
439  }
440 
444  constexpr Real_type& operator[](Index_type i)
445  {
446  return ((Real_type * RAJA_RESTRICT) dptr)[i];
447  }
448 
452  constexpr Real_type* operator+(Index_type i) { return dptr + i; }
453 
457  constexpr const Real_type* operator+(Index_type i) const { return dptr + i; }
458 
459 private:
460  Real_type* dptr;
461 };
462 
470 class ConstRestrictAlignedRealPtr
471 {
472 public:
476 
477  constexpr ConstRestrictAlignedRealPtr() : dptr(0) { ; }
478 
479  constexpr ConstRestrictAlignedRealPtr(const Real_type* d) : dptr(d) { ; }
480 
481  constexpr ConstRestrictAlignedRealPtr& operator=(const Real_type* d)
482  {
483  ConstRestrictAlignedRealPtr copy(d);
484  std::swap(dptr, copy.dptr);
485  return *this;
486  }
487 
491 
495  constexpr operator const Real_type*() { return dptr; }
496 
501  constexpr const Real_type* get() const { return dptr; }
502 
506 
507 #if defined(RAJA_COMPILER_ICC)
509  constexpr const Real_type& operator[](Index_type i) const
510  {
511 #if __ICC < 1300 // use alignment intrinsic
512  RAJA_ALIGN_DATA(dptr);
513  return ((const Real_type* RAJA_RESTRICT)dptr)[i];
514 #else // use alignment attribute
515  return ((const_TDRAReal_ptr)dptr)[i];
516 #endif
517  }
518 
519 #elif defined(RAJA_COMPILER_GNU)
521  constexpr const Real_type& operator[](Index_type i) const
522  {
523 #if 1 // NOTE: alignment instrinsic not available for older GNU compilers
524  return ((const Real_type* RAJA_RESTRICT)RAJA_ALIGN_DATA(dptr))[i];
525 #else
526  return ((const Real_type* RAJA_RESTRICT)dptr)[i];
527 #endif
528  }
529 
530 #elif defined(RAJA_COMPILER_XLC)
531  constexpr const Real_type& operator[](Index_type i) const
532  {
533  RAJA_ALIGN_DATA(dptr);
534  return ((const Real_type* RAJA_RESTRICT)dptr)[i];
535  }
536 
537 #elif defined(RAJA_COMPILER_CLANG)
538  constexpr const Real_type& operator[](Index_type i) const
539  {
540  return ((const_TDRAReal_ptr)dptr)[i];
541  }
542 
543 #else
544 #error RAJA compiler macro is undefined!
545 
546 #endif
547 
551  constexpr const Real_type* operator+(Index_type i) const { return dptr + i; }
552 
553 private:
554  const Real_type* dptr;
555 };
556 
564 class RestrictAlignedRealPtr
565 {
566 public:
570 
571  constexpr RestrictAlignedRealPtr() : dptr(0) { ; }
572 
573  constexpr RestrictAlignedRealPtr(Real_type* d) : dptr(d) { ; }
574 
575  constexpr RestrictAlignedRealPtr& operator=(Real_type* d)
576  {
577  RestrictAlignedRealPtr copy(d);
578  std::swap(dptr, copy.dptr);
579  return *this;
580  }
581 
585 
589  constexpr operator Real_type*() { return dptr; }
590 
594  constexpr operator const Real_type*() const { return dptr; }
595 
600  constexpr Real_type* get() { return dptr; }
601 
606  constexpr const Real_type* get() const { return dptr; }
607 
612  constexpr operator ConstRestrictAlignedRealPtr()
613  {
614  return ConstRestrictAlignedRealPtr(dptr);
615  }
616 
620 
621 #if defined(RAJA_COMPILER_ICC)
623  constexpr Real_type& operator[](Index_type i)
624  {
625 #if __ICC < 1300 // use alignment intrinsic
626  RAJA_ALIGN_DATA(dptr);
627  return ((Real_type * RAJA_RESTRICT) dptr)[i];
628 #else // use alignment attribute
629  return ((TDRAReal_ptr)dptr)[i];
630 #endif
631  }
632 
634  constexpr const Real_type& operator[](Index_type i) const
635  {
636 #if __ICC < 1300 // use alignment intrinsic
637  RAJA_ALIGN_DATA(dptr);
638  return ((Real_type * RAJA_RESTRICT) dptr)[i];
639 #else // use alignment attribute
640  return ((TDRAReal_ptr)dptr)[i];
641 #endif
642  }
643 
644 #elif defined(RAJA_COMPILER_GNU)
646  constexpr Real_type& operator[](Index_type i)
647  {
648 #if 1 // NOTE: alignment instrinsic not available for older GNU compilers
649  return ((Real_type * RAJA_RESTRICT) RAJA_ALIGN_DATA(dptr))[i];
650 #else
651  return ((Real_type * RAJA_RESTRICT) dptr)[i];
652 #endif
653  }
654 
656  constexpr const Real_type& operator[](Index_type i) const
657  {
658 #if 1 // NOTE: alignment instrinsic not available for older GNU compilers
659  return ((Real_type * RAJA_RESTRICT) RAJA_ALIGN_DATA(dptr))[i];
660 #else
661  return ((Real_type * RAJA_RESTRICT) dptr)[i];
662 #endif
663  }
664 
665 #elif defined(RAJA_COMPILER_XLC)
667  constexpr Real_type& operator[](Index_type i)
668  {
669  RAJA_ALIGN_DATA(dptr);
670  return ((Real_type * RAJA_RESTRICT) dptr)[i];
671  }
672 
674  constexpr const Real_type& operator[](Index_type i) const
675  {
676  RAJA_ALIGN_DATA(dptr);
677  return ((Real_type * RAJA_RESTRICT) dptr)[i];
678  }
679 
680 #elif defined(RAJA_COMPILER_CLANG)
682  constexpr Real_type& operator[](Index_type i)
683  {
684  return ((TDRAReal_ptr)dptr)[i];
685  }
686 
688  const Real_type& operator[](Index_type i) const
689  {
690  return ((TDRAReal_ptr)dptr)[i];
691  }
692 
693 #else
694 #error RAJA compiler macro is undefined!
695 
696 #endif
697 
701  constexpr Real_type* operator+(Index_type i) { return dptr + i; }
702 
706  constexpr const Real_type* operator+(Index_type i) const { return dptr + i; }
707 
708 private:
709  Real_type* dptr;
710 };
711 
712 #if defined(RAJA_USE_COMPLEX)
720 class ConstRestrictComplexPtr
721 {
722 public:
726 
727  constexpr ConstRestrictComplexPtr() : dptr(0) { ; }
728 
729  constexpr ConstRestrictComplexPtr(const Complex_type* d) : dptr(d) { ; }
730 
731  constexpr ConstRestrictComplexPtr& operator=(const Complex_type* d)
732  {
733  ConstRestrictComplexPtr copy(d);
734  std::swap(dptr, copy.dptr);
735  return *this;
736  }
737 
741 
745  constexpr operator const Complex_type*() const { return dptr; }
746 
751  constexpr const Complex_type* get() const { return dptr; }
752 
756  constexpr const Complex_type& operator[](Index_type i) const
757  {
758  return ((const Complex_type* RAJA_RESTRICT)dptr)[i];
759  }
760 
764  constexpr const Complex_type* operator+(Index_type i) const
765  {
766  return dptr + i;
767  }
768 
769 private:
770  const Complex_type* dptr;
771 };
772 
780 class RestrictComplexPtr
781 {
782 public:
786 
787  constexpr RestrictComplexPtr() : dptr(0) { ; }
788 
789  constexpr RestrictComplexPtr(Complex_type* d) : dptr(d) { ; }
790 
791  constexpr RestrictComplexPtr& operator=(Complex_type* d)
792  {
793  RestrictComplexPtr copy(d);
794  std::swap(dptr, copy.dptr);
795  return *this;
796  }
797 
801 
805  constexpr operator Complex_type*() { return dptr; }
806 
810  constexpr operator const Complex_type*() const { return dptr; }
811 
816  constexpr Complex_type* get() { return dptr; }
817 
822  constexpr const Complex_type* get() const { return dptr; }
823 
828  constexpr operator ConstRestrictComplexPtr()
829  {
830  return ConstRestrictComplexPtr(dptr);
831  }
832 
836  constexpr Complex_type& operator[](Index_type i)
837  {
838  return ((Complex_type * RAJA_RESTRICT) dptr)[i];
839  }
840 
844  constexpr const Complex_type& operator[](Index_type i) const
845  {
846  return ((Complex_type * RAJA_RESTRICT) dptr)[i];
847  }
848 
852  constexpr Complex_type* operator+(Index_type i) { return dptr + i; }
853 
857  constexpr const Complex_type* operator+(Index_type i) const
858  {
859  return dptr + i;
860  }
861 
862 private:
863  Complex_type* dptr;
864 };
865 #endif // defined(RAJA_USE_COMPLEX)
866 
867 #endif // defined(RAJA_USE_PTR_CLASS)
868 
869 /*
870  ******************************************************************************
871  *
872  * Finally, we define data pointer types based on definitions above and
873  * -D value given at compile time.
874  *
875  ******************************************************************************
876  */
877 #if defined(RAJA_USE_BARE_PTR)
878 using Real_ptr = Real_type*;
879 using const_Real_ptr = const Real_type*;
880 
881 #if defined(RAJA_USE_COMPLEX)
882 using Complex_ptr = Complex_type*;
883 using const_Complex_ptr = const Complex_type*;
884 #endif
885 
886 using UnalignedReal_ptr = Real_type*;
887 using const_UnalignedReal_ptr = const Real_type*;
888 
889 #elif defined(RAJA_USE_RESTRICT_PTR)
890 using Real_ptr = Real_type* RAJA_RESTRICT;
891 using const_Real_ptr = const Real_type* RAJA_RESTRICT;
892 
893 #if defined(RAJA_USE_COMPLEX)
894 using Complex_ptr = Complex_type* RAJA_RESTRICT;
895 using const_Complex_ptr = const Complex_type* RAJA_RESTRICT;
896 #endif
897 
898 using UnalignedReal_ptr = Real_type* RAJA_RESTRICT;
899 using const_UnalignedReal_ptr = const Real_type* RAJA_RESTRICT;
900 
901 #elif defined(RAJA_USE_RESTRICT_ALIGNED_PTR)
902 using Real_ptr = TDRAReal_ptr;
903 using const_Real_ptr = const_TDRAReal_ptr;
904 
905 #if defined(RAJA_USE_COMPLEX)
906 using Complex_ptr = Complex_type* RAJA_RESTRICT;
907 using const_Complex_ptr = const Complex_type* RAJA_RESTRICT;
908 #endif
909 
910 using UnalignedReal_ptr = Real_type* RAJA_RESTRICT;
911 using const_UnalignedReal_ptr = const Real_type* RAJA_RESTRICT;
912 
913 #elif defined(RAJA_USE_PTR_CLASS)
914 using Real_ptr = RestrictAlignedRealPtr;
915 using const_Real_ptr = ConstRestrictAlignedRealPtr;
916 
917 #if defined(RAJA_USE_COMPLEX)
918 using Complex_ptr = RestrictComplexPtr;
919 using const_Complex_ptr = ConstRestrictComplexPtr;
920 #endif
921 
922 using UnalignedReal_ptr = RestrictRealPtr;
923 using const_UnalignedReal_ptr = ConstRestrictRealPtr;
924 
925 #else
926 #error RAJA pointer type is undefined!
927 
928 #endif
929 
930 
931 namespace detail
932 {
933 
938 {
939  template<typename T>
940  static RAJA_HOST_DEVICE RAJA_INLINE constexpr T get(T* ptr, size_t i)
941  {
942  return ptr[i];
943  }
944 
945  template<typename T>
946  static RAJA_HOST_DEVICE RAJA_INLINE constexpr void set(T* ptr,
947  size_t i,
948  T val)
949  {
950  ptr[i] = val;
951  }
952 };
953 
958 template<typename T,
959  size_t min_integer_type_size = 1,
960  size_t max_integer_type_size = sizeof(unsigned long long)>
962 {
963  static_assert(min_integer_type_size <= max_integer_type_size,
964  "incompatible min and max integer type size");
965  using integer_type = std::conditional_t<
966  ((alignof(T) >= alignof(unsigned long long) &&
967  sizeof(unsigned long long) <= max_integer_type_size) ||
968  sizeof(unsigned long) < min_integer_type_size),
969  unsigned long long,
970  std::conditional_t<
971  ((alignof(T) >= alignof(unsigned long) &&
972  sizeof(unsigned long) <= max_integer_type_size) ||
973  sizeof(unsigned int) < min_integer_type_size),
974  unsigned long,
975  std::conditional_t<
976  ((alignof(T) >= alignof(unsigned int) &&
977  sizeof(unsigned int) <= max_integer_type_size) ||
978  sizeof(unsigned short) < min_integer_type_size),
979  unsigned int,
980  std::conditional_t<
981  ((alignof(T) >= alignof(unsigned short) &&
982  sizeof(unsigned short) <= max_integer_type_size) ||
983  sizeof(unsigned char) < min_integer_type_size),
984  unsigned short,
985  std::conditional_t<((alignof(T) >= alignof(unsigned char) &&
986  sizeof(unsigned char) <=
987  max_integer_type_size)),
988  unsigned char,
989  void>>>>>;
990  static_assert(!std::is_same<integer_type, void>::value,
991  "could not find a compatible integer type");
992  static_assert(sizeof(integer_type) >= min_integer_type_size,
993  "integer_type smaller than min integer type size");
994  static_assert(sizeof(integer_type) <= max_integer_type_size,
995  "integer_type greater than max integer type size");
996 
997  static constexpr size_t num_integer_type =
998  (sizeof(T) + sizeof(integer_type) - 1) / sizeof(integer_type);
999 
1000  integer_type array[num_integer_type] = {0};
1001 
1002  AsIntegerArray() = default;
1003 
1004  RAJA_HOST_DEVICE constexpr size_t array_size() const
1005  {
1006  return num_integer_type;
1007  }
1008 
1010  {
1011  T value;
1012  memcpy(&value, &array[0], sizeof(T));
1013  return value;
1014  }
1015 
1017  {
1018  memcpy(&array[0], &value, sizeof(T));
1019  }
1020 };
1021 
1026 template<typename T>
1028 {
1029  constexpr ScopedAssignment(T& val, T const& new_val)
1030  : m_ref_to_val(val),
1031  m_prev_val(std::move(val))
1032  {
1033  m_ref_to_val = new_val;
1034  }
1035 
1036  constexpr ScopedAssignment(T& val, T&& new_val)
1037  : m_ref_to_val(val),
1038  m_prev_val(std::move(val))
1039  {
1040  m_ref_to_val = std::move(new_val);
1041  }
1042 
1047 
1048  // constexpr in c++20
1049  ~ScopedAssignment() { m_ref_to_val = std::move(m_prev_val); }
1050 
1051 private:
1052  T& m_ref_to_val;
1053  T m_prev_val;
1054 };
1055 
1056 } // namespace detail
1057 
1058 } // namespace RAJA
1059 
1060 #endif // closing endif for header file include guard
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
RAJA_INLINE RAJA_HOST_DEVICE auto operator+(LEFT_OPERAND const &left, RIGHT_OPERAND const &right) -> TensorAdd< typename NormalizeOperandHelper< LEFT_OPERAND >::return_type, RIGHT_OPERAND >
Definition: BinaryOperator.hpp:122
Definition: AlignedRangeIndexSetBuilders.cpp:35
IndexOwnership
Definition: types.hpp:218
@ Owned
Definition: types.hpp:220
@ Unowned
Definition: types.hpp:219
named_dim
Definition: types.hpp:53
const int UndefinedValue
Definition: types.hpp:232
std::ptrdiff_t Index_type
Definition: types.hpp:226
RAJA_HOST_DEVICE constexpr RAJA_INLINE RAJA::zip_tuple_element_t< I, zip_tuple< is_val, Ts... > > & get(zip_tuple< is_val, Ts... > &z) noexcept
Definition: zip_tuple.hpp:56
kernel_sync_requirement
Definition: types.hpp:63
named_usage
Definition: types.hpp:44
@ ignored
Definition: types.hpp:45
@ unspecified
Definition: types.hpp:46
const TDRAReal_ptr const_TDRAReal_ptr
Definition: types.hpp:319
Real_type *RAJA_RESTRICT TDRAReal_ptr
RAJA scalar type definitions.
Definition: types.hpp:317
Definition: ListSegment.hpp:416
RAJA_INLINE void swap(RAJA::TypedListSegment< StorageT > &a, RAJA::TypedListSegment< StorageT > &b)
Specialization of std::swap for TypedListSegment.
Definition: ListSegment.hpp:420
Definition: types.hpp:246
static constexpr int_t multiply(int_t val) noexcept
Definition: types.hpp:255
Definition: types.hpp:239
Abstracts T into an equal or greater size array of integers whose size is between min_integer_type_si...
Definition: types.hpp:962
RAJA_HOST_DEVICE T get_value() const
Definition: types.hpp:1009
std::conditional_t<((alignof(T) >=alignof(unsigned long long) &&sizeof(unsigned long long)<=max_integer_type_size)||sizeof(unsigned long)< min_integer_type_size), unsigned long long, std::conditional_t<((alignof(T) >=alignof(unsigned long) &&sizeof(unsigned long)<=max_integer_type_size)||sizeof(unsigned int)< min_integer_type_size), unsigned long, std::conditional_t<((alignof(T) >=alignof(unsigned int) &&sizeof(unsigned int)<=max_integer_type_size)||sizeof(unsigned short)< min_integer_type_size), unsigned int, std::conditional_t<((alignof(T) >=alignof(unsigned short) &&sizeof(unsigned short)<=max_integer_type_size)||sizeof(unsigned char)< min_integer_type_size), unsigned short, std::conditional_t<((alignof(T) >=alignof(unsigned char) &&sizeof(unsigned char)<=max_integer_type_size)), unsigned char, void > >> >> integer_type
Definition: types.hpp:989
RAJA_HOST_DEVICE void set_value(T value)
Definition: types.hpp:1016
constexpr RAJA_HOST_DEVICE size_t array_size() const
Definition: types.hpp:1004
Abstracts access to memory using normal memory accesses.
Definition: types.hpp:938
static RAJA_HOST_DEVICE constexpr RAJA_INLINE T get(T *ptr, size_t i)
Definition: types.hpp:940
static RAJA_HOST_DEVICE constexpr RAJA_INLINE void set(T *ptr, size_t i, T val)
Definition: types.hpp:946
Assign a new value to an object and restore the object's previous value at the end of the current sco...
Definition: types.hpp:1028
~ScopedAssignment()
Definition: types.hpp:1049
constexpr ScopedAssignment(T &val, T const &new_val)
Definition: types.hpp:1029
ScopedAssignment(ScopedAssignment const &)=delete
constexpr ScopedAssignment(T &val, T &&new_val)
Definition: types.hpp:1036
ScopedAssignment(ScopedAssignment &&)=delete
ScopedAssignment & operator=(ScopedAssignment &&)=delete
ScopedAssignment & operator=(ScopedAssignment const &)=delete
Definition: types.hpp:78
Definition: types.hpp:143
Definition: types.hpp:81
static constexpr size_t max_iterations
Definition: types.hpp:98
Definition: types.hpp:209