16#ifndef __LEGION_REDOP_H__
17#define __LEGION_REDOP_H__
25#ifdef LEGION_REDOP_COMPLEX
26#ifdef LEGION_REDOP_HALF
29#include "mathtypes/complex.h"
32#ifdef LEGION_REDOP_HALF
33#include "mathtypes/half.h"
36#if defined(__HIP__) && defined(REALM_USE_HIP)
37#include "hip_cuda_compat/hip_cuda.h"
38#include "realm/hip/hiphijack_api.h"
55 static constexpr bool identity =
false;
56 static constexpr int REDOP_ID = LEGION_REDOP_OR_BOOL;
58 template<
bool EXCLUSIVE>
59 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
60 template<
bool EXCLUSIVE>
61 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
70 static constexpr int8_t identity = 0;
71 static constexpr int REDOP_ID = LEGION_REDOP_SUM_INT8;
73 template<
bool EXCLUSIVE>
74 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
75 template<
bool EXCLUSIVE>
76 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
85 static constexpr int16_t identity = 0;
86 static constexpr int REDOP_ID = LEGION_REDOP_SUM_INT16;
88 template<
bool EXCLUSIVE>
89 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
90 template<
bool EXCLUSIVE>
91 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
100 static constexpr int32_t identity = 0;
101 static constexpr int REDOP_ID = LEGION_REDOP_SUM_INT32;
103 template<
bool EXCLUSIVE>
104 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
105 template<
bool EXCLUSIVE>
106 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
115 static constexpr int64_t identity = 0;
116 static constexpr int REDOP_ID = LEGION_REDOP_SUM_INT64;
118 template<
bool EXCLUSIVE>
119 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
120 template<
bool EXCLUSIVE>
121 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
130 static constexpr uint8_t identity = 0;
131 static constexpr int REDOP_ID = LEGION_REDOP_SUM_UINT8;
133 template<
bool EXCLUSIVE>
134 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
135 template<
bool EXCLUSIVE>
136 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
142 typedef uint16_t LHS;
143 typedef uint16_t RHS;
145 static constexpr uint16_t identity = 0;
146 static constexpr int REDOP_ID = LEGION_REDOP_SUM_UINT16;
148 template<
bool EXCLUSIVE>
149 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
150 template<
bool EXCLUSIVE>
151 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
157 typedef uint32_t LHS;
158 typedef uint32_t RHS;
160 static constexpr uint32_t identity = 0;
161 static constexpr int REDOP_ID = LEGION_REDOP_SUM_UINT32;
163 template<
bool EXCLUSIVE>
164 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
165 template<
bool EXCLUSIVE>
166 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
172 typedef uint64_t LHS;
173 typedef uint64_t RHS;
175 static constexpr uint64_t identity = 0;
176 static constexpr int REDOP_ID = LEGION_REDOP_SUM_UINT64;
178 template<
bool EXCLUSIVE>
179 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
180 template<
bool EXCLUSIVE>
181 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
184#ifdef LEGION_REDOP_HALF
191 static inline const __half identity = __half(0,
false );
192 static constexpr int REDOP_ID = LEGION_REDOP_SUM_FLOAT16;
194 template<
bool EXCLUSIVE>
195 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
196 template<
bool EXCLUSIVE>
197 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
207 static constexpr float identity = 0.f;
208 static constexpr int REDOP_ID = LEGION_REDOP_SUM_FLOAT32;
210 template<
bool EXCLUSIVE>
211 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
212 template<
bool EXCLUSIVE>
213 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
222 static constexpr double identity = 0.0;
223 static constexpr int REDOP_ID = LEGION_REDOP_SUM_FLOAT64;
225 template<
bool EXCLUSIVE>
226 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
227 template<
bool EXCLUSIVE>
228 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
231#ifdef LEGION_REDOP_COMPLEX
232#ifdef LEGION_REDOP_HALF
236 typedef complex<__half> LHS;
237 typedef complex<__half> RHS;
239 static inline const complex<__half> identity =
240 complex<__half>(__half(0,
false ), __half(0,
false ));
241 static constexpr int REDOP_ID = LEGION_REDOP_SUM_COMPLEX32;
243 template<
bool EXCLUSIVE>
244 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
245 template<
bool EXCLUSIVE>
246 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
251 class SumReduction<complex<float> > {
253 typedef complex<float> LHS;
254 typedef complex<float> RHS;
256 static inline const complex<float> identity = complex<float>(0.f, 0.f);
257 static constexpr int REDOP_ID = LEGION_REDOP_SUM_COMPLEX64;
259 template<
bool EXCLUSIVE>
260 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
261 template<
bool EXCLUSIVE>
262 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
270 class SumReduction<complex<double> > {
272 typedef complex<double> LHS;
273 typedef complex<double> RHS;
275 static inline const complex<double> identity = complex<double>(0.0, 0.0);
276 static constexpr int REDOP_ID = LEGION_REDOP_SUM_COMPLEX128;
278 template<
bool EXCLUSIVE>
279 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
280 template<
bool EXCLUSIVE>
281 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
297 static constexpr int8_t identity = 0;
298 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_INT8;
300 template<
bool EXCLUSIVE>
301 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
302 template<
bool EXCLUSIVE>
303 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
312 static constexpr int16_t identity = 0;
313 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_INT16;
315 template<
bool EXCLUSIVE>
316 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
317 template<
bool EXCLUSIVE>
318 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
327 static constexpr int32_t identity = 0;
328 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_INT32;
330 template<
bool EXCLUSIVE>
331 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
332 template<
bool EXCLUSIVE>
333 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
342 static constexpr int64_t identity = 0;
343 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_INT64;
345 template<
bool EXCLUSIVE>
346 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
347 template<
bool EXCLUSIVE>
348 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
357 static constexpr uint8_t identity = 0;
358 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_UINT8;
360 template<
bool EXCLUSIVE>
361 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
362 template<
bool EXCLUSIVE>
363 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
369 typedef uint16_t LHS;
370 typedef uint16_t RHS;
372 static constexpr uint16_t identity = 0;
373 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_UINT16;
375 template<
bool EXCLUSIVE>
376 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
377 template<
bool EXCLUSIVE>
378 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
384 typedef uint32_t LHS;
385 typedef uint32_t RHS;
387 static constexpr uint32_t identity = 0;
388 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_UINT32;
390 template<
bool EXCLUSIVE>
391 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
392 template<
bool EXCLUSIVE>
393 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
399 typedef uint64_t LHS;
400 typedef uint64_t RHS;
402 static constexpr uint64_t identity = 0;
403 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_UINT64;
405 template<
bool EXCLUSIVE>
406 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
407 template<
bool EXCLUSIVE>
408 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
411#ifdef LEGION_REDOP_HALF
418 static inline const __half identity = __half(0,
false );
419 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_FLOAT16;
421 template<
bool EXCLUSIVE>
422 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
423 template<
bool EXCLUSIVE>
424 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
434 static constexpr float identity = 0.f;
435 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_FLOAT32;
437 template<
bool EXCLUSIVE>
438 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
439 template<
bool EXCLUSIVE>
440 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
449 static constexpr double identity = 0.0;
450 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_FLOAT64;
452 template<
bool EXCLUSIVE>
453 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
454 template<
bool EXCLUSIVE>
455 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
458#ifdef LEGION_REDOP_COMPLEX
459#ifdef LEGION_REDOP_HALF
463 typedef complex<__half> LHS;
464 typedef complex<__half> RHS;
466 static inline const complex<__half> identity =
467 complex<__half>(__half(0,
false ), __half(0,
false ));
468 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_COMPLEX32;
470 template<
bool EXCLUSIVE>
471 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
472 template<
bool EXCLUSIVE>
473 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
478 class DiffReduction<complex<float> > {
480 typedef complex<float> LHS;
481 typedef complex<float> RHS;
483 static inline const complex<float> identity = complex<float>(0.f, 0.f);
484 static constexpr int REDOP_ID = LEGION_REDOP_DIFF_COMPLEX64;
486 template<
bool EXCLUSIVE>
487 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
488 template<
bool EXCLUSIVE>
489 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
505 static constexpr bool identity =
true;
506 static constexpr int REDOP_ID = LEGION_REDOP_AND_BOOL;
508 template<
bool EXCLUSIVE>
509 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
510 template<
bool EXCLUSIVE>
511 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
520 static constexpr int8_t identity = 1;
521 static constexpr int REDOP_ID = LEGION_REDOP_PROD_INT8;
523 template<
bool EXCLUSIVE>
524 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
525 template<
bool EXCLUSIVE>
526 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
535 static constexpr int16_t identity = 1;
536 static constexpr int REDOP_ID = LEGION_REDOP_PROD_INT16;
538 template<
bool EXCLUSIVE>
539 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
540 template<
bool EXCLUSIVE>
541 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
550 static constexpr int32_t identity = 1;
551 static constexpr int REDOP_ID = LEGION_REDOP_PROD_INT32;
553 template<
bool EXCLUSIVE>
554 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
555 template<
bool EXCLUSIVE>
556 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
565 static constexpr int64_t identity = 1;
566 static constexpr int REDOP_ID = LEGION_REDOP_PROD_INT64;
568 template<
bool EXCLUSIVE>
569 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
570 template<
bool EXCLUSIVE>
571 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
580 static constexpr uint8_t identity = 1;
581 static constexpr int REDOP_ID = LEGION_REDOP_PROD_UINT8;
583 template<
bool EXCLUSIVE>
584 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
585 template<
bool EXCLUSIVE>
586 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
592 typedef uint16_t LHS;
593 typedef uint16_t RHS;
595 static constexpr uint16_t identity = 1;
596 static constexpr int REDOP_ID = LEGION_REDOP_PROD_UINT16;
598 template<
bool EXCLUSIVE>
599 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
600 template<
bool EXCLUSIVE>
601 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
607 typedef uint32_t LHS;
608 typedef uint32_t RHS;
610 static constexpr uint32_t identity = 1;
611 static constexpr int REDOP_ID = LEGION_REDOP_PROD_UINT32;
613 template<
bool EXCLUSIVE>
614 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
615 template<
bool EXCLUSIVE>
616 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
622 typedef uint64_t LHS;
623 typedef uint64_t RHS;
625 static constexpr uint64_t identity = 1;
626 static constexpr int REDOP_ID = LEGION_REDOP_PROD_UINT64;
628 template<
bool EXCLUSIVE>
629 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
630 template<
bool EXCLUSIVE>
631 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
634#ifdef LEGION_REDOP_HALF
641 static inline const __half identity = __half(1,
false );
642 static constexpr int REDOP_ID = LEGION_REDOP_PROD_FLOAT16;
644 template<
bool EXCLUSIVE>
645 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
646 template<
bool EXCLUSIVE>
647 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
657 static constexpr float identity = 1.f;
658 static constexpr int REDOP_ID = LEGION_REDOP_PROD_FLOAT32;
660 template<
bool EXCLUSIVE>
661 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
662 template<
bool EXCLUSIVE>
663 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
672 static constexpr double identity = 1.0;
673 static constexpr int REDOP_ID = LEGION_REDOP_PROD_FLOAT64;
675 template<
bool EXCLUSIVE>
676 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
677 template<
bool EXCLUSIVE>
678 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
681#ifdef LEGION_REDOP_COMPLEX
682#ifdef LEGION_REDOP_HALF
686 typedef complex<__half> LHS;
687 typedef complex<__half> RHS;
689 static inline const complex<__half> identity =
690 complex<__half>(__half(1,
false ), __half(0,
false ));
691 static constexpr int REDOP_ID = LEGION_REDOP_PROD_COMPLEX32;
693 template<
bool EXCLUSIVE>
694 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
695 template<
bool EXCLUSIVE>
696 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
701 class ProdReduction<complex<float> > {
703 typedef complex<float> LHS;
704 typedef complex<float> RHS;
706 static inline const complex<float> identity = complex<float>(1.f, 0.f);
707 static constexpr int REDOP_ID = LEGION_REDOP_PROD_COMPLEX64;
709 template<
bool EXCLUSIVE>
710 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
711 template<
bool EXCLUSIVE>
712 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
728 static constexpr int8_t identity = 1;
729 static constexpr int REDOP_ID = LEGION_REDOP_DIV_INT8;
731 template<
bool EXCLUSIVE>
732 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
733 template<
bool EXCLUSIVE>
734 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
743 static constexpr int16_t identity = 1;
744 static constexpr int REDOP_ID = LEGION_REDOP_DIV_INT16;
746 template<
bool EXCLUSIVE>
747 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
748 template<
bool EXCLUSIVE>
749 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
758 static constexpr int32_t identity = 1;
759 static constexpr int REDOP_ID = LEGION_REDOP_DIV_INT32;
761 template<
bool EXCLUSIVE>
762 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
763 template<
bool EXCLUSIVE>
764 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
773 static constexpr int64_t identity = 1;
774 static constexpr int REDOP_ID = LEGION_REDOP_DIV_INT64;
776 template<
bool EXCLUSIVE>
777 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
778 template<
bool EXCLUSIVE>
779 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
788 static constexpr uint8_t identity = 1;
789 static constexpr int REDOP_ID = LEGION_REDOP_DIV_UINT8;
791 template<
bool EXCLUSIVE>
792 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
793 template<
bool EXCLUSIVE>
794 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
800 typedef uint16_t LHS;
801 typedef uint16_t RHS;
803 static constexpr uint16_t identity = 1;
804 static constexpr int REDOP_ID = LEGION_REDOP_DIV_UINT16;
806 template<
bool EXCLUSIVE>
807 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
808 template<
bool EXCLUSIVE>
809 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
815 typedef uint32_t LHS;
816 typedef uint32_t RHS;
818 static constexpr uint32_t identity = 1;
819 static constexpr int REDOP_ID = LEGION_REDOP_DIV_UINT32;
821 template<
bool EXCLUSIVE>
822 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
823 template<
bool EXCLUSIVE>
824 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
830 typedef uint64_t LHS;
831 typedef uint64_t RHS;
833 static constexpr uint64_t identity = 1;
834 static constexpr int REDOP_ID = LEGION_REDOP_DIV_UINT64;
836 template<
bool EXCLUSIVE>
837 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
838 template<
bool EXCLUSIVE>
839 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
842#ifdef LEGION_REDOP_HALF
849 static inline const __half identity = __half(1,
false );
850 static constexpr int REDOP_ID = LEGION_REDOP_DIV_FLOAT16;
852 template<
bool EXCLUSIVE>
853 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
854 template<
bool EXCLUSIVE>
855 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
865 static constexpr float identity = 1.f;
866 static constexpr int REDOP_ID = LEGION_REDOP_DIV_FLOAT32;
868 template<
bool EXCLUSIVE>
869 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
870 template<
bool EXCLUSIVE>
871 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
880 static constexpr double identity = 1.0;
881 static constexpr int REDOP_ID = LEGION_REDOP_DIV_FLOAT64;
883 template<
bool EXCLUSIVE>
884 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
885 template<
bool EXCLUSIVE>
886 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
889#ifdef LEGION_REDOP_COMPLEX
890#ifdef LEGION_REDOP_HALF
894 typedef complex<__half> LHS;
895 typedef complex<__half> RHS;
897 static inline const complex<__half> identity =
898 complex<__half>(__half(1,
false ), __half(0,
false ));
899 static constexpr int REDOP_ID = LEGION_REDOP_DIV_COMPLEX32;
901 template<
bool EXCLUSIVE>
902 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
903 template<
bool EXCLUSIVE>
904 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
909 class DivReduction<complex<float> > {
911 typedef complex<float> LHS;
912 typedef complex<float> RHS;
914 static inline const complex<float> identity = complex<float>(1.f, 0.f);
915 static constexpr int REDOP_ID = LEGION_REDOP_DIV_COMPLEX64;
917 template<
bool EXCLUSIVE>
918 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
919 template<
bool EXCLUSIVE>
920 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
936 static constexpr bool identity =
false;
937 static constexpr int REDOP_ID = LEGION_REDOP_MAX_BOOL;
939 template<
bool EXCLUSIVE>
940 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
941 template<
bool EXCLUSIVE>
942 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
951 static constexpr int8_t identity = std::numeric_limits<int8_t>::min();
952 static constexpr int REDOP_ID = LEGION_REDOP_MAX_INT8;
954 template<
bool EXCLUSIVE>
955 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
956 template<
bool EXCLUSIVE>
957 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
966 static constexpr int16_t identity = std::numeric_limits<int16_t>::min();
967 static constexpr int REDOP_ID = LEGION_REDOP_MAX_INT16;
969 template<
bool EXCLUSIVE>
970 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
971 template<
bool EXCLUSIVE>
972 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
981 static constexpr int32_t identity = std::numeric_limits<int32_t>::min();
982 static constexpr int REDOP_ID = LEGION_REDOP_MAX_INT32;
984 template<
bool EXCLUSIVE>
985 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
986 template<
bool EXCLUSIVE>
987 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
996 static constexpr int64_t identity = std::numeric_limits<int64_t>::min();
997 static constexpr int REDOP_ID = LEGION_REDOP_MAX_INT64;
999 template<
bool EXCLUSIVE>
1000 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1001 template<
bool EXCLUSIVE>
1002 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1008 typedef uint8_t LHS;
1009 typedef uint8_t RHS;
1011 static constexpr uint8_t identity = 0;
1012 static constexpr int REDOP_ID = LEGION_REDOP_MAX_UINT8;
1014 template<
bool EXCLUSIVE>
1015 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1016 template<
bool EXCLUSIVE>
1017 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1023 typedef uint16_t LHS;
1024 typedef uint16_t RHS;
1026 static constexpr uint16_t identity = 0;
1027 static constexpr int REDOP_ID = LEGION_REDOP_MAX_UINT16;
1029 template<
bool EXCLUSIVE>
1030 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1031 template<
bool EXCLUSIVE>
1032 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1038 typedef uint32_t LHS;
1039 typedef uint32_t RHS;
1041 static constexpr uint32_t identity = 0;
1042 static constexpr int REDOP_ID = LEGION_REDOP_MAX_UINT32;
1044 template<
bool EXCLUSIVE>
1045 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1046 template<
bool EXCLUSIVE>
1047 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1053 typedef uint64_t LHS;
1054 typedef uint64_t RHS;
1056 static constexpr uint64_t identity = 0;
1057 static constexpr int REDOP_ID = LEGION_REDOP_MAX_UINT64;
1059 template<
bool EXCLUSIVE>
1060 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1061 template<
bool EXCLUSIVE>
1062 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1065#ifdef LEGION_REDOP_HALF
1072 static inline const __half identity = __half(-2e10);
1073 static constexpr int REDOP_ID = LEGION_REDOP_MAX_FLOAT16;
1075 template<
bool EXCLUSIVE>
1076 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1077 template<
bool EXCLUSIVE>
1078 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1088 static constexpr float identity = std::numeric_limits<float>::lowest();
1089 static constexpr int REDOP_ID = LEGION_REDOP_MAX_FLOAT32;
1091 template<
bool EXCLUSIVE>
1092 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1093 template<
bool EXCLUSIVE>
1094 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1103 static constexpr double identity = std::numeric_limits<double>::lowest();
1104 static constexpr int REDOP_ID = LEGION_REDOP_MAX_FLOAT64;
1106 template<
bool EXCLUSIVE>
1107 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1108 template<
bool EXCLUSIVE>
1109 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1112 template<
typename T>
1124 static constexpr bool identity =
true;
1125 static constexpr int REDOP_ID = LEGION_REDOP_MIN_BOOL;
1127 template<
bool EXCLUSIVE>
1128 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1129 template<
bool EXCLUSIVE>
1130 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1139 static constexpr int8_t identity = std::numeric_limits<int8_t>::max();
1140 static constexpr int REDOP_ID = LEGION_REDOP_MIN_INT8;
1142 template<
bool EXCLUSIVE>
1143 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1144 template<
bool EXCLUSIVE>
1145 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1151 typedef int16_t LHS;
1152 typedef int16_t RHS;
1154 static constexpr int16_t identity = std::numeric_limits<int16_t>::max();
1155 static constexpr int REDOP_ID = LEGION_REDOP_MIN_INT16;
1157 template<
bool EXCLUSIVE>
1158 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1159 template<
bool EXCLUSIVE>
1160 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1166 typedef int32_t LHS;
1167 typedef int32_t RHS;
1169 static constexpr int32_t identity = std::numeric_limits<int32_t>::max();
1170 static constexpr int REDOP_ID = LEGION_REDOP_MIN_INT32;
1172 template<
bool EXCLUSIVE>
1173 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1174 template<
bool EXCLUSIVE>
1175 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1181 typedef int64_t LHS;
1182 typedef int64_t RHS;
1184 static constexpr int64_t identity = std::numeric_limits<int64_t>::max();
1185 static constexpr int REDOP_ID = LEGION_REDOP_MIN_INT64;
1187 template<
bool EXCLUSIVE>
1188 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1189 template<
bool EXCLUSIVE>
1190 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1196 typedef uint8_t LHS;
1197 typedef uint8_t RHS;
1199 static constexpr uint8_t identity = std::numeric_limits<uint8_t>::max();
1200 static constexpr int REDOP_ID = LEGION_REDOP_MIN_UINT8;
1202 template<
bool EXCLUSIVE>
1203 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1204 template<
bool EXCLUSIVE>
1205 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1211 typedef uint16_t LHS;
1212 typedef uint16_t RHS;
1214 static constexpr uint16_t identity = std::numeric_limits<uint16_t>::max();
1215 static constexpr int REDOP_ID = LEGION_REDOP_MIN_UINT16;
1217 template<
bool EXCLUSIVE>
1218 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1219 template<
bool EXCLUSIVE>
1220 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1226 typedef uint32_t LHS;
1227 typedef uint32_t RHS;
1229 static constexpr uint32_t identity = std::numeric_limits<uint32_t>::max();
1230 static constexpr int REDOP_ID = LEGION_REDOP_MIN_UINT32;
1232 template<
bool EXCLUSIVE>
1233 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1234 template<
bool EXCLUSIVE>
1235 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1241 typedef uint64_t LHS;
1242 typedef uint64_t RHS;
1244 static constexpr uint64_t identity = std::numeric_limits<uint64_t>::max();
1245 static constexpr int REDOP_ID = LEGION_REDOP_MIN_UINT64;
1247 template<
bool EXCLUSIVE>
1248 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1249 template<
bool EXCLUSIVE>
1250 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1253#ifdef LEGION_REDOP_HALF
1260 static inline const __half identity = __half(2e10);
1261 static constexpr int REDOP_ID = LEGION_REDOP_MIN_FLOAT16;
1263 template<
bool EXCLUSIVE>
1264 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1265 template<
bool EXCLUSIVE>
1266 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1276 static constexpr float identity = std::numeric_limits<float>::max();
1277 static constexpr int REDOP_ID = LEGION_REDOP_MIN_FLOAT32;
1279 template<
bool EXCLUSIVE>
1280 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1281 template<
bool EXCLUSIVE>
1282 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1291 static constexpr double identity = std::numeric_limits<double>::max();
1292 static constexpr int REDOP_ID = LEGION_REDOP_MIN_FLOAT64;
1294 template<
bool EXCLUSIVE>
1295 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1296 template<
bool EXCLUSIVE>
1297 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1300 template<
typename T>
1312 static constexpr int8_t identity = 0;
1313 static constexpr int REDOP_ID = LEGION_REDOP_OR_INT8;
1315 template<
bool EXCLUSIVE>
1316 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1317 template<
bool EXCLUSIVE>
1318 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1324 typedef int16_t LHS;
1325 typedef int16_t RHS;
1327 static constexpr int16_t identity = 0;
1328 static constexpr int REDOP_ID = LEGION_REDOP_OR_INT16;
1330 template<
bool EXCLUSIVE>
1331 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1332 template<
bool EXCLUSIVE>
1333 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1339 typedef int32_t LHS;
1340 typedef int32_t RHS;
1342 static constexpr int32_t identity = 0;
1343 static constexpr int REDOP_ID = LEGION_REDOP_OR_INT32;
1345 template<
bool EXCLUSIVE>
1346 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1347 template<
bool EXCLUSIVE>
1348 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1354 typedef int64_t LHS;
1355 typedef int64_t RHS;
1357 static constexpr int64_t identity = 0;
1358 static constexpr int REDOP_ID = LEGION_REDOP_OR_INT64;
1360 template<
bool EXCLUSIVE>
1361 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1362 template<
bool EXCLUSIVE>
1363 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1369 typedef uint8_t LHS;
1370 typedef uint8_t RHS;
1372 static constexpr uint8_t identity = 0;
1373 static constexpr int REDOP_ID = LEGION_REDOP_OR_UINT8;
1375 template<
bool EXCLUSIVE>
1376 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1377 template<
bool EXCLUSIVE>
1378 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1384 typedef uint16_t LHS;
1385 typedef uint16_t RHS;
1387 static constexpr uint16_t identity = 0;
1388 static constexpr int REDOP_ID = LEGION_REDOP_OR_UINT16;
1390 template<
bool EXCLUSIVE>
1391 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1392 template<
bool EXCLUSIVE>
1393 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1399 typedef uint32_t LHS;
1400 typedef uint32_t RHS;
1402 static constexpr uint32_t identity = 0;
1403 static constexpr int REDOP_ID = LEGION_REDOP_OR_UINT32;
1405 template<
bool EXCLUSIVE>
1406 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1407 template<
bool EXCLUSIVE>
1408 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1414 typedef uint64_t LHS;
1415 typedef uint64_t RHS;
1417 static constexpr uint64_t identity = 0;
1418 static constexpr int REDOP_ID = LEGION_REDOP_OR_UINT64;
1420 template<
bool EXCLUSIVE>
1421 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1422 template<
bool EXCLUSIVE>
1423 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1426 template<
typename T>
1438 static constexpr int8_t identity = (int8_t)0xFF;
1439 static constexpr int REDOP_ID = LEGION_REDOP_AND_INT8;
1441 template<
bool EXCLUSIVE>
1442 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1443 template<
bool EXCLUSIVE>
1444 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1450 typedef int16_t LHS;
1451 typedef int16_t RHS;
1453 static constexpr int16_t identity = (int16_t)0xFFFF;
1454 static constexpr int REDOP_ID = LEGION_REDOP_AND_INT16;
1456 template<
bool EXCLUSIVE>
1457 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1458 template<
bool EXCLUSIVE>
1459 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1465 typedef int32_t LHS;
1466 typedef int32_t RHS;
1468 static constexpr int32_t identity = 0xFFFF;
1469 static constexpr int REDOP_ID = LEGION_REDOP_AND_INT32;
1471 template<
bool EXCLUSIVE>
1472 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1473 template<
bool EXCLUSIVE>
1474 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1480 typedef int64_t LHS;
1481 typedef int64_t RHS;
1483 static constexpr int64_t identity = 0xFFFFFFFFL;
1484 static constexpr int REDOP_ID = LEGION_REDOP_AND_INT64;
1486 template<
bool EXCLUSIVE>
1487 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1488 template<
bool EXCLUSIVE>
1489 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1495 typedef uint8_t LHS;
1496 typedef uint8_t RHS;
1498 static constexpr uint8_t identity = 0xFFU;
1499 static constexpr int REDOP_ID = LEGION_REDOP_AND_UINT8;
1501 template<
bool EXCLUSIVE>
1502 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1503 template<
bool EXCLUSIVE>
1504 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1510 typedef uint16_t LHS;
1511 typedef uint16_t RHS;
1513 static constexpr uint16_t identity = 0xFFFFU;
1514 static constexpr int REDOP_ID = LEGION_REDOP_AND_UINT16;
1516 template<
bool EXCLUSIVE>
1517 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1518 template<
bool EXCLUSIVE>
1519 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1525 typedef uint32_t LHS;
1526 typedef uint32_t RHS;
1528 static constexpr uint32_t identity = 0xFFFFFFFFU;
1529 static constexpr int REDOP_ID = LEGION_REDOP_AND_UINT32;
1531 template<
bool EXCLUSIVE>
1532 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1533 template<
bool EXCLUSIVE>
1534 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1540 typedef uint64_t LHS;
1541 typedef uint64_t RHS;
1543 static constexpr uint64_t identity = 0xFFFFFFFFUL;
1544 static constexpr int REDOP_ID = LEGION_REDOP_AND_UINT64;
1546 template<
bool EXCLUSIVE>
1547 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1548 template<
bool EXCLUSIVE>
1549 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1552 template<
typename T>
1564 static constexpr bool identity =
false;
1565 static constexpr int REDOP_ID = LEGION_REDOP_XOR_BOOL;
1567 template<
bool EXCLUSIVE>
1568 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1569 template<
bool EXCLUSIVE>
1570 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1579 static constexpr int8_t identity = 0;
1580 static constexpr int REDOP_ID = LEGION_REDOP_XOR_INT8;
1582 template<
bool EXCLUSIVE>
1583 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1584 template<
bool EXCLUSIVE>
1585 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1591 typedef int16_t LHS;
1592 typedef int16_t RHS;
1594 static constexpr int16_t identity = 0;
1595 static constexpr int REDOP_ID = LEGION_REDOP_XOR_INT16;
1597 template<
bool EXCLUSIVE>
1598 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1599 template<
bool EXCLUSIVE>
1600 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1606 typedef int32_t LHS;
1607 typedef int32_t RHS;
1609 static constexpr int32_t identity = 0;
1610 static constexpr int REDOP_ID = LEGION_REDOP_XOR_INT32;
1612 template<
bool EXCLUSIVE>
1613 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1614 template<
bool EXCLUSIVE>
1615 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1621 typedef int64_t LHS;
1622 typedef int64_t RHS;
1624 static constexpr int64_t identity = 0;
1625 static constexpr int REDOP_ID = LEGION_REDOP_XOR_INT64;
1627 template<
bool EXCLUSIVE>
1628 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1629 template<
bool EXCLUSIVE>
1630 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1636 typedef uint8_t LHS;
1637 typedef uint8_t RHS;
1639 static constexpr uint8_t identity = 0;
1640 static constexpr int REDOP_ID = LEGION_REDOP_XOR_UINT8;
1642 template<
bool EXCLUSIVE>
1643 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1644 template<
bool EXCLUSIVE>
1645 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1651 typedef uint16_t LHS;
1652 typedef uint16_t RHS;
1654 static constexpr uint16_t identity = 0;
1655 static constexpr int REDOP_ID = LEGION_REDOP_XOR_UINT16;
1657 template<
bool EXCLUSIVE>
1658 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1659 template<
bool EXCLUSIVE>
1660 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1666 typedef uint32_t LHS;
1667 typedef uint32_t RHS;
1669 static constexpr uint32_t identity = 0;
1670 static constexpr int REDOP_ID = LEGION_REDOP_XOR_UINT32;
1672 template<
bool EXCLUSIVE>
1673 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1674 template<
bool EXCLUSIVE>
1675 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1681 typedef uint64_t LHS;
1682 typedef uint64_t RHS;
1684 static constexpr uint64_t identity = 0;
1685 static constexpr int REDOP_ID = LEGION_REDOP_XOR_UINT64;
1687 template<
bool EXCLUSIVE>
1688 __LEGION_CUDA_HD__
static void apply(LHS& lhs, RHS rhs);
1689 template<
bool EXCLUSIVE>
1690 __LEGION_CUDA_HD__
static void fold(RHS& rhs1, RHS rhs2);
1697#define LEGION_REDOP_LIST_BASE(__op__) \
1699 __op__(LEGION_REDOP_SUM_INT8, SumReduction<int8_t>) \
1700 __op__(LEGION_REDOP_SUM_INT16, SumReduction<int16_t>) \
1701 __op__(LEGION_REDOP_SUM_INT32, SumReduction<int32_t>) \
1702 __op__(LEGION_REDOP_SUM_INT64, SumReduction<int64_t>) \
1703 __op__(LEGION_REDOP_SUM_UINT8, SumReduction<uint8_t>) \
1704 __op__(LEGION_REDOP_SUM_UINT16, SumReduction<uint16_t>) \
1705 __op__(LEGION_REDOP_SUM_UINT32, SumReduction<uint32_t>) \
1706 __op__(LEGION_REDOP_SUM_UINT64, SumReduction<uint64_t>) \
1707 __op__(LEGION_REDOP_SUM_FLOAT32, SumReduction<float>) \
1708 __op__(LEGION_REDOP_SUM_FLOAT64, SumReduction<double>) \
1710 __op__(LEGION_REDOP_DIFF_INT8, DiffReduction<int8_t>) \
1711 __op__(LEGION_REDOP_DIFF_INT16, DiffReduction<int16_t>) \
1712 __op__(LEGION_REDOP_DIFF_INT32, DiffReduction<int32_t>) \
1713 __op__(LEGION_REDOP_DIFF_INT64, DiffReduction<int64_t>) \
1714 __op__(LEGION_REDOP_DIFF_UINT8, DiffReduction<uint8_t>) \
1715 __op__(LEGION_REDOP_DIFF_UINT16, DiffReduction<uint16_t>) \
1716 __op__(LEGION_REDOP_DIFF_UINT32, DiffReduction<uint32_t>) \
1717 __op__(LEGION_REDOP_DIFF_UINT64, DiffReduction<uint64_t>) \
1718 __op__(LEGION_REDOP_DIFF_FLOAT32, DiffReduction<float>) \
1719 __op__(LEGION_REDOP_DIFF_FLOAT64, DiffReduction<double>) \
1721 __op__(LEGION_REDOP_PROD_INT8, ProdReduction<int8_t>) \
1722 __op__(LEGION_REDOP_PROD_INT16, ProdReduction<int16_t>) \
1723 __op__(LEGION_REDOP_PROD_INT32, ProdReduction<int32_t>) \
1724 __op__(LEGION_REDOP_PROD_INT64, ProdReduction<int64_t>) \
1725 __op__(LEGION_REDOP_PROD_UINT8, ProdReduction<uint8_t>) \
1726 __op__(LEGION_REDOP_PROD_UINT16, ProdReduction<uint16_t>) \
1727 __op__(LEGION_REDOP_PROD_UINT32, ProdReduction<uint32_t>) \
1728 __op__(LEGION_REDOP_PROD_UINT64, ProdReduction<uint64_t>) \
1729 __op__(LEGION_REDOP_PROD_FLOAT32, ProdReduction<float>) \
1730 __op__(LEGION_REDOP_PROD_FLOAT64, ProdReduction<double>) \
1732 __op__(LEGION_REDOP_DIV_INT8, DivReduction<int8_t>) \
1733 __op__(LEGION_REDOP_DIV_INT16, DivReduction<int16_t>) \
1734 __op__(LEGION_REDOP_DIV_INT32, DivReduction<int32_t>) \
1735 __op__(LEGION_REDOP_DIV_INT64, DivReduction<int64_t>) \
1736 __op__(LEGION_REDOP_DIV_UINT8, DivReduction<uint8_t>) \
1737 __op__(LEGION_REDOP_DIV_UINT16, DivReduction<uint16_t>) \
1738 __op__(LEGION_REDOP_DIV_UINT32, DivReduction<uint32_t>) \
1739 __op__(LEGION_REDOP_DIV_UINT64, DivReduction<uint64_t>) \
1740 __op__(LEGION_REDOP_DIV_FLOAT32, DivReduction<float>) \
1741 __op__(LEGION_REDOP_DIV_FLOAT64, DivReduction<double>) \
1743 __op__(LEGION_REDOP_MAX_BOOL, MaxReduction<bool>) \
1744 __op__(LEGION_REDOP_MAX_INT8, MaxReduction<int8_t>) \
1745 __op__(LEGION_REDOP_MAX_INT16, MaxReduction<int16_t>) \
1746 __op__(LEGION_REDOP_MAX_INT32, MaxReduction<int32_t>) \
1747 __op__(LEGION_REDOP_MAX_INT64, MaxReduction<int64_t>) \
1748 __op__(LEGION_REDOP_MAX_UINT8, MaxReduction<uint8_t>) \
1749 __op__(LEGION_REDOP_MAX_UINT16, MaxReduction<uint16_t>) \
1750 __op__(LEGION_REDOP_MAX_UINT32, MaxReduction<uint32_t>) \
1751 __op__(LEGION_REDOP_MAX_UINT64, MaxReduction<uint64_t>) \
1752 __op__(LEGION_REDOP_MAX_FLOAT32, MaxReduction<float>) \
1753 __op__(LEGION_REDOP_MAX_FLOAT64, MaxReduction<double>) \
1755 __op__(LEGION_REDOP_MIN_BOOL, MinReduction<bool>) \
1756 __op__(LEGION_REDOP_MIN_INT8, MinReduction<int8_t>) \
1757 __op__(LEGION_REDOP_MIN_INT16, MinReduction<int16_t>) \
1758 __op__(LEGION_REDOP_MIN_INT32, MinReduction<int32_t>) \
1759 __op__(LEGION_REDOP_MIN_INT64, MinReduction<int64_t>) \
1760 __op__(LEGION_REDOP_MIN_UINT8, MinReduction<uint8_t>) \
1761 __op__(LEGION_REDOP_MIN_UINT16, MinReduction<uint16_t>) \
1762 __op__(LEGION_REDOP_MIN_UINT32, MinReduction<uint32_t>) \
1763 __op__(LEGION_REDOP_MIN_UINT64, MinReduction<uint64_t>) \
1764 __op__(LEGION_REDOP_MIN_FLOAT32, MinReduction<float>) \
1765 __op__(LEGION_REDOP_MIN_FLOAT64, MinReduction<double>) \
1767 __op__(LEGION_REDOP_OR_BOOL, SumReduction<bool>) \
1768 __op__(LEGION_REDOP_OR_INT8, OrReduction<int8_t>) \
1769 __op__(LEGION_REDOP_OR_INT16, OrReduction<int16_t>) \
1770 __op__(LEGION_REDOP_OR_INT32, OrReduction<int32_t>) \
1771 __op__(LEGION_REDOP_OR_INT64, OrReduction<int64_t>) \
1772 __op__(LEGION_REDOP_OR_UINT8, OrReduction<uint8_t>) \
1773 __op__(LEGION_REDOP_OR_UINT16, OrReduction<uint16_t>) \
1774 __op__(LEGION_REDOP_OR_UINT32, OrReduction<uint32_t>) \
1775 __op__(LEGION_REDOP_OR_UINT64, OrReduction<uint64_t>) \
1777 __op__(LEGION_REDOP_AND_BOOL, ProdReduction<bool>) \
1778 __op__(LEGION_REDOP_AND_INT8, AndReduction<int8_t>) \
1779 __op__(LEGION_REDOP_AND_INT16, AndReduction<int16_t>) \
1780 __op__(LEGION_REDOP_AND_INT32, AndReduction<int32_t>) \
1781 __op__(LEGION_REDOP_AND_INT64, AndReduction<int64_t>) \
1782 __op__(LEGION_REDOP_AND_UINT8, AndReduction<uint8_t>) \
1783 __op__(LEGION_REDOP_AND_UINT16, AndReduction<uint16_t>) \
1784 __op__(LEGION_REDOP_AND_UINT32, AndReduction<uint32_t>) \
1785 __op__(LEGION_REDOP_AND_UINT64, AndReduction<uint64_t>) \
1787 __op__(LEGION_REDOP_XOR_BOOL, XorReduction<bool>) \
1788 __op__(LEGION_REDOP_XOR_INT8, XorReduction<int8_t>) \
1789 __op__(LEGION_REDOP_XOR_INT16, XorReduction<int16_t>) \
1790 __op__(LEGION_REDOP_XOR_INT32, XorReduction<int32_t>) \
1791 __op__(LEGION_REDOP_XOR_INT64, XorReduction<int64_t>) \
1792 __op__(LEGION_REDOP_XOR_UINT8, XorReduction<uint8_t>) \
1793 __op__(LEGION_REDOP_XOR_UINT16, XorReduction<uint16_t>) \
1794 __op__(LEGION_REDOP_XOR_UINT32, XorReduction<uint32_t>) \
1795 __op__(LEGION_REDOP_XOR_UINT64, XorReduction<uint64_t>)
1797#ifdef LEGION_REDOP_HALF
1798 #define LEGION_REDOP_LIST_HALF(__op__) \
1799 __op__(LEGION_REDOP_SUM_FLOAT16, SumReduction<__half>) \
1800 __op__(LEGION_REDOP_DIFF_FLOAT16, DiffReduction<__half>) \
1801 __op__(LEGION_REDOP_PROD_FLOAT16, ProdReduction<__half>) \
1802 __op__(LEGION_REDOP_DIV_FLOAT16, DivReduction<__half>) \
1803 __op__(LEGION_REDOP_MAX_FLOAT16, MaxReduction<__half>) \
1804 __op__(LEGION_REDOP_MIN_FLOAT16, MinReduction<__half>)
1806 #define LEGION_REDOP_LIST_HALF(__op__)
1808#ifdef LEGION_REDOP_COMPLEX
1809 #define LEGION_REDOP_LIST_COMPLEX(__op__) \
1810 __op__(LEGION_REDOP_SUM_COMPLEX64, SumReduction<complex<float> >) \
1811 __op__(LEGION_REDOP_DIFF_COMPLEX64, DiffReduction<complex<float> >) \
1812 __op__(LEGION_REDOP_PROD_COMPLEX64, ProdReduction<complex<float> >) \
1813 __op__(LEGION_REDOP_DIV_COMPLEX64, DivReduction<complex<float> >) \
1814 __op__(LEGION_REDOP_SUM_COMPLEX128, SumReduction<complex<double> >)
1816 #ifdef LEGION_REDOP_HALF
1817 #define LEGION_REDOP_LIST_HALF_COMPLEX(__op__) \
1818 __op__(LEGION_REDOP_SUM_COMPLEX32, SumReduction<complex<__half> >) \
1819 __op__(LEGION_REDOP_DIFF_COMPLEX32, DiffReduction<complex<__half> >) \
1820 __op__(LEGION_REDOP_PROD_COMPLEX32, ProdReduction<complex<__half> >) \
1821 __op__(LEGION_REDOP_DIV_COMPLEX32, DivReduction<complex<__half> >)
1823 #define LEGION_REDOP_LIST_HALF_COMPLEX(__op__)
1826 #define LEGION_REDOP_LIST_COMPLEX(__op__)
1827 #define LEGION_REDOP_LIST_HALF_COMPLEX(__op__)
1830#define LEGION_REDOP_LIST(__op__) \
1831 LEGION_REDOP_LIST_BASE(__op__) \
1832 LEGION_REDOP_LIST_HALF(__op__) \
1833 LEGION_REDOP_LIST_COMPLEX(__op__) \
1834 LEGION_REDOP_LIST_HALF_COMPLEX(__op__)
1840#include "legion/api/redop.inl"