RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Operators.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_operators_HPP
23 #define RAJA_operators_HPP
24 
25 #include "RAJA/config.hpp"
26 
27 #include <stdint.h>
28 #include <cfloat>
29 #include <cstdint>
30 #include <ostream>
31 #include <type_traits>
32 #if defined(RAJA_CHECK_LIMITS)
33 #include <limits>
34 #endif
35 
36 #include "RAJA/util/concepts.hpp"
37 #include "RAJA/util/macros.hpp"
38 
39 namespace RAJA
40 {
41 
42 namespace operators
43 {
44 
45 namespace detail
46 {
47 
48 // truly associative (does not include fp add/multiply)
50 {};
51 
52 // associative up to floating point rounding differences
54 {};
55 
56 // get associativity tag appropriate for the type
57 template<typename T>
59  std::conditional_t<std::is_floating_point<std::decay_t<T>>::value,
62 
63 template<typename Arg1, typename Arg2, typename Result>
65 {
66  using first_argument_type = Arg1;
67  using second_argument_type = Arg2;
68  using result_type = Result;
69 };
70 
71 template<typename Argument, typename Result>
73 {
74  using argument_type = Argument;
75  using result_type = Result;
76 };
77 
78 template<typename Arg1, typename Arg2>
79 struct comparison_function : public binary_function<Arg1, Arg2, bool>
80 {};
81 
82 } // namespace detail
83 
84 namespace types
85 {
86 
87 template<typename T>
89 {
90  static constexpr const bool value =
91  std::is_unsigned<T>::value && std::is_integral<T>::value;
92 };
93 
94 template<typename T>
96 {
97  static constexpr const bool value =
98  !std::is_unsigned<T>::value && std::is_integral<T>::value;
99 };
100 
101 // given a type, T, return a similar type whose size is >= sizeof(T)
106 template<typename T, bool GPU = false>
107 struct larger
108 {};
109 
110 template<>
111 struct larger<uint8_t>
112 {
113  using type = uint16_t;
114 };
115 
116 template<>
117 struct larger<uint16_t>
118 {
119  using type = uint32_t;
120 };
121 
122 template<>
123 struct larger<uint32_t>
124 {
125  using type = uint64_t;
126 };
127 
128 template<>
129 struct larger<int8_t>
130 {
131  using type = int16_t;
132 };
133 
134 template<>
135 struct larger<int16_t>
136 {
137  using type = int32_t;
138 };
139 
140 template<>
141 struct larger<int32_t>
142 {
143  using type = int64_t;
144 };
145 
146 template<>
147 struct larger<float>
148 {
149  using type = double;
150 };
151 
152 template<>
153 struct larger<double>
154 {
155  using type = long double;
156 };
157 
158 template<>
159 struct larger<double, true>
160 {
161  using type = double;
162 };
163 
164 namespace detail
165 {
166 
167 template<typename T, bool isInt, bool isSigned, bool isFP, bool gpu = false>
168 struct largest
169 {};
170 
171 template<typename T>
172 struct largest<T, true, false, false>
173 {
174  using type = uint64_t;
175 };
176 
177 template<typename T>
178 struct largest<T, true, true, false>
179 {
180  using type = int64_t;
181 };
182 
183 template<typename T>
184 struct largest<T, false, false, true, false>
185 {
186  using type = long double;
187 };
188 
189 template<typename T>
190 struct largest<T, false, false, true, true>
191 {
192  using type = double;
193 };
194 } // namespace detail
195 
200 template<typename T, bool gpu = false>
201 struct largest
202 {
203  using type = typename detail::largest<T,
204  std::is_integral<T>::value,
205  std::is_signed<T>::value,
206  std::is_floating_point<T>::value,
207  gpu>::type;
208 };
209 
210 template<typename T>
211 struct size_of
212 {
213  enum
214  {
215  value = sizeof(T)
216  };
217 };
218 
219 namespace detail
220 {
221 
222 template<typename T, typename U, bool lhsLarger>
223 struct larger_of
224 {};
225 
226 template<typename T, typename U>
227 struct larger_of<T, U, true>
228 {
229  using type = T;
230 };
231 
232 template<typename T, typename U>
233 struct larger_of<T, U, false>
234 {
235  using type = U;
236 };
237 } // namespace detail
238 
239 template<typename T, typename U>
240 struct larger_of
241 {
242  using type = typename detail::
243  larger_of<T, U, (size_of<T>::value > size_of<U>::value)>::type;
244 };
245 
246 } // namespace types
247 
248 
249 template<typename T, typename Enable = void>
250 struct limits;
251 
252 // limits for signed integer types
253 template<typename T>
254 struct limits<T,
255  typename std::enable_if<std::is_integral<T>::value &&
256  !std::is_unsigned<T>::value>::type>
257 {
258  RAJA_INLINE RAJA_HOST_DEVICE static constexpr T min()
259  {
260 #ifdef RAJA_COMPILER_MSVC
261 #pragma warning(disable : 4309)
262 #endif
263  return static_cast<T>(1llu << ((8llu * sizeof(T)) - 1llu));
264 #ifdef RAJA_COMPILER_MSVC
265 #pragma warning(default : 4309)
266 #endif
267  }
268 
269  RAJA_INLINE RAJA_HOST_DEVICE static constexpr T max()
270  {
271 #ifdef RAJA_COMPILER_MSVC
272 #pragma warning(disable : 4309)
273 #endif
274  return static_cast<T>(~(1llu << ((8llu * sizeof(T)) - 1llu)));
275 #ifdef RAJA_COMPILER_MSVC
276 #pragma warning(default : 4309)
277 #endif
278  }
279 };
280 
281 // limits for signed integer types
282 template<typename T>
283 struct limits<T,
284  typename std::enable_if<std::is_integral<T>::value &&
285  std::is_unsigned<T>::value>::type>
286 {
287  RAJA_INLINE RAJA_HOST_DEVICE static constexpr T min()
288  {
289  return static_cast<T>(0);
290  }
291 
292  RAJA_INLINE RAJA_HOST_DEVICE static constexpr T max()
293  {
294 #ifdef RAJA_COMPILER_MSVC
295 #pragma warning(disable : 4309)
296 #endif
297  return static_cast<T>(0xFFFFFFFFFFFFFFFF);
298 #ifdef RAJA_COMPILER_MSVC
299 #pragma warning(default : 4309)
300 #endif
301  }
302 };
303 
304 template<>
305 struct limits<float>
306 {
307  RAJA_INLINE RAJA_HOST_DEVICE static constexpr float min() { return -FLT_MAX; }
308 
309  RAJA_INLINE RAJA_HOST_DEVICE static constexpr float max() { return FLT_MAX; }
310 };
311 
312 template<>
313 struct limits<double>
314 {
315  RAJA_INLINE RAJA_HOST_DEVICE static constexpr double min()
316  {
317  return -DBL_MAX;
318  }
319 
320  RAJA_INLINE RAJA_HOST_DEVICE static constexpr double max() { return DBL_MAX; }
321 };
322 
323 template<>
324 struct limits<long double>
325 {
326  RAJA_INLINE RAJA_HOST_DEVICE static constexpr long double min()
327  {
328  return -LDBL_MAX;
329  }
330 
331  RAJA_INLINE RAJA_HOST_DEVICE static constexpr long double max()
332  {
333  return LDBL_MAX;
334  }
335 };
336 
337 
338 #if defined(RAJA_CHECK_LIMITS)
339 template<typename T>
340 constexpr bool check()
341 {
344 }
345 
346 static_assert(check<char>(), "limits for char is broken");
347 static_assert(check<unsigned char>(), "limits for unsigned char is broken");
348 static_assert(check<short>(), "limits for short is broken");
349 static_assert(check<unsigned short>(), "limits for unsigned short is broken");
350 static_assert(check<int>(), "limits for int is broken");
351 static_assert(check<unsigned int>(), "limits for unsigned int is broken");
352 static_assert(check<long>(), "limits for long is broken");
353 static_assert(check<unsigned long>(), "limits for unsigned long is broken");
354 static_assert(check<long int>(), "limits for long int is broken");
355 static_assert(check<unsigned long int>(),
356  "limits for unsigned long int is broken");
357 static_assert(check<long long>(), "limits for long long is broken");
358 static_assert(check<unsigned long long>(),
359  "limits for unsigned long long is broken");
360 #endif
361 
362 // Arithmetic
363 
364 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
365 struct plus : public detail::binary_function<Arg1, Arg2, Ret>,
367 {
368  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
369  const Arg2& rhs) const
370  {
371  return Ret {lhs} + rhs;
372  }
373 
374  RAJA_HOST_DEVICE static constexpr Ret identity() { return Ret {0}; }
375 
376  friend inline std::ostream& operator<<(std::ostream& str, plus const&)
377  {
378  return str << "RAJA::operators::plus{}";
379  }
380 };
381 
382 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
383 struct minus : public detail::binary_function<Arg1, Arg2, Ret>
384 {
385  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
386  const Arg2& rhs) const
387  {
388  return Ret {lhs} - rhs;
389  }
390 
391  friend inline std::ostream& operator<<(std::ostream& str, minus const&)
392  {
393  return str << "RAJA::operators::minus{}";
394  }
395 };
396 
397 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
398 struct multiplies : public detail::binary_function<Arg1, Arg2, Ret>,
400 {
401 
402  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
403  const Arg2& rhs) const
404  {
405  return Ret {lhs} * rhs;
406  }
407 
408  RAJA_HOST_DEVICE static constexpr Ret identity() { return Ret {1}; }
409 
410  friend inline std::ostream& operator<<(std::ostream& str, multiplies const&)
411  {
412  return str << "RAJA::operators::multiplies{}";
413  }
414 };
415 
416 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
417 struct divides : public detail::binary_function<Arg1, Arg2, Ret>
418 {
419  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
420  const Arg2& rhs) const
421  {
422  return Ret {lhs} / rhs;
423  }
424 
425  friend inline std::ostream& operator<<(std::ostream& str, divides const&)
426  {
427  return str << "RAJA::operators::divides{}";
428  }
429 };
430 
431 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
432 struct modulus : public detail::binary_function<Arg1, Arg2, Ret>
433 {
434  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
435  const Arg2& rhs) const
436  {
437  return Ret {lhs} % rhs;
438  }
439 
440  friend inline std::ostream& operator<<(std::ostream& str, modulus const&)
441  {
442  return str << "RAJA::operators::modulus{}";
443  }
444 };
445 
446 // Conditions
447 
448 template<typename Arg1, typename Arg2 = Arg1>
449 struct logical_and : public detail::comparison_function<Arg1, Arg2>,
451 {
452  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
453  const Arg2& rhs) const
454  {
455  return lhs && rhs;
456  }
457 
458  RAJA_HOST_DEVICE static constexpr bool identity() { return true; }
459 
460  friend inline std::ostream& operator<<(std::ostream& str, logical_and const&)
461  {
462  return str << "RAJA::operators::logical_and{}";
463  }
464 };
465 
466 template<typename Arg1, typename Arg2 = Arg1>
467 struct logical_or : public detail::comparison_function<Arg1, Arg2>,
469 {
470  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
471  const Arg2& rhs) const
472  {
473  return lhs || rhs;
474  }
475 
476  RAJA_HOST_DEVICE static constexpr bool identity() { return false; }
477 
478  friend inline std::ostream& operator<<(std::ostream& str, logical_or const&)
479  {
480  return str << "RAJA::operators::logical_or{}";
481  }
482 };
483 
484 template<typename T>
485 struct logical_not : public detail::unary_function<T, bool>
486 {
487  RAJA_HOST_DEVICE constexpr bool operator()(const T& lhs) const
488  {
489  return !lhs;
490  }
491 
492  friend inline std::ostream& operator<<(std::ostream& str, logical_not const&)
493  {
494  return str << "RAJA::operators::logical_not{}";
495  }
496 };
497 
498 // Bitwise
499 
500 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
501 struct bit_or : public detail::binary_function<Arg1, Arg2, Ret>
502 {
503  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
504  const Arg2& rhs) const
505  {
506  return lhs | rhs;
507  }
508 
509  RAJA_HOST_DEVICE static constexpr Ret identity() { return Ret {0}; }
510 
511  friend inline std::ostream& operator<<(std::ostream& str, bit_or const&)
512  {
513  return str << "RAJA::operators::bit_or{}";
514  }
515 };
516 
517 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
518 struct bit_and : public detail::binary_function<Arg1, Arg2, Ret>
519 {
520  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
521  const Arg2& rhs) const
522  {
523  return lhs & rhs;
524  }
525 
526  RAJA_HOST_DEVICE static constexpr Ret identity() { return ~Ret {0}; }
527 
528  friend inline std::ostream& operator<<(std::ostream& str, bit_and const&)
529  {
530  return str << "RAJA::operators::bit_and{}";
531  }
532 };
533 
534 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
535 struct bit_xor : public detail::binary_function<Arg1, Arg2, Ret>
536 {
537  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
538  const Arg2& rhs) const
539  {
540  return lhs ^ rhs;
541  }
542 
543  friend inline std::ostream& operator<<(std::ostream& str, bit_xor const&)
544  {
545  return str << "RAJA::operators::bit_xor{}";
546  }
547 };
548 
549 // comparison
556 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
557 struct minimum : public detail::binary_function<Arg1, Arg2, Ret>,
559 {
560  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
561  const Arg2& rhs) const
562  {
563  return (rhs < lhs) ? rhs : lhs;
564  }
565 
566  RAJA_HOST_DEVICE static constexpr Ret identity()
567  {
568  return limits<Ret>::max();
569  }
570 
571  friend inline std::ostream& operator<<(std::ostream& str, minimum const&)
572  {
573  return str << "RAJA::operators::minimum{}";
574  }
575 };
576 
577 template<typename Ret, typename Arg1 = Ret, typename Arg2 = Arg1>
578 struct maximum : public detail::binary_function<Arg1, Arg2, Ret>,
580 {
581  RAJA_HOST_DEVICE constexpr Ret operator()(const Arg1& lhs,
582  const Arg2& rhs) const
583  {
584  return (lhs < rhs) ? rhs : lhs;
585  }
586 
587  RAJA_HOST_DEVICE static constexpr Ret identity()
588  {
589  return limits<Ret>::min();
590  }
591 
592  friend inline std::ostream& operator<<(std::ostream& str, maximum const&)
593  {
594  return str << "RAJA::operators::maximum{}";
595  }
596 };
597 
598 // Logical Comparison
599 
600 template<typename Arg1, typename Arg2 = Arg1>
601 struct equal_to : public detail::comparison_function<Arg1, Arg2>
602 {
603  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
604  const Arg2& rhs) const
605  {
606  return lhs == rhs;
607  }
608 
609  friend inline std::ostream& operator<<(std::ostream& str, equal_to const&)
610  {
611  return str << "RAJA::operators::equal_to{}";
612  }
613 };
614 
615 template<typename Arg1, typename Arg2 = Arg1>
616 struct not_equal_to : public detail::comparison_function<Arg1, Arg2>
617 {
618  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
619  const Arg2& rhs) const
620  {
621  return lhs != rhs;
622  }
623 
624  friend inline std::ostream& operator<<(std::ostream& str, not_equal_to const&)
625  {
626  return str << "RAJA::operators::not_equal_to{}";
627  }
628 };
629 
630 template<typename Arg1, typename Arg2 = Arg1>
631 struct greater : public detail::comparison_function<Arg1, Arg2>
632 {
633  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
634  const Arg2& rhs) const
635  {
636  return lhs > rhs;
637  }
638 
639  friend inline std::ostream& operator<<(std::ostream& str, greater const&)
640  {
641  return str << "RAJA::operators::greater{}";
642  }
643 };
644 
645 template<typename Arg1, typename Arg2 = Arg1>
646 struct less : public detail::comparison_function<Arg1, Arg2>
647 {
648  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
649  const Arg2& rhs) const
650  {
651  return lhs < rhs;
652  }
653 
654  friend inline std::ostream& operator<<(std::ostream& str, less const&)
655  {
656  return str << "RAJA::operators::less{}";
657  }
658 };
659 
660 template<typename Arg1, typename Arg2 = Arg1>
661 struct greater_equal : public detail::comparison_function<Arg1, Arg2>
662 {
663  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
664  const Arg2& rhs) const
665  {
666  return lhs >= rhs;
667  }
668 
669  friend inline std::ostream& operator<<(std::ostream& str,
670  greater_equal const&)
671  {
672  return str << "RAJA::operators::greater_equal{}";
673  }
674 };
675 
676 template<typename Arg1, typename Arg2 = Arg1>
677 struct less_equal : public detail::comparison_function<Arg1, Arg2>
678 {
679  RAJA_HOST_DEVICE constexpr bool operator()(const Arg1& lhs,
680  const Arg2& rhs) const
681  {
682  return lhs <= rhs;
683  }
684 
685  friend inline std::ostream& operator<<(std::ostream& str, less_equal const&)
686  {
687  return str << "RAJA::operators::less_equal{}";
688  }
689 };
690 
691 // Filters
692 
693 template<typename Ret, typename Orig = Ret>
694 struct identity : public detail::unary_function<Orig, Ret>
695 {
696  RAJA_HOST_DEVICE constexpr Ret operator()(const Orig& lhs) const
697  {
698  return lhs;
699  }
700 
701  friend inline std::ostream& operator<<(std::ostream& str, identity const&)
702  {
703  return str << "RAJA::operators::identity{}";
704  }
705 };
706 
707 template<typename T, typename U>
708 struct project1st : public detail::binary_function<T, U, T>
709 {
710  RAJA_HOST_DEVICE constexpr T operator()(const T& lhs,
711  const U& RAJA_UNUSED_ARG(rhs)) const
712  {
713  return lhs;
714  }
715 
716  friend inline std::ostream& operator<<(std::ostream& str, project1st const&)
717  {
718  return str << "RAJA::operators::project1st{}";
719  }
720 };
721 
722 template<typename T, typename U = T>
723 struct project2nd : public detail::binary_function<T, U, U>
724 {
725  RAJA_HOST_DEVICE constexpr U operator()(const T& RAJA_UNUSED_ARG(lhs),
726  const U& rhs) const
727  {
728  return rhs;
729  }
730 
731  friend inline std::ostream& operator<<(std::ostream& str, project2nd const&)
732  {
733  return str << "RAJA::operators::project2nd{}";
734  }
735 };
736 
737 // Type Traits
738 
739 template<typename T>
741 {
742  static constexpr const bool value =
743  std::is_base_of<detail::associative_tag, T>::value;
744 };
745 
746 template<typename T>
748 {
749  static constexpr const bool value =
750  std::is_base_of<detail::fp_associative_tag, T>::value;
751 };
752 
753 template<typename Arg1, typename Arg2 = Arg1>
754 struct safe_plus
755  : public plus<Arg1,
756  Arg2,
757  typename types::larger<
758  typename types::larger_of<Arg1, Arg2>::type>::type>
759 {
760  friend inline std::ostream& operator<<(std::ostream& str, safe_plus const&)
761  {
762  return str << "RAJA::operators::safe_plus{}";
763  }
764 };
765 
766 } // namespace operators
767 
768 namespace concepts
769 {
770 
771 template<typename Function,
772  typename Return,
773  typename Arg1 = Return,
774  typename Arg2 = Arg1>
776  : DefineConcept(::RAJA::concepts::convertible_to<Return>(
777  camp::val<Function>()(camp::val<Arg1>(), camp::val<Arg2>()))) {};
778 
779 template<typename Function, typename Return, typename Arg = Return>
780 struct UnaryFunction : DefineConcept(::RAJA::concepts::convertible_to<Return>(
781  camp::val<Function>()(camp::val<Arg>()))) {};
782 
783 namespace detail
784 {
785 
786 template<typename Fun, typename Ret, typename T, typename U>
788  ::RAJA::concepts::requires_<BinaryFunction, Ret, T, U>;
789 
790 template<typename Fun, typename Ret, typename T>
791 using is_unary_function = ::RAJA::concepts::requires_<UnaryFunction, Ret, T>;
792 } // namespace detail
793 
794 } // namespace concepts
795 
796 namespace type_traits
797 {
800 } // namespace type_traits
801 
802 
803 } // namespace RAJA
804 
805 #endif // closing endif for header file include guard
Header file for RAJA concept definitions.
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
#define RAJA_UNUSED_ARG(x)
Definition: macros.hpp:97
::RAJA::concepts::requires_< UnaryFunction, Ret, T > is_unary_function
Definition: Operators.hpp:791
::RAJA::concepts::requires_< BinaryFunction, Ret, T, U > is_binary_function
Definition: Operators.hpp:788
std::conditional_t< std::is_floating_point< std::decay_t< T > >::value, fp_associative_tag, associative_tag > associative_or_fp_associative_tag
Definition: Operators.hpp:61
DefineTypeTraitFromConcept(is_range_constructible, RAJA::concepts::RangeConstructible)
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
Definition: ListSegment.hpp:416
Definition: Operators.hpp:777
Definition: Operators.hpp:781
Definition: Operators.hpp:519
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:520
friend std::ostream & operator<<(std::ostream &str, bit_and const &)
Definition: Operators.hpp:528
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:526
Definition: Operators.hpp:502
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:509
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:503
friend std::ostream & operator<<(std::ostream &str, bit_or const &)
Definition: Operators.hpp:511
Definition: Operators.hpp:536
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:537
friend std::ostream & operator<<(std::ostream &str, bit_xor const &)
Definition: Operators.hpp:543
Definition: Operators.hpp:50
Definition: Operators.hpp:65
Arg2 second_argument_type
Definition: Operators.hpp:67
Arg1 first_argument_type
Definition: Operators.hpp:66
Result result_type
Definition: Operators.hpp:68
Definition: Operators.hpp:73
Argument argument_type
Definition: Operators.hpp:74
Result result_type
Definition: Operators.hpp:75
Definition: Operators.hpp:418
friend std::ostream & operator<<(std::ostream &str, divides const &)
Definition: Operators.hpp:425
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:419
Definition: Operators.hpp:602
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:603
friend std::ostream & operator<<(std::ostream &str, equal_to const &)
Definition: Operators.hpp:609
Definition: Operators.hpp:662
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:663
friend std::ostream & operator<<(std::ostream &str, greater_equal const &)
Definition: Operators.hpp:669
Definition: Operators.hpp:632
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:633
friend std::ostream & operator<<(std::ostream &str, greater const &)
Definition: Operators.hpp:639
Definition: Operators.hpp:695
friend std::ostream & operator<<(std::ostream &str, identity const &)
Definition: Operators.hpp:701
constexpr RAJA_HOST_DEVICE Ret operator()(const Orig &lhs) const
Definition: Operators.hpp:696
Definition: Operators.hpp:741
static constexpr const bool value
Definition: Operators.hpp:742
Definition: Operators.hpp:748
static constexpr const bool value
Definition: Operators.hpp:749
Definition: Operators.hpp:678
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:679
friend std::ostream & operator<<(std::ostream &str, less_equal const &)
Definition: Operators.hpp:685
Definition: Operators.hpp:647
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:648
friend std::ostream & operator<<(std::ostream &str, less const &)
Definition: Operators.hpp:654
RAJA_INLINE static constexpr RAJA_HOST_DEVICE double max()
Definition: Operators.hpp:320
RAJA_INLINE static constexpr RAJA_HOST_DEVICE double min()
Definition: Operators.hpp:315
RAJA_INLINE static constexpr RAJA_HOST_DEVICE float max()
Definition: Operators.hpp:309
RAJA_INLINE static constexpr RAJA_HOST_DEVICE float min()
Definition: Operators.hpp:307
RAJA_INLINE static constexpr RAJA_HOST_DEVICE long double max()
Definition: Operators.hpp:331
RAJA_INLINE static constexpr RAJA_HOST_DEVICE long double min()
Definition: Operators.hpp:326
Definition: Operators.hpp:250
Definition: Operators.hpp:451
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:452
friend std::ostream & operator<<(std::ostream &str, logical_and const &)
Definition: Operators.hpp:460
static constexpr RAJA_HOST_DEVICE bool identity()
Definition: Operators.hpp:458
Definition: Operators.hpp:486
friend std::ostream & operator<<(std::ostream &str, logical_not const &)
Definition: Operators.hpp:492
constexpr RAJA_HOST_DEVICE bool operator()(const T &lhs) const
Definition: Operators.hpp:487
Definition: Operators.hpp:469
static constexpr RAJA_HOST_DEVICE bool identity()
Definition: Operators.hpp:476
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:470
friend std::ostream & operator<<(std::ostream &str, logical_or const &)
Definition: Operators.hpp:478
Definition: Operators.hpp:580
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:587
friend std::ostream & operator<<(std::ostream &str, maximum const &)
Definition: Operators.hpp:592
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:581
Definition: Operators.hpp:559
friend std::ostream & operator<<(std::ostream &str, minimum const &)
Definition: Operators.hpp:571
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:566
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:560
Definition: Operators.hpp:384
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:385
friend std::ostream & operator<<(std::ostream &str, minus const &)
Definition: Operators.hpp:391
Definition: Operators.hpp:433
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:434
friend std::ostream & operator<<(std::ostream &str, modulus const &)
Definition: Operators.hpp:440
Definition: Operators.hpp:400
friend std::ostream & operator<<(std::ostream &str, multiplies const &)
Definition: Operators.hpp:410
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:408
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:402
Definition: Operators.hpp:617
friend std::ostream & operator<<(std::ostream &str, not_equal_to const &)
Definition: Operators.hpp:624
constexpr RAJA_HOST_DEVICE bool operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:618
Definition: Operators.hpp:367
constexpr RAJA_HOST_DEVICE Ret operator()(const Arg1 &lhs, const Arg2 &rhs) const
Definition: Operators.hpp:368
friend std::ostream & operator<<(std::ostream &str, plus const &)
Definition: Operators.hpp:376
static constexpr RAJA_HOST_DEVICE Ret identity()
Definition: Operators.hpp:374
Definition: Operators.hpp:709
friend std::ostream & operator<<(std::ostream &str, project1st const &)
Definition: Operators.hpp:716
constexpr RAJA_HOST_DEVICE T operator()(const T &lhs, const U &RAJA_UNUSED_ARG(rhs)) const
Definition: Operators.hpp:710
Definition: Operators.hpp:724
constexpr RAJA_HOST_DEVICE U operator()(const T &RAJA_UNUSED_ARG(lhs), const U &rhs) const
Definition: Operators.hpp:725
friend std::ostream & operator<<(std::ostream &str, project2nd const &)
Definition: Operators.hpp:731
Definition: Operators.hpp:759
friend std::ostream & operator<<(std::ostream &str, safe_plus const &)
Definition: Operators.hpp:760
Definition: Operators.hpp:224
Definition: Operators.hpp:169
Definition: Operators.hpp:96
static constexpr const bool value
Definition: Operators.hpp:97
Definition: Operators.hpp:89
static constexpr const bool value
Definition: Operators.hpp:90
double type
Definition: Operators.hpp:161
long double type
Definition: Operators.hpp:155
double type
Definition: Operators.hpp:149
int32_t type
Definition: Operators.hpp:137
int64_t type
Definition: Operators.hpp:143
int16_t type
Definition: Operators.hpp:131
uint32_t type
Definition: Operators.hpp:119
uint64_t type
Definition: Operators.hpp:125
uint16_t type
Definition: Operators.hpp:113
Definition: Operators.hpp:241
typename detail::larger_of< T, U,(size_of< T >::value > size_of< U >::value)>::type type
Definition: Operators.hpp:243
Definition: Operators.hpp:108
Definition: Operators.hpp:202
typename detail::largest< T, std::is_integral< T >::value, std::is_signed< T >::value, std::is_floating_point< T >::value, gpu >::type type
Definition: Operators.hpp:207
Definition: Operators.hpp:212
@ value
Definition: Operators.hpp:215