Legion Runtime
Loading...
Searching...
No Matches
legion.h
Go to the documentation of this file.
1/* Copyright 2024 Stanford University, NVIDIA Corporation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// decide whether we want C and/or C++ bindings (default matches host language)
17//
18// each set of bindings has its own include-once ifdef armor, allowing the
19// second set of bindings to be loaded even if the first already has been
20#if !defined(LEGION_ENABLE_C_BINDINGS) && !defined(LEGION_DISABLE_C_BINDINGS)
21 #ifndef __cplusplus
22 #define LEGION_ENABLE_C_BINDINGS
23 #endif
24#endif
25#if !defined(LEGION_ENABLE_CXX_BINDINGS) && !defined(LEGION_DISABLE_CXX_BINDINGS)
26 #ifdef __cplusplus
27 #define LEGION_ENABLE_CXX_BINDINGS
28 #endif
29#endif
30
31#ifdef LEGION_ENABLE_C_BINDINGS
32#include "legion/legion_c.h"
33#endif
34
35#ifdef LEGION_ENABLE_CXX_BINDINGS
36#ifndef __LEGION_RUNTIME_H__
37#define __LEGION_RUNTIME_H__
38
52#if __cplusplus < 201103L
53#error "Legion requires C++11 as the minimum standard version"
54#endif
55
56#include "legion/legion_types.h"
58#include "legion/legion_constraint.h"
59#include "legion/legion_redop.h"
60
61#define LEGION_PRINT_ONCE(runtime, ctx, file, fmt, ...) \
62{ \
63 char message[4096]; \
64 snprintf(message, 4096, fmt, ##__VA_ARGS__); \
65 runtime->print_once(ctx, file, message); \
66}
67
72namespace Legion {
73
74 //==========================================================================
75 // Data Description Classes
76 //==========================================================================
77
85 class IndexSpace {
86 public:
87 static const IndexSpace NO_SPACE;
88 protected:
89 // Only the runtime should be allowed to make these
90 FRIEND_ALL_RUNTIME_CLASSES
91 IndexSpace(IndexSpaceID id, IndexTreeID tid, TypeTag tag);
92 public:
93 IndexSpace(void);
94 public:
95 inline bool operator==(const IndexSpace &rhs) const;
96 inline bool operator!=(const IndexSpace &rhs) const;
97 inline bool operator<(const IndexSpace &rhs) const;
98 inline bool operator>(const IndexSpace &rhs) const;
99 inline std::size_t hash(void) const;
100 inline IndexSpaceID get_id(void) const { return id; }
101 inline IndexTreeID get_tree_id(void) const { return tid; }
102 inline bool exists(void) const { return (id != 0); }
103 inline TypeTag get_type_tag(void) const { return type_tag; }
104 inline int get_dim(void) const;
105 protected:
106 friend std::ostream& operator<<(std::ostream& os,
107 const IndexSpace& is);
108 IndexSpaceID id;
109 IndexTreeID tid;
110 TypeTag type_tag;
111 };
112
119 template<int DIM, typename COORD_T = coord_t>
120 class IndexSpaceT : public IndexSpace {
121 private:
122 static_assert(DIM > 0, "DIM must be positive");
123 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
124 protected:
125 // Only the runtime should be allowed to make these
126 FRIEND_ALL_RUNTIME_CLASSES
127 IndexSpaceT(IndexSpaceID id, IndexTreeID tid);
128 public:
129 IndexSpaceT(void);
130 explicit IndexSpaceT(const IndexSpace &rhs);
131 public:
132 inline IndexSpaceT& operator=(const IndexSpace &rhs);
133 };
134
142 public:
143 static const IndexPartition NO_PART;
144 protected:
145 // Only the runtime should be allowed to make these
146 FRIEND_ALL_RUNTIME_CLASSES
147 IndexPartition(IndexPartitionID id, IndexTreeID tid, TypeTag tag);
148 public:
149 IndexPartition(void);
150 public:
151 inline bool operator==(const IndexPartition &rhs) const;
152 inline bool operator!=(const IndexPartition &rhs) const;
153 inline bool operator<(const IndexPartition &rhs) const;
154 inline bool operator>(const IndexPartition &rhs) const;
155 inline std::size_t hash(void) const;
156 inline IndexPartitionID get_id(void) const { return id; }
157 inline IndexTreeID get_tree_id(void) const { return tid; }
158 inline bool exists(void) const { return (id != 0); }
159 inline TypeTag get_type_tag(void) const { return type_tag; }
160 inline int get_dim(void) const;
161 protected:
162 friend std::ostream& operator<<(std::ostream& os,
163 const IndexPartition& ip);
164 IndexPartitionID id;
165 IndexTreeID tid;
166 TypeTag type_tag;
167 };
168
175 template<int DIM, typename COORD_T = coord_t>
177 private:
178 static_assert(DIM > 0, "DIM must be positive");
179 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
180 protected:
181 // Only the runtime should be allowed to make these
182 FRIEND_ALL_RUNTIME_CLASSES
183 IndexPartitionT(IndexPartitionID id, IndexTreeID tid);
184 public:
185 IndexPartitionT(void);
186 explicit IndexPartitionT(const IndexPartition &rhs);
187 public:
188 inline IndexPartitionT& operator=(const IndexPartition &rhs);
189 };
190
201 public:
202 static const FieldSpace NO_SPACE;
203 protected:
204 // Only the runtime should be allowed to make these
205 FRIEND_ALL_RUNTIME_CLASSES
206 FieldSpace(FieldSpaceID id);
207 public:
208 FieldSpace(void);
209 public:
210 inline bool operator==(const FieldSpace &rhs) const;
211 inline bool operator!=(const FieldSpace &rhs) const;
212 inline bool operator<(const FieldSpace &rhs) const;
213 inline bool operator>(const FieldSpace &rhs) const;
214 inline std::size_t hash(void) const;
215 inline FieldSpaceID get_id(void) const { return id; }
216 inline bool exists(void) const { return (id != 0); }
217 private:
218 friend std::ostream& operator<<(std::ostream& os, const FieldSpace& fs);
219 FieldSpaceID id;
220 };
221
237 public:
239 protected:
240 // Only the runtime should be allowed to make these
241 FRIEND_ALL_RUNTIME_CLASSES
242 LogicalRegion(RegionTreeID tid, IndexSpace index, FieldSpace field);
243 public:
244 LogicalRegion(void);
245 public:
246 inline bool operator==(const LogicalRegion &rhs) const;
247 inline bool operator!=(const LogicalRegion &rhs) const;
248 inline bool operator<(const LogicalRegion &rhs) const;
249 std::size_t hash(void) const;
250 public:
251 inline IndexSpace get_index_space(void) const { return index_space; }
252 inline FieldSpace get_field_space(void) const { return field_space; }
253 inline RegionTreeID get_tree_id(void) const { return tree_id; }
254 inline bool exists(void) const { return (tree_id != 0); }
255 inline TypeTag get_type_tag(void) const
256 { return index_space.get_type_tag(); }
257 inline int get_dim(void) const { return index_space.get_dim(); }
258 protected:
259 friend std::ostream& operator<<(std::ostream& os,
260 const LogicalRegion& lr);
261 // These are private so the user can't just arbitrarily change them
262 RegionTreeID tree_id;
263 IndexSpace index_space;
264 FieldSpace field_space;
265 };
266
273 template<int DIM, typename COORD_T = coord_t>
275 private:
276 static_assert(DIM > 0, "DIM must be positive");
277 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
278 protected:
279 // Only the runtime should be allowed to make these
280 FRIEND_ALL_RUNTIME_CLASSES
281 LogicalRegionT(RegionTreeID tid, IndexSpace index, FieldSpace field);
282 public:
283 LogicalRegionT(void);
284 explicit LogicalRegionT(const LogicalRegion &rhs);
285 public:
286 inline LogicalRegionT& operator=(const LogicalRegion &rhs);
287 };
288
305 public:
307 protected:
308 // Only the runtime should be allowed to make these
309 FRIEND_ALL_RUNTIME_CLASSES
310 LogicalPartition(RegionTreeID tid, IndexPartition pid, FieldSpace field);
311 public:
312 LogicalPartition(void);
313 public:
314 inline bool operator==(const LogicalPartition &rhs) const;
315 inline bool operator!=(const LogicalPartition &rhs) const;
316 inline bool operator<(const LogicalPartition &rhs) const;
317 std::size_t hash(void) const;
318 public:
319 inline IndexPartition get_index_partition(void) const
320 { return index_partition; }
321 inline FieldSpace get_field_space(void) const { return field_space; }
322 inline RegionTreeID get_tree_id(void) const { return tree_id; }
323 inline bool exists(void) const { return (tree_id != 0); }
324 inline TypeTag get_type_tag(void) const
325 { return index_partition.get_type_tag(); }
326 inline int get_dim(void) const { return index_partition.get_dim(); }
327 protected:
328 friend std::ostream& operator<<(std::ostream& os,
329 const LogicalPartition& lp);
330 // These are private so the user can't just arbitrary change them
331 RegionTreeID tree_id;
332 IndexPartition index_partition;
333 FieldSpace field_space;
334 };
335
342 template<int DIM, typename COORD_T = coord_t>
344 private:
345 static_assert(DIM > 0, "DIM must be positive");
346 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
347 protected:
348 // Only the runtime should be allowed to make these
349 FRIEND_ALL_RUNTIME_CLASSES
350 LogicalPartitionT(RegionTreeID tid, IndexPartition pid, FieldSpace field);
351 public:
352 LogicalPartitionT(void);
353 explicit LogicalPartitionT(const LogicalPartition &rhs);
354 public:
355 inline LogicalPartitionT& operator=(const LogicalPartition &rhs);
356 };
357
358 //==========================================================================
359 // Data Allocation Classes
360 //==========================================================================
361
378 class FieldAllocator : public Unserializable<FieldAllocator> {
379 public:
380 FieldAllocator(void);
381 FieldAllocator(const FieldAllocator &allocator);
382 FieldAllocator(FieldAllocator &&allocator) noexcept;
383 ~FieldAllocator(void);
384 protected:
385 FRIEND_ALL_RUNTIME_CLASSES
386 // Only the Runtime should be able to make these
387 FieldAllocator(Internal::FieldAllocatorImpl *impl);
388 public:
389 FieldAllocator& operator=(const FieldAllocator &allocator);
390 FieldAllocator& operator=(FieldAllocator &&allocator) noexcept;
391 inline bool operator<(const FieldAllocator &rhs) const;
392 inline bool operator==(const FieldAllocator &rhs) const;
393 inline bool exists(void) const { return (impl != NULL); }
394 public:
396
415 FieldID allocate_field(size_t field_size,
416 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
417 CustomSerdezID serdez_id = 0,
418 bool local_field = false,
419 const char *provenance = NULL);
420 FieldID allocate_field(const Future &field_size,
421 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
422 CustomSerdezID serdez_id = 0,
423 bool local_field = false,
424 const char *provenance = NULL);
426
434 LEGION_DEPRECATED("We are considering removing support for freeing fields"
435 "in a future Legion release. Please contact the Legion developer's "
436 "list if field deletion is important for your application.")
437 void free_field(FieldID fid, const bool unordered = false,
438 const char *provenance = NULL);
439
447 FieldID allocate_local_field(size_t field_size,
448 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
449 CustomSerdezID serdez_id = 0, const char *provenance = NULL);
451
468 void allocate_fields(const std::vector<size_t> &field_sizes,
469 std::vector<FieldID> &resulting_fields,
470 CustomSerdezID serdez_id = 0,
471 bool local_fields = false,
472 const char *provenance = NULL);
473 void allocate_fields(const std::vector<Future> &field_sizes,
474 std::vector<FieldID> &resulting_fields,
475 CustomSerdezID serdez_id = 0,
476 bool local_fields = false,
477 const char *provenance = NULL);
479
487 LEGION_DEPRECATED("We are considering removing support for freeing fields"
488 "in a future Legion release. Please contact the Legion developer's "
489 "list if field deletion is important for your application.")
490 void free_fields(const std::set<FieldID> &to_free,
491 const bool unordered = false,
492 const char *provenance = NULL);
500 void allocate_local_fields(const std::vector<size_t> &field_sizes,
501 std::vector<FieldID> &resulting_fields,
502 CustomSerdezID serdez_id = 0,
503 const char *provenance = NULL);
508 private:
509 Internal::FieldAllocatorImpl *impl;
510 };
511
512 //==========================================================================
513 // Pass-By-Value Argument Classes
514 //==========================================================================
515
525 public:
526 UntypedBuffer(void) : args(NULL), arglen(0) { }
527 UntypedBuffer(const void *arg, size_t argsize)
528 : args(const_cast<void*>(arg)), arglen(argsize) { }
529 UntypedBuffer(const UntypedBuffer &rhs)
530 : args(rhs.args), arglen(rhs.arglen) { }
531 UntypedBuffer(UntypedBuffer &&rhs) noexcept
532 : args(rhs.args), arglen(rhs.arglen) { }
533 public:
534 inline size_t get_size(void) const { return arglen; }
535 inline void* get_ptr(void) const { return args; }
536 public:
537 inline bool operator==(const UntypedBuffer &arg) const
538 { return (args == arg.args) && (arglen == arg.arglen); }
539 inline bool operator<(const UntypedBuffer &arg) const
540 { return (args < arg.args) && (arglen < arg.arglen); }
541 inline UntypedBuffer& operator=(const UntypedBuffer &rhs)
542 { args = rhs.args; arglen = rhs.arglen; return *this; }
543 inline UntypedBuffer& operator=(UntypedBuffer &&rhs) noexcept
544 { args = rhs.args; arglen = rhs.arglen; return *this; }
545 private:
546 void *args;
547 size_t arglen;
548 };
549 // This typedef is here for backwards compatibility since we
550 // used to call an UntypedBuffer a TaskArgument
552
563 class ArgumentMap : public Unserializable<ArgumentMap> {
564 public:
565 ArgumentMap(void);
566 ArgumentMap(const FutureMap &rhs);
567 ArgumentMap(const ArgumentMap &rhs);
568 ArgumentMap(ArgumentMap &&rhs) noexcept;
569 ~ArgumentMap(void);
570 public:
571 ArgumentMap& operator=(const FutureMap &rhs);
572 ArgumentMap& operator=(const ArgumentMap &rhs);
573 ArgumentMap& operator=(ArgumentMap &&rhs) noexcept;
574 inline bool operator==(const ArgumentMap &rhs) const
575 { return (impl == rhs.impl); }
576 inline bool operator<(const ArgumentMap &rhs) const
577 { return (impl < rhs.impl); }
578 inline bool exists(void) const { return (impl != NULL); }
579 public:
585 bool has_point(const DomainPoint &point);
592 void set_point(const DomainPoint &point, const UntypedBuffer &arg,
593 bool replace = true);
600 void set_point(const DomainPoint &point, const Future &f,
601 bool replace = true);
607 bool remove_point(const DomainPoint &point);
616 public:
625 template<typename PT, unsigned DIM>
626 inline void set_point_arg(const PT point[DIM], const UntypedBuffer &arg,
627 bool replace = false);
633 template<typename PT, unsigned DIM>
634 inline bool remove_point(const PT point[DIM]);
635 private:
636 FRIEND_ALL_RUNTIME_CLASSES
637 Internal::ArgumentMapImpl *impl;
638 private:
639 explicit ArgumentMap(Internal::ArgumentMapImpl *i);
640 };
641
642 //==========================================================================
643 // Predicate Classes
644 //==========================================================================
645
656 class Predicate : public Unserializable<Predicate> {
657 public:
658 static const Predicate TRUE_PRED;
659 static const Predicate FALSE_PRED;
660 public:
661 Predicate(void);
662 Predicate(const Predicate &p);
663 Predicate(Predicate &&p) noexcept;
664 explicit Predicate(bool value);
665 ~Predicate(void);
666 protected:
667 FRIEND_ALL_RUNTIME_CLASSES
668 Internal::PredicateImpl *impl;
669 // Only the runtime should be allowed to make these
670 explicit Predicate(Internal::PredicateImpl *impl);
671 public:
672 Predicate& operator=(const Predicate &p);
673 Predicate& operator=(Predicate &&p) noexcept;
674 inline bool operator==(const Predicate &p) const;
675 inline bool operator<(const Predicate &p) const;
676 inline bool operator!=(const Predicate &p) const;
677 inline bool exists(void) const { return (impl != NULL); }
678 private:
679 bool const_value;
680 };
681
682 //==========================================================================
683 // Simultaneous Coherence Synchronization Classes
684 //==========================================================================
685
715 class Lock {
716 public:
717 Lock(void);
718 protected:
719 // Only the runtime is allowed to make non-empty locks
720 FRIEND_ALL_RUNTIME_CLASSES
721 Lock(Reservation r);
722 public:
723 bool operator<(const Lock &rhs) const;
724 bool operator==(const Lock &rhs) const;
725 public:
726 void acquire(unsigned mode = 0, bool exclusive = true);
727 void release(void);
728 private:
729 Reservation reservation_lock;
730 };
731
739 struct LockRequest {
740 public:
741 LockRequest(Lock l, unsigned mode = 0, bool exclusive = true);
742 public:
743 Lock lock;
744 unsigned mode;
745 bool exclusive;
746 };
747
760 class Grant {
761 public:
762 Grant(void);
763 Grant(const Grant &g);
764 ~Grant(void);
765 protected:
766 // Only the runtime is allowed to make non-empty grants
767 FRIEND_ALL_RUNTIME_CLASSES
768 explicit Grant(Internal::GrantImpl *impl);
769 public:
770 bool operator==(const Grant &g) const
771 { return impl == g.impl; }
772 bool operator<(const Grant &g) const
773 { return impl < g.impl; }
774 Grant& operator=(const Grant &g);
775 protected:
776 Internal::GrantImpl *impl;
777 };
778
808 public:
809 PhaseBarrier(void);
810 protected:
811 // Only the runtime is allowed to make non-empty phase barriers
812 FRIEND_ALL_RUNTIME_CLASSES
814 public:
815 bool operator<(const PhaseBarrier &rhs) const;
816 bool operator==(const PhaseBarrier &rhs) const;
817 bool operator!=(const PhaseBarrier &rhs) const;
818 public:
819 void arrive(unsigned count = 1);
820 void wait(void);
821 void alter_arrival_count(int delta);
822 Realm::Barrier get_barrier(void) const { return phase_barrier; }
823 bool exists(void) const;
824 protected:
825 Internal::ApBarrier phase_barrier;
826 friend std::ostream& operator<<(std::ostream& os, const PhaseBarrier& pb);
827 };
828
844 public:
845 DynamicCollective(void);
846 protected:
847 // Only the runtime is allowed to make non-empty dynamic collectives
848 FRIEND_ALL_RUNTIME_CLASSES
849 DynamicCollective(Internal::ApBarrier b, ReductionOpID redop);
850 public:
851 // All the same operations as a phase barrier
852 void arrive(const void *value, size_t size, unsigned count = 1);
853 protected:
854 ReductionOpID redop;
855 };
856
857 //==========================================================================
858 // Operation Requirement Classes
859 //==========================================================================
860
876 public:
877 RegionRequirement(void);
882 const std::set<FieldID> &privilege_fields,
883 const std::vector<FieldID> &instance_fields,
884 PrivilegeMode _priv, CoherenceProperty _prop,
885 LogicalRegion _parent, MappingTagID _tag = 0,
886 bool _verified = false);
890 RegionRequirement(LogicalPartition pid, ProjectionID _proj,
891 const std::set<FieldID> &privilege_fields,
892 const std::vector<FieldID> &instance_fields,
893 PrivilegeMode _priv, CoherenceProperty _prop,
894 LogicalRegion _parent, MappingTagID _tag = 0,
895 bool _verified = false);
899 RegionRequirement(LogicalRegion _handle, ProjectionID _proj,
900 const std::set<FieldID> &privilege_fields,
901 const std::vector<FieldID> &instance_fields,
902 PrivilegeMode _priv, CoherenceProperty _prop,
903 LogicalRegion _parent, MappingTagID _tag = 0,
904 bool _verified = false);
910 const std::set<FieldID> &privilege_fields,
911 const std::vector<FieldID> &instance_fields,
912 ReductionOpID op, CoherenceProperty _prop,
913 LogicalRegion _parent, MappingTagID _tag = 0,
914 bool _verified = false);
918 RegionRequirement(LogicalPartition pid, ProjectionID _proj,
919 const std::set<FieldID> &privilege_fields,
920 const std::vector<FieldID> &instance_fields,
921 ReductionOpID op, CoherenceProperty _prop,
922 LogicalRegion _parent, MappingTagID _tag = 0,
923 bool _verified = false);
927 RegionRequirement(LogicalRegion _handle, ProjectionID _proj,
928 const std::set<FieldID> &privilege_fields,
929 const std::vector<FieldID> &instance_fields,
930 ReductionOpID op, CoherenceProperty _prop,
931 LogicalRegion _parent, MappingTagID _tag = 0,
932 bool _verified = false);
933 public:
934 // Analogous constructors without the privilege and instance fields
935 RegionRequirement(LogicalRegion _handle, PrivilegeMode _priv,
936 CoherenceProperty _prop, LogicalRegion _parent,
937 MappingTagID _tag = 0, bool _verified = false);
938 RegionRequirement(LogicalPartition pid, ProjectionID _proj,
939 PrivilegeMode _priv, CoherenceProperty _prop,
940 LogicalRegion _parent, MappingTagID _tag = 0,
941 bool _verified = false);
942 RegionRequirement(LogicalRegion _handle, ProjectionID _proj,
943 PrivilegeMode _priv, CoherenceProperty _prop,
944 LogicalRegion _parent, MappingTagID _tag = 0,
945 bool _verified = false);
946 RegionRequirement(LogicalRegion _handle, ReductionOpID op,
947 CoherenceProperty _prop, LogicalRegion _parent,
948 MappingTagID _tag = 0, bool _verified = false);
949 RegionRequirement(LogicalPartition pid, ProjectionID _proj,
950 ReductionOpID op, CoherenceProperty _prop,
951 LogicalRegion _parent, MappingTagID _tag = 0,
952 bool _verified = false);
953 RegionRequirement(LogicalRegion _handle, ProjectionID _proj,
954 ReductionOpID op, CoherenceProperty _prop,
955 LogicalRegion _parent, MappingTagID _tag = 0,
956 bool _verified = false);
957 public:
959 ~RegionRequirement(void);
960 RegionRequirement& operator=(const RegionRequirement &req);
961 public:
962 bool operator==(const RegionRequirement &req) const;
963 bool operator<(const RegionRequirement &req) const;
964 public:
970 inline RegionRequirement& add_field(FieldID fid, bool instance = true);
971 inline RegionRequirement& add_fields(const std::vector<FieldID>& fids,
972 bool instance = true);
973
974 inline RegionRequirement& add_flags(RegionFlags new_flags);
975 public:
976 inline bool is_verified(void) const
977 { return (flags & LEGION_VERIFIED_FLAG); }
978 inline bool is_no_access(void) const
979 { return (flags & LEGION_NO_ACCESS_FLAG); }
980 inline bool is_restricted(void) const
981 { return (flags & LEGION_RESTRICTED_FLAG); }
982 LEGION_DEPRECATED("Premapping regions is no longer supported.")
983 inline bool must_premap(void) const
984 { return false; }
985 public:
986 const void* get_projection_args(size_t *size) const;
987 void set_projection_args(const void *args, size_t size, bool own = false);
988 public:
989 bool has_field_privilege(FieldID fid) const;
990 public:
991 // Fields used for controlling task launches
994 std::set<FieldID> privilege_fields;
995 std::vector<FieldID> instance_fields;
996 PrivilegeMode privilege;
997 CoherenceProperty prop;
999 ReductionOpID redop;
1000 MappingTagID tag;
1001 RegionFlags flags;
1002 public:
1003 ProjectionType handle_type;
1004 ProjectionID projection;
1005 public:
1008 };
1009
1079 public:
1080 OutputRequirement(bool valid_requirement = false);
1082 OutputRequirement(FieldSpace field_space,
1083 const std::set<FieldID> &fields,
1084 int dim = 1,
1085 bool global_indexing = false);
1086 public:
1088 ~OutputRequirement(void);
1089 OutputRequirement& operator=(const RegionRequirement &req);
1090 OutputRequirement& operator=(const OutputRequirement &req);
1091 public:
1092 bool operator==(const OutputRequirement &req) const;
1093 bool operator<(const OutputRequirement &req) const;
1094 public:
1095 template <int DIM, typename COORD_T>
1096 void set_type_tag();
1097 // Specifies a projection functor id for this requirement.
1098 // For a projection output requirement, a color space must be specified.
1099 // The projection functor must be a bijective mapping from the launch
1100 // domain to the color space. This implies that the launch domain's
1101 // volume must be the same as the color space's.
1102 void set_projection(ProjectionID projection, IndexSpace color_space);
1103 public:
1104 TypeTag type_tag;
1109 };
1110
1119 public:
1120 IndexSpace handle;
1121 AllocateMode privilege;
1122 IndexSpace parent;
1123 bool verified;
1124 public:
1127 AllocateMode _priv,
1128 IndexSpace _parent,
1129 bool _verified = false);
1130 public:
1131 bool operator<(const IndexSpaceRequirement &req) const;
1132 bool operator==(const IndexSpaceRequirement &req) const;
1133 };
1134
1147 public:
1148 FieldSpace handle;
1149 AllocateMode privilege;
1150 bool verified;
1151 public:
1154 AllocateMode _priv,
1155 bool _verified = false);
1156 public:
1157 bool operator<(const FieldSpaceRequirement &req) const;
1158 bool operator==(const FieldSpaceRequirement &req) const;
1159 };
1160
1161 //==========================================================================
1162 // Future Value Classes
1163 //==========================================================================
1164
1183 class Future : public Unserializable<Future> {
1184 public:
1185 Future(void);
1186 Future(const Future &f);
1187 Future(Future &&f) noexcept;
1188 ~Future(void);
1189 private:
1190 Internal::FutureImpl *impl;
1191 protected:
1192 // Only the runtime should be allowed to make these
1193 FRIEND_ALL_RUNTIME_CLASSES
1194 explicit Future(Internal::FutureImpl *impl);
1195 public:
1196 inline bool exists(void) const { return (impl != NULL); }
1197 inline bool operator==(const Future &f) const
1198 { return impl == f.impl; }
1199 inline bool operator<(const Future &f) const
1200 { return impl < f.impl; }
1201 Future& operator=(const Future &f);
1202 Future& operator=(Future &&f) noexcept;
1203 std::size_t hash(void) const;
1204 public:
1213 template<typename T>
1214 inline T get_result(bool silence_warnings = false,
1215 const char *warning_string = NULL) const;
1221 void get_void_result(bool silence_warnings = false,
1222 const char *warning_string = NULL) const;
1234 bool is_empty(bool block = false, bool silence_warnings = false,
1235 const char *warning_string = NULL) const;
1243 bool is_ready(bool subscribe = false) const;
1244 public:
1259 template<typename T, PrivilegeMode PM = LEGION_READ_ONLY>
1260 Span<T,PM> get_span(Memory::Kind memory,
1261 bool silence_warnings = false,
1262 const char *warning_string = NULL) const;
1263
1277 const void* get_buffer(Memory::Kind memory,
1278 size_t *extent_in_bytes = NULL,
1279 bool check_extent = false,
1280 bool silence_warnings = false,
1281 const char *warning_string = NULL) const;
1282
1290 void get_memories(std::set<Memory> &memories,
1291 bool silence_warnings = false,
1292 const char *warning_string = NULL) const;
1293
1307 template<typename T>
1308 LEGION_DEPRECATED("Use 'Future::get_span' instead")
1309 inline const T& get_reference(bool silence_warnings = false,
1310 const char *warning_string = NULL) const;
1321 LEGION_DEPRECATED("Use 'Future::get_buffer' instead")
1322 inline const void* get_untyped_pointer(bool silence_warnings = false,
1323 const char *warning_string = NULL) const;
1324
1328 size_t get_untyped_size(void) const;
1329
1338 const void* get_metadata(size_t *size = NULL) const;
1339 public:
1340 // These methods provide partial support the C++ future interface
1341 template<typename T>
1342 inline T get(void);
1343
1344 inline bool valid(void) const;
1345
1346 inline void wait(void) const;
1347 public:
1353 template<typename T>
1354 LEGION_DEPRECATED("Use the version without a runtime pointer argument")
1355 static inline Future from_value(Runtime *rt, const T &value);
1356 template<typename T>
1357 static inline Future from_value(const T &value);
1358
1363 LEGION_DEPRECATED("Use the version without a runtime pointer argument")
1364 static Future from_untyped_pointer(Runtime *rt,
1365 const void *buffer, size_t bytes, bool take_ownership = false);
1366 static Future from_untyped_pointer(
1367 const void *buffer, size_t bytes, bool take_ownership = false,
1368 const char *provenance = NULL, bool shard_local = false);
1369 static Future from_value(const void *buffer, size_t bytes, bool owned,
1370 const Realm::ExternalInstanceResource &resource,
1371 void (*freefunc)(const Realm::ExternalInstanceResource&) = NULL,
1372 const char *provenance = NULL, bool shard_local = false);
1373 private:
1374 // This should only be available for accessor classes
1375 template<PrivilegeMode, typename, int, typename, typename, bool>
1376 friend class FieldAccessor;
1377 Realm::RegionInstance get_instance(Memory::Kind kind,
1378 size_t field_size, bool check_field_size,
1379 const char *warning_string, bool silence_warnings) const;
1380 void report_incompatible_accessor(const char *accessor_kind,
1381 Realm::RegionInstance instance) const;
1382 };
1383
1398 public:
1399 FutureMap(void);
1400 FutureMap(const FutureMap &map);
1401 FutureMap(FutureMap &&map) noexcept;
1402 ~FutureMap(void);
1403 private:
1404 Internal::FutureMapImpl *impl;
1405 protected:
1406 // Only the runtime should be allowed to make these
1407 FRIEND_ALL_RUNTIME_CLASSES
1408 explicit FutureMap(Internal::FutureMapImpl *impl);
1409 public:
1410 inline bool exists(void) const { return (impl != NULL); }
1411 inline bool operator==(const FutureMap &f) const
1412 { return impl == f.impl; }
1413 inline bool operator<(const FutureMap &f) const
1414 { return impl < f.impl; }
1415 inline Future operator[](const DomainPoint &point) const
1416 { return get_future(point); }
1417 FutureMap& operator=(const FutureMap &f);
1418 FutureMap& operator=(FutureMap &&f) noexcept;
1419 std::size_t hash(void) const;
1420 public:
1429 template<typename T>
1430 inline T get_result(const DomainPoint &point,
1431 bool silence_warnings = false,
1432 const char *warning_string = NULL) const;
1440 Future get_future(const DomainPoint &point) const;
1448 void get_void_result(const DomainPoint &point,
1449 bool silence_warnings = false,
1450 const char *warning_string = NULL) const;
1451 public:
1459 template<typename RT, typename PT, unsigned DIM>
1460 inline RT get_result(const PT point[DIM]) const;
1469 template<typename PT, unsigned DIM>
1470 inline Future get_future(const PT point[DIM]) const;
1476 template<typename PT, unsigned DIM>
1477 inline void get_void_result(const PT point[DIM]) const;
1478 public:
1485 void wait_all_results(bool silence_warnings = false,
1486 const char *warning_string = NULL) const;
1487 public:
1494 };
1495
1496
1497 //==========================================================================
1498 // Operation Launcher Classes
1499 //==========================================================================
1500
1509 struct StaticDependence : public Unserializable<StaticDependence> {
1510 public:
1511 StaticDependence(void);
1512 StaticDependence(unsigned previous_offset,
1513 unsigned previous_req_index,
1514 unsigned current_req_index,
1515 DependenceType dtype,
1516 bool validates = false,
1517 bool shard_only = false);
1518 public:
1519 inline void add_field(FieldID fid);
1520 public:
1521 // The relative offset from this operation to
1522 // previous operation in the stream of operations
1523 // (e.g. 1 is the operation launched immediately before)
1524 unsigned previous_offset;
1525 // Region requirement of the previous operation for the dependence
1526 unsigned previous_req_index;
1527 // Region requirement of the current operation for the dependence
1528 unsigned current_req_index;
1529 // The type of the dependence
1530 DependenceType dependence_type;
1531 // Whether this requirement validates the previous writer
1532 bool validates;
1533 // Whether this dependence is a shard-only dependence for
1534 // control replication or it depends on all other copies
1535 bool shard_only;
1536 // Fields that have the dependence
1537 std::set<FieldID> dependent_fields;
1538 };
1539
1548 public:
1549 TaskLauncher(void);
1550 TaskLauncher(TaskID tid,
1551 UntypedBuffer arg,
1552 Predicate pred = Predicate::TRUE_PRED,
1553 MapperID id = 0,
1554 MappingTagID tag = 0,
1555 UntypedBuffer map_arg = UntypedBuffer(),
1556 const char *provenance = "");
1557 public:
1558 inline IndexSpaceRequirement&
1559 add_index_requirement(const IndexSpaceRequirement &req);
1560 inline RegionRequirement&
1561 add_region_requirement(const RegionRequirement &req);
1562 inline void add_field(unsigned idx, FieldID fid, bool inst = true);
1563 public:
1564 inline void add_future(Future f);
1565 inline void add_grant(Grant g);
1566 inline void add_wait_barrier(PhaseBarrier bar);
1567 inline void add_arrival_barrier(PhaseBarrier bar);
1568 inline void add_wait_handshake(LegionHandshake handshake);
1569 inline void add_arrival_handshake(LegionHandshake handshake);
1570 public:
1571 inline void set_predicate_false_future(Future f);
1572 inline void set_predicate_false_result(UntypedBuffer arg);
1573 public:
1574 inline void set_independent_requirements(bool independent);
1575 public:
1576 TaskID task_id;
1577 std::vector<IndexSpaceRequirement> index_requirements;
1578 std::vector<RegionRequirement> region_requirements;
1579 std::vector<Future> futures;
1580 std::vector<Grant> grants;
1581 std::vector<PhaseBarrier> wait_barriers;
1582 std::vector<PhaseBarrier> arrive_barriers;
1583 UntypedBuffer argument;
1584 Predicate predicate;
1585 MapperID map_id;
1586 MappingTagID tag;
1587 UntypedBuffer map_arg;
1588 DomainPoint point;
1589 // Only used in control replication contexts for
1590 // doing sharding. If left unspecified the runtime
1591 // will use an index space of size 1 containing 'point'
1592 IndexSpace sharding_space;
1593 public:
1594 // If the predicate is set to anything other than
1595 // Predicate::TRUE_PRED, then the application must
1596 // specify a value for the future in the case that
1597 // the predicate resolves to false. UntypedBuffer(NULL,0)
1598 // can be used if the task's return type is void.
1599 Future predicate_false_future;
1600 UntypedBuffer predicate_false_result;
1601 public:
1602 // Provenance string for the runtime and tools to use
1603 std::string provenance;
1604 public:
1605 // Inform the runtime about any static dependences
1606 // These will be ignored outside of static traces
1607 const std::vector<StaticDependence> *static_dependences;
1608 public:
1609 // Users can tell the runtime this task is eligible
1610 // for inlining by the mapper. This will invoke the
1611 // select_task_options call inline as part of the launch
1612 // logic for this task to allow the mapper to decide
1613 // whether to inline the task or not. Note that if the
1614 // mapper pre-empts during execution then resuming it
1615 // may take a long time if another long running task
1616 // gets scheduled on the processor that launched this task.
1617 bool enable_inlining;
1618 public:
1619 // In some cases users (most likely compilers) will want
1620 // to run a light-weight function (e.g. a continuation)
1621 // as a task that just depends on futures once those futures
1622 // are ready on a local processor where the parent task
1623 // is executing. We call this a local function task and it
1624 // must not have any region requirements. It must als be a
1625 // pure function with no side effects. This task will
1626 // not have the option of being distributed to remote nodes.
1627 bool local_function_task;
1628 public:
1629 // Users can inform the runtime that all region requirements
1630 // are independent of each other in this task. Independent
1631 // means that either field sets are independent or region
1632 // requirements are disjoint based on the region tree.
1633 bool independent_requirements;
1634 public:
1635 // Instruct the runtime that it does not need to produce
1636 // a future or future map result for this index task
1637 bool elide_future_return;
1638 public:
1639 bool silence_warnings;
1640 };
1641
1651 public:
1652 IndexTaskLauncher(void);
1653 IndexTaskLauncher(TaskID tid,
1654 Domain domain,
1655 UntypedBuffer global_arg,
1656 ArgumentMap map,
1657 Predicate pred = Predicate::TRUE_PRED,
1658 bool must = false,
1659 MapperID id = 0,
1660 MappingTagID tag = 0,
1661 UntypedBuffer map_arg = UntypedBuffer(),
1662 const char *provenance = "");
1663 IndexTaskLauncher(TaskID tid,
1664 IndexSpace launch_space,
1665 UntypedBuffer global_arg,
1666 ArgumentMap map,
1667 Predicate pred = Predicate::TRUE_PRED,
1668 bool must = false,
1669 MapperID id = 0,
1670 MappingTagID tag = 0,
1671 UntypedBuffer map_arg = UntypedBuffer(),
1672 const char *provenance = "");
1673 public:
1674 inline IndexSpaceRequirement&
1675 add_index_requirement(const IndexSpaceRequirement &req);
1676 inline RegionRequirement&
1677 add_region_requirement(const RegionRequirement &req);
1678 inline void add_field(unsigned idx, FieldID fid, bool inst = true);
1679 public:
1680 inline void add_future(Future f);
1681 inline void add_grant(Grant g);
1682 inline void add_wait_barrier(PhaseBarrier bar);
1683 inline void add_arrival_barrier(PhaseBarrier bar);
1684 inline void add_wait_handshake(LegionHandshake handshake);
1685 inline void add_arrival_handshake(LegionHandshake handshake);
1686 public:
1687 inline void set_predicate_false_future(Future f);
1688 inline void set_predicate_false_result(UntypedBuffer arg);
1689 public:
1690 inline void set_independent_requirements(bool independent);
1691 public:
1692 TaskID task_id;
1693 Domain launch_domain;
1694 IndexSpace launch_space;
1695 // Will only be used in control replication context. If left
1696 // unset the runtime will use launch_domain/launch_space
1697 IndexSpace sharding_space;
1698 std::vector<IndexSpaceRequirement> index_requirements;
1699 std::vector<RegionRequirement> region_requirements;
1700 std::vector<Future> futures;
1701 // These are appended to the futures for the point
1702 // task after the futures sent to all points above
1703 std::vector<ArgumentMap> point_futures;
1704 std::vector<Grant> grants;
1705 std::vector<PhaseBarrier> wait_barriers;
1706 std::vector<PhaseBarrier> arrive_barriers;
1707 UntypedBuffer global_arg;
1708 ArgumentMap argument_map;
1709 Predicate predicate;
1710 // Specify that all the point tasks in this index launch be
1711 // able to run concurrently, meaning they all must map to
1712 // different processors and they cannot have interfering region
1713 // requirements that might lead to dependences. Note that the
1714 // runtime guarantees that concurrent index launches will not
1715 // deadlock with other concurrent index launches which requires
1716 // additional analysis. Currently concurrent index space launches
1717 // will only be allowed to map to leaf task variants currently.
1718 bool concurrent;
1719 // This will convert this index space launch into a must
1720 // epoch launch which supports interfering region requirements
1721 bool must_parallelism;
1722 MapperID map_id;
1723 MappingTagID tag;
1724 UntypedBuffer map_arg;
1725 public:
1726 // If the predicate is set to anything other than
1727 // Predicate::TRUE_PRED, then the application must
1728 // specify a value for the future in the case that
1729 // the predicate resolves to false. UntypedBuffer(NULL,0)
1730 // can be used if the task's return type is void.
1731 Future predicate_false_future;
1732 UntypedBuffer predicate_false_result;
1733 public:
1734 // Provenance string for the runtime and tools to use
1735 std::string provenance;
1736 public:
1737 // Inform the runtime about any static dependences
1738 // These will be ignored outside of static traces
1739 const std::vector<StaticDependence> *static_dependences;
1740 public:
1741 // Users can tell the runtime this task is eligible
1742 // for inlining by the mapper. This will invoke the
1743 // select_task_options call inline as part of the launch
1744 // logic for this task to allow the mapper to decide
1745 // whether to inline the task or not. Note that if the
1746 // mapper pre-empts during execution then resuming it
1747 // may take a long time if another long running task
1748 // gets scheduled on the processor that launched this task.
1749 bool enable_inlining;
1750 public:
1751 // Users can inform the runtime that all region requirements
1752 // are independent of each other in this task. Independent
1753 // means that either field sets are independent or region
1754 // requirements are disjoint based on the region tree.
1755 bool independent_requirements;
1756 public:
1757 // Instruct the runtime that it does not need to produce
1758 // a future or future map result for this index task
1759 bool elide_future_return;
1760 public:
1761 bool silence_warnings;
1762 public:
1763 // Initial value for reduction
1764 Future initial_value;
1765 };
1766
1776 public:
1777 InlineLauncher(void);
1779 MapperID id = 0,
1780 MappingTagID tag = 0,
1781 LayoutConstraintID layout_id = 0,
1782 UntypedBuffer map_arg = UntypedBuffer(),
1783 const char *provenance = "");
1784 public:
1785 inline void add_field(FieldID fid, bool inst = true);
1786 public:
1787 inline void add_grant(Grant g);
1788 inline void add_wait_barrier(PhaseBarrier bar);
1789 inline void add_arrival_barrier(PhaseBarrier bar);
1790 inline void add_wait_handshake(LegionHandshake handshake);
1791 inline void add_arrival_handshake(LegionHandshake handshake);
1792 public:
1793 RegionRequirement requirement;
1794 std::vector<Grant> grants;
1795 std::vector<PhaseBarrier> wait_barriers;
1796 std::vector<PhaseBarrier> arrive_barriers;
1797 MapperID map_id;
1798 MappingTagID tag;
1799 UntypedBuffer map_arg;
1800 public:
1801 LayoutConstraintID layout_constraint_id;
1802 public:
1803 // Provenance string for the runtime and tools to use
1804 std::string provenance;
1805 public:
1806 // Inform the runtime about any static dependences
1807 // These will be ignored outside of static traces
1808 const std::vector<StaticDependence> *static_dependences;
1809 };
1810
1836 public:
1837 CopyLauncher(Predicate pred = Predicate::TRUE_PRED,
1838 MapperID id = 0, MappingTagID tag = 0,
1839 UntypedBuffer map_arg = UntypedBuffer(),
1840 const char *provenance = "");
1841 public:
1842 inline unsigned add_copy_requirements(const RegionRequirement &src,
1843 const RegionRequirement &dst);
1844 inline void add_src_field(unsigned idx, FieldID fid, bool inst = true);
1845 inline void add_dst_field(unsigned idx, FieldID fid, bool inst = true);
1846 public:
1847 // Specify src/dst indirect requirements (must have exactly 1 field)
1848 inline void add_src_indirect_field(FieldID src_idx_fid,
1849 const RegionRequirement &src_idx_req,
1850 bool is_range_indirection = false,
1851 bool inst = true);
1852 inline void add_dst_indirect_field(FieldID dst_idx_fid,
1853 const RegionRequirement &dst_idx_req,
1854 bool is_range_indirection = false,
1855 bool inst = true);
1856 inline RegionRequirement& add_src_indirect_field(
1857 const RegionRequirement &src_idx_req,
1858 bool is_range_indirection = false);
1859 inline RegionRequirement& add_dst_indirect_field(
1860 const RegionRequirement &dst_idx_req,
1861 bool is_range_indirection = false);
1862 public:
1863 inline void add_grant(Grant g);
1864 inline void add_wait_barrier(PhaseBarrier bar);
1865 inline void add_arrival_barrier(PhaseBarrier bar);
1866 inline void add_wait_handshake(LegionHandshake handshake);
1867 inline void add_arrival_handshake(LegionHandshake handshake);
1868 public:
1869 std::vector<RegionRequirement> src_requirements;
1870 std::vector<RegionRequirement> dst_requirements;
1871 std::vector<RegionRequirement> src_indirect_requirements;
1872 std::vector<RegionRequirement> dst_indirect_requirements;
1873 std::vector<bool> src_indirect_is_range;
1874 std::vector<bool> dst_indirect_is_range;
1875 std::vector<Grant> grants;
1876 std::vector<PhaseBarrier> wait_barriers;
1877 std::vector<PhaseBarrier> arrive_barriers;
1878 Predicate predicate;
1879 MapperID map_id;
1880 MappingTagID tag;
1881 UntypedBuffer map_arg;
1882 DomainPoint point;
1883 // Only used in control replication contexts for
1884 // doing sharding. If left unspecified the runtime
1885 // will use an index space of size 1 containing 'point'
1886 IndexSpace sharding_space;
1887 public:
1888 // Provenance string for the runtime and tools to use
1889 std::string provenance;
1890 public:
1891 // Inform the runtime about any static dependences
1892 // These will be ignored outside of static traces
1893 const std::vector<StaticDependence> *static_dependences;
1894 public:
1895 // Whether the source and destination indirections can lead
1896 // to out-of-range access into the instances to skip
1897 bool possible_src_indirect_out_of_range;
1898 bool possible_dst_indirect_out_of_range;
1899 // Whether the destination indirection can lead to aliasing
1900 // in the destination instances requiring synchronization
1901 bool possible_dst_indirect_aliasing;
1902 public:
1903 bool silence_warnings;
1904 };
1905
1917 public:
1918 IndexCopyLauncher(void);
1919 IndexCopyLauncher(Domain domain, Predicate pred = Predicate::TRUE_PRED,
1920 MapperID id = 0, MappingTagID tag = 0,
1921 UntypedBuffer map_arg = UntypedBuffer(),
1922 const char *provenance = "");
1923 IndexCopyLauncher(IndexSpace space, Predicate pred = Predicate::TRUE_PRED,
1924 MapperID id = 0, MappingTagID tag = 0,
1925 UntypedBuffer map_arg = UntypedBuffer(),
1926 const char *provenance = "");
1927 public:
1928 inline unsigned add_copy_requirements(const RegionRequirement &src,
1929 const RegionRequirement &dst);
1930 inline void add_src_field(unsigned idx, FieldID fid, bool inst = true);
1931 inline void add_dst_field(unsigned idx, FieldID fid, bool inst = true);
1932 public:
1933 // Specify src/dst indirect requirements (must have exactly 1 field)
1934 inline void add_src_indirect_field(FieldID src_idx_fid,
1935 const RegionRequirement &src_idx_req,
1936 bool is_range_indirection = false,
1937 bool inst = true);
1938 inline void add_dst_indirect_field(FieldID dst_idx_fid,
1939 const RegionRequirement &dst_idx_req,
1940 bool is_range_indirection = false,
1941 bool inst = true);
1942 inline RegionRequirement& add_src_indirect_field(
1943 const RegionRequirement &src_idx_req,
1944 bool is_range_indirection = false);
1945 inline RegionRequirement& add_dst_indirect_field(
1946 const RegionRequirement &dst_idx_req,
1947 bool is_range_indirection = false);
1948 public:
1949 inline void add_grant(Grant g);
1950 inline void add_wait_barrier(PhaseBarrier bar);
1951 inline void add_arrival_barrier(PhaseBarrier bar);
1952 inline void add_wait_handshake(LegionHandshake handshake);
1953 inline void add_arrival_handshake(LegionHandshake handshake);
1954 public:
1955 std::vector<RegionRequirement> src_requirements;
1956 std::vector<RegionRequirement> dst_requirements;
1957 std::vector<RegionRequirement> src_indirect_requirements;
1958 std::vector<RegionRequirement> dst_indirect_requirements;
1959 std::vector<bool> src_indirect_is_range;
1960 std::vector<bool> dst_indirect_is_range;
1961 std::vector<Grant> grants;
1962 std::vector<PhaseBarrier> wait_barriers;
1963 std::vector<PhaseBarrier> arrive_barriers;
1964 Domain launch_domain;
1965 IndexSpace launch_space;
1966 // Will only be used in control replication context. If left
1967 // unset the runtime will use launch_domain/launch_space
1968 IndexSpace sharding_space;
1969 Predicate predicate;
1970 MapperID map_id;
1971 MappingTagID tag;
1972 UntypedBuffer map_arg;
1973 public:
1974 // Provenance string for the runtime and tools to use
1975 std::string provenance;
1976 public:
1977 // Inform the runtime about any static dependences
1978 // These will be ignored outside of static traces
1979 const std::vector<StaticDependence> *static_dependences;
1980 public:
1981 // Whether the source and destination indirections can lead
1982 // to out-of-range access into the instances to skip
1983 bool possible_src_indirect_out_of_range;
1984 bool possible_dst_indirect_out_of_range;
1985 // Whether the destination indirection can lead to aliasing
1986 // in the destination instances requiring synchronization
1987 bool possible_dst_indirect_aliasing;
1988 // Whether the individual point copies should operate collectively
1989 // together in the case of indirect copies (e.g. allow indirections
1990 // to refer to instances from other points). These settings have
1991 // no effect in the case of copies without indirections.
1992 bool collective_src_indirect_points;
1993 bool collective_dst_indirect_points;
1994 public:
1995 bool silence_warnings;
1996 };
1997
2005 public:
2006 FillLauncher(void);
2008 UntypedBuffer arg, Predicate pred = Predicate::TRUE_PRED,
2009 MapperID id = 0, MappingTagID tag = 0,
2010 UntypedBuffer map_arg = UntypedBuffer(),
2011 const char *provenance = "");
2013 Future f, Predicate pred = Predicate::TRUE_PRED,
2014 MapperID id = 0, MappingTagID tag = 0,
2015 UntypedBuffer map_arg = UntypedBuffer(),
2016 const char *provenance = "");
2017 public:
2018 inline void set_argument(UntypedBuffer arg);
2019 inline void set_future(Future f);
2020 inline void add_field(FieldID fid);
2021 inline void add_grant(Grant g);
2022 inline void add_wait_barrier(PhaseBarrier bar);
2023 inline void add_arrival_barrier(PhaseBarrier bar);
2024 inline void add_wait_handshake(LegionHandshake handshake);
2025 inline void add_arrival_handshake(LegionHandshake handshake);
2026 public:
2027 LogicalRegion handle;
2028 LogicalRegion parent;
2029 UntypedBuffer argument;
2030 Future future;
2031 Predicate predicate;
2032 std::set<FieldID> fields;
2033 std::vector<Grant> grants;
2034 std::vector<PhaseBarrier> wait_barriers;
2035 std::vector<PhaseBarrier> arrive_barriers;
2036 MapperID map_id;
2037 MappingTagID tag;
2038 UntypedBuffer map_arg;
2039 DomainPoint point;
2040 // Only used in control replication contexts for
2041 // doing sharding. If left unspecified the runtime
2042 // will use an index space of size 1 containing 'point'
2043 IndexSpace sharding_space;
2044 public:
2045 // Provenance string for the runtime and tools to use
2046 std::string provenance;
2047 public:
2048 // Inform the runtime about any static dependences
2049 // These will be ignored outside of static traces
2050 const std::vector<StaticDependence> *static_dependences;
2051 public:
2052 bool silence_warnings;
2053 };
2054
2065 public:
2066 IndexFillLauncher(void);
2067 // Region projection
2068 IndexFillLauncher(Domain domain, LogicalRegion handle,
2069 LogicalRegion parent, UntypedBuffer arg,
2070 ProjectionID projection = 0,
2071 Predicate pred = Predicate::TRUE_PRED,
2072 MapperID id = 0, MappingTagID tag = 0,
2073 UntypedBuffer map_arg = UntypedBuffer(),
2074 const char *provenance = "");
2075 IndexFillLauncher(Domain domain, LogicalRegion handle,
2076 LogicalRegion parent, Future f,
2077 ProjectionID projection = 0,
2078 Predicate pred = Predicate::TRUE_PRED,
2079 MapperID id = 0, MappingTagID tag = 0,
2080 UntypedBuffer map_arg = UntypedBuffer(),
2081 const char *provenance = "");
2083 LogicalRegion parent, UntypedBuffer arg,
2084 ProjectionID projection = 0,
2085 Predicate pred = Predicate::TRUE_PRED,
2086 MapperID id = 0, MappingTagID tag = 0,
2087 UntypedBuffer map_arg = UntypedBuffer(),
2088 const char *provenance = "");
2090 LogicalRegion parent, Future f,
2091 ProjectionID projection = 0,
2092 Predicate pred = Predicate::TRUE_PRED,
2093 MapperID id = 0, MappingTagID tag = 0,
2094 UntypedBuffer map_arg = UntypedBuffer(),
2095 const char *provenance = "");
2096 // Partition projection
2098 LogicalRegion parent, UntypedBuffer arg,
2099 ProjectionID projection = 0,
2100 Predicate pred = Predicate::TRUE_PRED,
2101 MapperID id = 0, MappingTagID tag = 0,
2102 UntypedBuffer map_arg = UntypedBuffer(),
2103 const char *provenance = "");
2105 LogicalRegion parent, Future f,
2106 ProjectionID projection = 0,
2107 Predicate pred = Predicate::TRUE_PRED,
2108 MapperID id = 0, MappingTagID tag = 0,
2109 UntypedBuffer map_arg = UntypedBuffer(),
2110 const char *provenance = "");
2112 LogicalRegion parent, UntypedBuffer arg,
2113 ProjectionID projection = 0,
2114 Predicate pred = Predicate::TRUE_PRED,
2115 MapperID id = 0, MappingTagID tag = 0,
2116 UntypedBuffer map_arg = UntypedBuffer(),
2117 const char *provenance = "");
2119 LogicalRegion parent, Future f,
2120 ProjectionID projection = 0,
2121 Predicate pred = Predicate::TRUE_PRED,
2122 MapperID id = 0, MappingTagID tag = 0,
2123 UntypedBuffer map_arg = UntypedBuffer(),
2124 const char *provenance = "");
2125 public:
2126 inline void set_argument(UntypedBuffer arg);
2127 inline void set_future(Future f);
2128 inline void add_field(FieldID fid);
2129 inline void add_grant(Grant g);
2130 inline void add_wait_barrier(PhaseBarrier bar);
2131 inline void add_arrival_barrier(PhaseBarrier bar);
2132 inline void add_wait_handshake(LegionHandshake handshake);
2133 inline void add_arrival_handshake(LegionHandshake handshake);
2134 public:
2135 Domain launch_domain;
2136 IndexSpace launch_space;
2137 // Will only be used in control replication context. If left
2138 // unset the runtime will use launch_domain/launch_space
2139 IndexSpace sharding_space;
2140 LogicalRegion region;
2141 LogicalPartition partition;
2142 LogicalRegion parent;
2143 ProjectionID projection;
2144 UntypedBuffer argument;
2145 Future future;
2146 Predicate predicate;
2147 std::set<FieldID> fields;
2148 std::vector<Grant> grants;
2149 std::vector<PhaseBarrier> wait_barriers;
2150 std::vector<PhaseBarrier> arrive_barriers;
2151 MapperID map_id;
2152 MappingTagID tag;
2153 UntypedBuffer map_arg;
2154 public:
2155 // Provenance string for the runtime and tools to use
2156 std::string provenance;
2157 public:
2158 // Inform the runtime about any static dependences
2159 // These will be ignored outside of static traces
2160 const std::vector<StaticDependence> *static_dependences;
2161 public:
2162 bool silence_warnings;
2163 };
2164
2172 public:
2174 public:
2175 inline void add_field(FieldID fid);
2176 public:
2177 LogicalRegion handle;
2178 LogicalRegion parent;
2179 std::set<FieldID> fields;
2180 public:
2181 // Provenance string for the runtime and tools to use
2182 std::string provenance;
2183 public:
2184 // Inform the runtime about any static dependences
2185 // These will be ignored outside of static traces
2186 const std::vector<StaticDependence> *static_dependences;
2187 public:
2188 bool silence_warnings;
2189 };
2190
2213 public:
2214 AttachLauncher(ExternalResource resource,
2215 LogicalRegion handle, LogicalRegion parent,
2216 const bool restricted = true,
2217 const bool mapped = true);
2218 // Declared here to avoid superfluous compiler warnings
2219 // Can be remove after deprecated members are removed
2220 ~AttachLauncher(void);
2221 public:
2222 inline void initialize_constraints(bool column_major, bool soa,
2223 const std::vector<FieldID> &fields,
2224 const std::map<FieldID,size_t> *alignments = NULL);
2225 LEGION_DEPRECATED("Use Realm::ExternalFileResource instead")
2226 inline void attach_file(const char *file_name,
2227 const std::vector<FieldID> &fields,
2228 LegionFileMode mode);
2229 LEGION_DEPRECATED("Use Realm::ExternalHDF5Resource instead")
2230 inline void attach_hdf5(const char *file_name,
2231 const std::map<FieldID,const char*> &field_map,
2232 LegionFileMode mode);
2233 // Helper methods for AOS and SOA arrays, but it is totally
2234 // acceptable to fill in the layout constraint set manually
2235 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
2236 inline void attach_array_aos(void *base, bool column_major,
2237 const std::vector<FieldID> &fields,
2238 Memory memory = Memory::NO_MEMORY,
2239 const std::map<FieldID,size_t> *alignments = NULL);
2240 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
2241 inline void attach_array_soa(void *base, bool column_major,
2242 const std::vector<FieldID> &fields,
2243 Memory memory = Memory::NO_MEMORY,
2244 const std::map<FieldID,size_t> *alignments = NULL);
2245 public:
2246 ExternalResource resource;
2247 LogicalRegion parent;
2248 LogicalRegion handle;
2249 std::set<FieldID> privilege_fields;
2250 public:
2251 // This will be cloned each time you perform an attach with this launcher
2252 const Realm::ExternalInstanceResource* external_resource;
2253 public:
2254 LayoutConstraintSet constraints;
2255 public:
2256 // Whether this instance will be restricted when attached
2257 bool restricted /*= true*/;
2258 // Whether this region should be mapped by the calling task
2259 bool mapped; /*= true*/
2260 // Only matters for control replicated parent tasks
2261 // Indicate whether all the shards are providing the same data
2262 // or whether they are each providing different data
2263 // Collective means that each shard provides its own copy of the
2264 // data and non-collective means every shard provides the same data
2265 // Defaults to 'true' for external instances and 'false' for files
2266 bool collective;
2267 // For collective cases, indicate whether the runtime should
2268 // deduplicate data across shards in the same process
2269 // This is useful for cases where there is one file or external
2270 // instance per process but multiple shards per process
2271 bool deduplicate_across_shards;
2272 public:
2273 // Provenance string for the runtime and tools to use
2274 std::string provenance;
2275 public:
2276 // Data for files
2277 LEGION_DEPRECATED("file_name is deprecated, use external_resource")
2278 const char *file_name;
2279 LEGION_DEPRECATED("mode is deprecated, use external_resource")
2280 LegionFileMode mode;
2281 LEGION_DEPRECATED("file_fields is deprecated, use external_resource")
2282 std::vector<FieldID> file_fields; // normal files
2283 // This member must still be populated if you're attaching to an HDF5 file
2284 std::map<FieldID,/*file name*/const char*> field_files; // hdf5 files
2285 public:
2286 // Optional footprint of the instance in memory in bytes
2287 size_t footprint;
2288 public:
2289 // Inform the runtime about any static dependences
2290 // These will be ignored outside of static traces
2291 const std::vector<StaticDependence> *static_dependences;
2292 };
2293
2305 public:
2306 IndexAttachLauncher(ExternalResource resource,
2307 LogicalRegion parent,
2308 const bool restricted = true);
2309 // Declared here to avoid superfluous compiler warnings
2310 // Can be remove after deprecated members are removed
2312 public:
2313 inline void initialize_constraints(bool column_major, bool soa,
2314 const std::vector<FieldID> &fields,
2315 const std::map<FieldID,size_t> *alignments = NULL);
2316 inline void add_external_resource(LogicalRegion handle,
2317 const Realm::ExternalInstanceResource *resource);
2318 LEGION_DEPRECATED("Use Realm::ExternalFileResource instead")
2319 inline void attach_file(LogicalRegion handle,
2320 const char *file_name,
2321 const std::vector<FieldID> &fields,
2322 LegionFileMode mode);
2323 LEGION_DEPRECATED("Use Realm::ExternalHDF5Resource instead")
2324 inline void attach_hdf5(LogicalRegion handle,
2325 const char *file_name,
2326 const std::map<FieldID,const char*> &field_map,
2327 LegionFileMode mode);
2328 // Helper methods for AOS and SOA arrays, but it is totally
2329 // acceptable to fill in the layout constraint set manually
2330 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
2331 inline void attach_array_aos(LogicalRegion handle,
2332 void *base, bool column_major,
2333 const std::vector<FieldID> &fields,
2334 Memory memory = Memory::NO_MEMORY,
2335 const std::map<FieldID,size_t> *alignments = NULL);
2336 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
2337 inline void attach_array_soa(LogicalRegion handle,
2338 void *base, bool column_major,
2339 const std::vector<FieldID> &fields,
2340 Memory memory = Memory::NO_MEMORY,
2341 const std::map<FieldID,size_t> *alignments = NULL);
2342 public:
2343 ExternalResource resource;
2344 LogicalRegion parent;
2345 std::set<FieldID> privilege_fields;
2346 std::vector<LogicalRegion> handles;
2347 // This is the vector external resource objects that are going to
2348 // attached to the vector of logical region handles
2349 // These will be cloned each time you perform an attach with this launcher
2350 std::vector<const Realm::ExternalInstanceResource*> external_resources;
2351 public:
2352 LayoutConstraintSet constraints;
2353 public:
2354 // Whether these instances will be restricted when attached
2355 bool restricted /*= true*/;
2356 // Whether the runtime should check for duplicate resources across
2357 // the shards in a control replicated context, it is illegal to pass
2358 // in the same resource to different shards if this is set to false
2359 bool deduplicate_across_shards;
2360 public:
2361 // Provenance string for the runtime and tools to use
2362 std::string provenance;
2363 public:
2364 // Data for files
2365 LEGION_DEPRECATED("mode is deprecated, use external_resources")
2366 LegionFileMode mode;
2367 LEGION_DEPRECATED("file_names is deprecated, use external_resources")
2368 std::vector<const char*> file_names;
2369 LEGION_DEPRECATED("file_fields is deprecated, use external_resources")
2370 std::vector<FieldID> file_fields; // normal files
2371 // This data structure must still be filled in for using HDF5 files
2372 std::map<FieldID,
2373 std::vector</*file name*/const char*> > field_files; // hdf5 files
2374 public:
2375 // Data for external instances
2376 LEGION_DEPRECATED("pointers is deprecated, use external_resources")
2377 std::vector<PointerConstraint> pointers;
2378 public:
2379 // Optional footprint of the instance in memory in bytes
2380 // You only need to fill this in when using depcreated fields
2381 std::vector<size_t> footprint;
2382 public:
2383 // Inform the runtime about any static dependences
2384 // These will be ignored outside of static traces
2385 const std::vector<StaticDependence> *static_dependences;
2386 };
2387
2395 public:
2396 explicit PredicateLauncher(bool and_op = true);
2397 public:
2398 inline void add_predicate(const Predicate &pred);
2399 public:
2400 bool and_op; // if not 'and' then 'or'
2401 std::vector<Predicate> predicates;
2402 std::string provenance;
2403 };
2404
2411 public:
2412 TimingLauncher(TimingMeasurement measurement);
2413 public:
2414 inline void add_precondition(const Future &f);
2415 public:
2416 TimingMeasurement measurement;
2417 std::set<Future> preconditions;
2418 public:
2419 // Provenance string for the runtime and tools to use
2420 std::string provenance;
2421 };
2422
2429 public:
2430 TunableLauncher(TunableID tid,
2431 MapperID mapper = 0,
2432 MappingTagID tag = 0,
2433 size_t return_type_size = SIZE_MAX);
2434 public:
2435 TunableID tunable;
2436 MapperID mapper;
2437 MappingTagID tag;
2438 UntypedBuffer arg;
2439 std::vector<Future> futures;
2440 size_t return_type_size;
2441 public:
2442 // Provenance string for the runtime and tools to use
2443 std::string provenance;
2444 };
2445
2446 //==========================================================================
2447 // Task Variant Registrars
2448 //==========================================================================
2449
2461 public:
2464 const char *layout_name = NULL);
2465 public:
2467 add_constraint(const SpecializedConstraint &constraint);
2469 add_constraint(const MemoryConstraint &constraint);
2471 add_constraint(const OrderingConstraint &constraint);
2473 add_constraint(const TilingConstraint &constraint);
2475 add_constraint(const FieldConstraint &constraint);
2477 add_constraint(const DimensionConstraint &constraint);
2479 add_constraint(const AlignmentConstraint &constraint);
2481 add_constraint(const OffsetConstraint &constraint);
2483 add_constraint(const PointerConstraint &constraint);
2485 add_constraint(const PaddingConstraint &constraint);
2486 public:
2487 FieldSpace handle;
2488 LayoutConstraintSet layout_constraints;
2489 const char* layout_name;
2490 };
2491
2497 struct PoolBounds {
2498 public:
2499 PoolBounds(UnboundPoolScope s)
2500 : size(0), alignment(0), scope(s) { }
2501 PoolBounds(size_t s = 0, uint32_t a = 16)
2502 : size(s), alignment(a), scope(LEGION_BOUNDED_POOL) { }
2503 PoolBounds(const PoolBounds&) = default;
2504 PoolBounds(PoolBounds&&) = default;
2505 PoolBounds& operator=(const PoolBounds&) = default;
2506 PoolBounds& operator=(PoolBounds&&) = default;
2507 public:
2508 size_t size; // upper bound of the pool in bytes
2509 uint32_t alignment; // maximum alignment supported
2510 UnboundPoolScope scope; // scope for unbound pools
2511 };
2512
2522 public:
2524 TaskVariantRegistrar(TaskID task_id, bool global = true,
2525 const char *variant_name = NULL);
2526 TaskVariantRegistrar(TaskID task_id, const char *variant_name,
2527 bool global = true);
2528 public: // Add execution constraints
2529 inline TaskVariantRegistrar&
2530 add_constraint(const ISAConstraint &constraint);
2531 inline TaskVariantRegistrar&
2532 add_constraint(const ProcessorConstraint &constraint);
2533 inline TaskVariantRegistrar&
2534 add_constraint(const ResourceConstraint &constraint);
2535 inline TaskVariantRegistrar&
2536 add_constraint(const LaunchConstraint &constraint);
2537 inline TaskVariantRegistrar&
2538 add_constraint(const ColocationConstraint &constraint);
2539 public: // Add layout constraint sets
2540 inline TaskVariantRegistrar&
2541 add_layout_constraint_set(unsigned index, LayoutConstraintID desc);
2542 public: // Set properties
2543 inline void set_leaf(bool is_leaf = true);
2544 inline void set_inner(bool is_inner = true);
2545 inline void set_idempotent(bool is_idempotent = true);
2546 inline void set_replicable(bool is_replicable = true);
2547 inline void set_concurrent(bool is_concurrent = true);
2548 inline void set_concurrent_barrier(bool needs_barrier = true);
2549 public: // Generator Task IDs
2550 inline void add_generator_task(TaskID tid);
2551 public:
2552 TaskID task_id;
2553 bool global_registration;
2554 const char* task_variant_name;
2555 public: // constraints
2556 ExecutionConstraintSet execution_constraints;
2557 TaskLayoutConstraintSet layout_constraints;
2558 public:
2559 // If this is a leaf task variant then the application can
2560 // request that the runtime preserve a pool in the memory of
2561 // the corresponding kind with the closest affinity to the target
2562 // processor for handling dynamic memory allocations during the
2563 // execution of the task. Pool bounds can also be set to request
2564 // an unbounded pool allocation. Note that requesting an unbound
2565 // memory allocation will likely result in severe performance degradation.
2566 std::map<Memory::Kind,PoolBounds> leaf_pool_bounds;
2567 public:
2568 // TaskIDs for which this variant can serve as a generator
2569 std::set<TaskID> generator_tasks;
2570 public: // properties
2571 bool leaf_variant;
2572 bool inner_variant;
2573 bool idempotent_variant;
2574 bool replicable_variant;
2575 bool concurrent_variant;
2576 bool concurrent_barrier;
2577 };
2578
2579 //==========================================================================
2580 // Physical Data Classes
2581 //==========================================================================
2582
2591 class PhysicalRegion : public Unserializable<PhysicalRegion> {
2592 public:
2593 PhysicalRegion(void);
2594 PhysicalRegion(const PhysicalRegion &rhs);
2595 PhysicalRegion(PhysicalRegion &&rhs) noexcept;
2596 ~PhysicalRegion(void);
2597 private:
2598 Internal::PhysicalRegionImpl *impl;
2599 protected:
2600 FRIEND_ALL_RUNTIME_CLASSES
2601 explicit PhysicalRegion(Internal::PhysicalRegionImpl *impl);
2602 public:
2603 PhysicalRegion& operator=(const PhysicalRegion &rhs);
2604 PhysicalRegion& operator=(PhysicalRegion &&rhs) noexcept;
2605 inline bool exists(void) const { return (impl != NULL); }
2606 inline bool operator==(const PhysicalRegion &reg) const
2607 { return (impl == reg.impl); }
2608 inline bool operator<(const PhysicalRegion &reg) const
2609 { return (impl < reg.impl); }
2610 std::size_t hash(void) const;
2611 public:
2615 bool is_mapped(void) const;
2623 void wait_until_valid(bool silence_warnings = false,
2624 const char *warning_string = NULL);
2631 bool is_valid(void) const;
2639 PrivilegeMode get_privilege(void) const;
2643 void get_memories(std::set<Memory>& memories,
2644 bool silence_warnings = false,
2645 const char *warning_string = NULL) const;
2649 void get_fields(std::vector<FieldID>& fields) const;
2650 public:
2651 template<int DIM, typename COORD_T>
2652 DomainT<DIM,COORD_T> get_bounds(void) const;
2653 // We'll also allow this to implicitly cast to a realm index space
2654 // so that users can easily iterate over the points
2655 template<int DIM, typename COORD_T>
2656 operator DomainT<DIM,COORD_T>(void) const;
2657 // They can implicitly cast to a rectangle if there is no
2658 // sparsity map, runtime will check for this
2659 template<int DIM, typename COORD_T>
2660 operator Rect<DIM,COORD_T>(void) const;
2661 protected:
2662 // These methods can only be accessed by accessor classes
2663 template<PrivilegeMode, typename, int, typename, typename, bool>
2664 friend class FieldAccessor;
2665 template<typename, bool, int, typename, typename, bool>
2666 friend class ReductionAccessor;
2667 template<typename, int, typename, typename, bool, bool, int>
2668 friend class MultiRegionAccessor;
2669 template<typename, int, typename, typename, bool>
2670 friend class PaddingAccessor;
2671 template<typename, int, typename, typename>
2672 friend class UnsafeFieldAccessor;
2673 template<typename, PrivilegeMode>
2674 friend class ArraySyntax::AccessorRefHelper;
2675 template<typename>
2676 friend class ArraySyntax::AffineRefHelper;
2677 friend class PieceIterator;
2678 template<PrivilegeMode, typename, int, typename>
2679 friend class SpanIterator;
2680 template<typename, int, typename>
2681 friend class UnsafeSpanIterator;
2682 Realm::RegionInstance get_instance_info(PrivilegeMode mode,
2683 FieldID fid, size_t field_size,
2684 void *realm_is, TypeTag type_tag,
2685 const char *warning_string,
2686 bool silence_warnings,
2687 bool generic_accessor,
2688 bool check_field_size,
2689 ReductionOpID redop = 0) const;
2690 Realm::RegionInstance get_instance_info(PrivilegeMode mode,
2691 const std::vector<PhysicalRegion> &other_regions,
2692 FieldID fid, size_t field_size,
2693 void *realm_is, TypeTag type_tag,
2694 const char *warning_string,
2695 bool silence_warnings,
2696 bool generic_accessor,
2697 bool check_field_size,
2698 bool need_bounds,
2699 ReductionOpID redop = 0) const;
2700 Realm::RegionInstance get_padding_info(FieldID fid, size_t field_size,
2701 Domain *inner, Domain &outer,
2702 const char *warning_string,
2703 bool silence_warnings,
2704 bool generic_accessor,
2705 bool check_field_size) const;
2706 void report_incompatible_accessor(const char *accessor_kind,
2707 Realm::RegionInstance instance, FieldID fid) const;
2708 void report_incompatible_multi_accessor(unsigned index, FieldID fid,
2709 Realm::RegionInstance inst1,
2710 Realm::RegionInstance inst2) const;
2711 void report_colocation_violation(const char *accessor_kind, FieldID fid,
2712 Realm::RegionInstance inst1,
2713 Realm::RegionInstance inst2,
2714 const PhysicalRegion &other,
2715 bool reduction = false) const;
2716 static void empty_colocation_regions(const char *accessor_kind,
2717 FieldID fid, bool reduction = false);
2718 static void fail_bounds_check(DomainPoint p, FieldID fid,
2719 PrivilegeMode mode, bool multi = false);
2720 static void fail_bounds_check(Domain d, FieldID fid,
2721 PrivilegeMode mode, bool multi = false);
2722 static void fail_privilege_check(DomainPoint p, FieldID fid,
2723 PrivilegeMode mode);
2724 static void fail_privilege_check(Domain d, FieldID fid,
2725 PrivilegeMode mode);
2726 static void fail_padding_check(DomainPoint p, FieldID fid);
2727 protected:
2728 void get_bounds(void *realm_is, TypeTag type_tag) const;
2729 };
2730
2738 class ExternalResources : public Unserializable<ExternalResources> {
2739 public:
2740 ExternalResources(void);
2742 ExternalResources(ExternalResources &&rhs) noexcept;
2743 ~ExternalResources(void);
2744 private:
2745 Internal::ExternalResourcesImpl *impl;
2746 protected:
2747 FRIEND_ALL_RUNTIME_CLASSES
2748 explicit ExternalResources(Internal::ExternalResourcesImpl *impl);
2749 public:
2750 ExternalResources& operator=(const ExternalResources &rhs);
2751 ExternalResources& operator=(ExternalResources &&rhs) noexcept;
2752 inline bool exists(void) const { return (impl != NULL); }
2753 inline bool operator==(const ExternalResources &reg) const
2754 { return (impl == reg.impl); }
2755 inline bool operator<(const ExternalResources &reg) const
2756 { return (impl < reg.impl); }
2757 public:
2758 size_t size(void) const;
2759 PhysicalRegion operator[](unsigned index) const;
2760 };
2761
2799 template<PrivilegeMode MODE, typename FT, int N, typename COORD_T = coord_t,
2800 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
2801#ifdef LEGION_BOUNDS_CHECKS
2802 bool CHECK_BOUNDS = true>
2803#else
2804 bool CHECK_BOUNDS = false>
2805#endif
2807 private:
2808 static_assert(N > 0, "N must be positive");
2809 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
2810 public:
2811 FieldAccessor(void) { }
2812 FieldAccessor(const PhysicalRegion &region, FieldID fid,
2813 // The actual field size in case it is different from the
2814 // one being used in FT and we still want to check it
2815 size_t actual_field_size = sizeof(FT),
2816#ifdef DEBUG_LEGION
2817 bool check_field_size = true,
2818#else
2819 bool check_field_size = false,
2820#endif
2821 bool silence_warnings = false,
2822 const char *warning_string = NULL,
2823 size_t subfield_offset = 0) { }
2824 // For Realm::AffineAccessor specializations there are additional
2825 // methods for creating accessors with limited bounding boxes and
2826 // affine transformations for using alternative coordinates spaces
2827 // Specify a specific bounds rectangle to use for the accessor
2828 FieldAccessor(const PhysicalRegion &region, FieldID fid,
2829 const Rect<N,COORD_T> bounds,
2830 // The actual field size in case it is different from the
2831 // one being used in FT and we still want to check it
2832 size_t actual_field_size = sizeof(FT),
2833#ifdef DEBUG_LEGION
2834 bool check_field_size = true,
2835#else
2836 bool check_field_size = false,
2837#endif
2838 bool silence_warnings = false,
2839 const char *warning_string = NULL,
2840 size_t subfield_offset = 0) { }
2841 // Specify a specific Affine transform to use for interpreting points
2842 // Not avalable for Realm::MultiAffineAccessor specializations
2843 template<int M>
2844 FieldAccessor(const PhysicalRegion &region, FieldID fid,
2845 const AffineTransform<M,N,COORD_T> transform,
2846 // The actual field size in case it is different from the
2847 // one being used in FT and we still want to check it
2848 size_t actual_field_size = sizeof(FT),
2849#ifdef DEBUG_LEGION
2850 bool check_field_size = true,
2851#else
2852 bool check_field_size = false,
2853#endif
2854 bool silence_warnings = false,
2855 const char *warning_string = NULL,
2856 size_t subfield_offset = 0) { }
2857 // Specify both a transform and a bounds to use
2858 // Not avalable for Realm::MultiAffineAccessor specializations
2859 template<int M>
2860 FieldAccessor(const PhysicalRegion &region, FieldID fid,
2861 const AffineTransform<M,N,COORD_T> transform,
2862 const Rect<N,COORD_T> bounds,
2863 // The actual field size in case it is different from the
2864 // one being used in FT and we still want to check it
2865 size_t actual_field_size = sizeof(FT),
2866#ifdef DEBUG_LEGION
2867 bool check_field_size = true,
2868#else
2869 bool check_field_size = false,
2870#endif
2871 bool silence_warnings = false,
2872 const char *warning_string = NULL,
2873 size_t subfield_offset = 0) { }
2874 // Create a field accessor for a Future
2875 // (only with READ-ONLY privileges and AffineAccessors)
2876 FieldAccessor(const Future &future,
2877 Memory::Kind kind = Memory::NO_MEMKIND,
2878 // The actual field size in case it is different from the
2879 // one being used in FT and we still want to check it
2880 size_t actual_field_size = sizeof(FT),
2881#ifdef DEBUG_LEGION
2882 bool check_field_size = true,
2883#else
2884 bool check_field_size = false,
2885#endif
2886 bool silence_warnings = false,
2887 const char *warning_string = NULL,
2888 size_t subfield_offset = 0) { }
2889 // Create a field accessor for a Future
2890 // (only with READ-ONLY privileges and AffineAccessors)
2891 FieldAccessor(const Future &future,
2892 const Rect<N,COORD_T> bounds,
2893 Memory::Kind kind = Memory::NO_MEMKIND,
2894 // The actual field size in case it is different from the
2895 // one being used in FT and we still want to check it
2896 size_t actual_field_size = sizeof(FT),
2897#ifdef DEBUG_LEGION
2898 bool check_field_size = true,
2899#else
2900 bool check_field_size = false,
2901#endif
2902 bool silence_warnings = false,
2903 const char *warning_string = NULL,
2904 size_t subfield_offset = 0) { }
2905 public:
2906 // Variations of the above four methods but with multiple physical
2907 // regions specified using input iterators for colocation regions
2908 // Colocation regions from [start, stop)
2909 template<typename InputIterator>
2910 FieldAccessor(InputIterator start_region,
2911 InputIterator stop_region, FieldID fid,
2912 // The actual field size in case it is different from the
2913 // one being used in FT and we still want to check it
2914 size_t actual_field_size = sizeof(FT),
2915#ifdef DEBUG_LEGION
2916 bool check_field_size = true,
2917#else
2918 bool check_field_size = false,
2919#endif
2920 bool silence_warnings = false,
2921 const char *warning_string = NULL,
2922 size_t subfield_offset = 0) { }
2923 // For Realm::AffineAccessor specializations there are additional
2924 // methods for creating accessors with limited bounding boxes and
2925 // affine transformations for using alternative coordinates spaces
2926 // Specify a specific bounds rectangle to use for the accessor
2927 // Colocation regions from [start, stop)
2928 template<typename InputIterator>
2929 FieldAccessor(InputIterator start_region,
2930 InputIterator stop_region, FieldID fid,
2931 const Rect<N,COORD_T> bounds,
2932 // The actual field size in case it is different from the
2933 // one being used in FT and we still want to check it
2934 size_t actual_field_size = sizeof(FT),
2935#ifdef DEBUG_LEGION
2936 bool check_field_size = true,
2937#else
2938 bool check_field_size = false,
2939#endif
2940 bool silence_warnings = false,
2941 const char *warning_string = NULL,
2942 size_t subfield_offset = 0) { }
2943 // Specify a specific Affine transform to use for interpreting points
2944 // Not avalable for Realm::MultiAffineAccessor specializations
2945 // Colocation regions from [start, stop)
2946 template<typename InputIterator, int M>
2947 FieldAccessor(InputIterator start_region,
2948 InputIterator stop_region, FieldID fid,
2949 const AffineTransform<M,N,COORD_T> transform,
2950 // The actual field size in case it is different from the
2951 // one being used in FT and we still want to check it
2952 size_t actual_field_size = sizeof(FT),
2953#ifdef DEBUG_LEGION
2954 bool check_field_size = true,
2955#else
2956 bool check_field_size = false,
2957#endif
2958 bool silence_warnings = false,
2959 const char *warning_string = NULL,
2960 size_t subfield_offset = 0) { }
2961 // Specify both a transform and a bounds to use
2962 // Not avalable for Realm::MultiAffineAccessor specializations
2963 // Colocation regions from [start, stop)
2964 template<typename InputIterator, int M>
2965 FieldAccessor(InputIterator start_region,
2966 InputIterator stop_region, FieldID fid,
2967 const AffineTransform<M,N,COORD_T> transform,
2968 const Rect<N,COORD_T> bounds,
2969 // The actual field size in case it is different from the
2970 // one being used in FT and we still want to check it
2971 size_t actual_field_size = sizeof(FT),
2972#ifdef DEBUG_LEGION
2973 bool check_field_size = true,
2974#else
2975 bool check_field_size = false,
2976#endif
2977 bool silence_warnings = false,
2978 const char *warning_string = NULL,
2979 size_t subfield_offset = 0) { }
2980 public:
2981 // Create a FieldAccessor for an UntypedDeferredValue
2982 // (only with AffineAccessors)
2984 // The actual field size in case it is different from the
2985 // one being used in FT and we still want to check it
2986 size_t actual_field_size = sizeof(FT),
2987#ifdef DEBUG_LEGION
2988 bool check_field_size = true,
2989#else
2990 bool check_field_size = false,
2991#endif
2992 bool silence_warnings = false,
2993 const char *warning_string = NULL,
2994 size_t subfield_offset = 0) { }
2995 // Create a FieldAccessor for an UntypedDeferredValue
2996 // Specify a specific bounds rectangle to use for the accessor
2997 // (only with AffineAccessors)
2999 const Rect<N,COORD_T> &bounds,
3000 // The actual field size in case it is different from the
3001 // one being used in FT and we still want to check it
3002 size_t actual_field_size = sizeof(FT),
3003#ifdef DEBUG_LEGION
3004 bool check_field_size = true,
3005#else
3006 bool check_field_size = false,
3007#endif
3008 bool silence_warnings = false,
3009 const char *warning_string = NULL,
3010 size_t subfield_offset = 0) { }
3011 public:
3012 // Create a FieldAccessor for UntypedDeferredBuffer
3013 // (only with AffineAccessors)
3014 FieldAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3015 // The actual field size in case it is different from the
3016 // one being used in FT and we still want to check it
3017 size_t actual_field_size = sizeof(FT),
3018#ifdef DEBUG_LEGION
3019 bool check_field_size = true,
3020#else
3021 bool check_field_size = false,
3022#endif
3023 bool silence_warnings = false,
3024 const char *warning_string = NULL,
3025 size_t subfield_offset = 0) { }
3026 // Create a FieldAccessor for UntypedDeferredBuffer
3027 // Specify a specific bounds rectangle to use for the accessor
3028 // (only with AffineAccessors)
3029 FieldAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3030 const Rect<N,COORD_T> &bounds,
3031 // The actual field size in case it is different from the
3032 // one being used in FT and we still want to check it
3033 size_t actual_field_size = sizeof(FT),
3034#ifdef DEBUG_LEGION
3035 bool check_field_size = true,
3036#else
3037 bool check_field_size = false,
3038#endif
3039 bool silence_warnings = false,
3040 const char *warning_string = NULL,
3041 size_t subfield_offset = 0) { }
3042 // Create a FieldAccessor for UntypedDeferredBuffer
3043 // Specify a specific Affine transform to use for interpreting points
3044 // (only with AffineAccessors)
3045 template<int M>
3046 FieldAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3047 const AffineTransform<M,N,COORD_T> &transform,
3048 // The actual field size in case it is different from the
3049 // one being used in FT and we still want to check it
3050 size_t actual_field_size = sizeof(FT),
3051#ifdef DEBUG_LEGION
3052 bool check_field_size = true,
3053#else
3054 bool check_field_size = false,
3055#endif
3056 bool silence_warnings = false,
3057 const char *warning_string = NULL,
3058 size_t subfield_offset = 0) { }
3059 // Create a FieldAccessor for UntypedDeferredBuffer
3060 // Specify both a transform and a bounds to use
3061 // (only with AffineAccessors)
3062 template<int M>
3063 FieldAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3064 const AffineTransform<M,N,COORD_T> &transform,
3065 const Rect<N,COORD_T> &bounds,
3066 // The actual field size in case it is different from the
3067 // one being used in FT and we still want to check it
3068 size_t actual_field_size = sizeof(FT),
3069#ifdef DEBUG_LEGION
3070 bool check_field_size = true,
3071#else
3072 bool check_field_size = false,
3073#endif
3074 bool silence_warnings = false,
3075 const char *warning_string = NULL,
3076 size_t subfield_offset = 0) { }
3077 public:
3078 typedef FT value_type;
3079 typedef FT& reference;
3080 typedef const FT& const_reference;
3081 static const int dim = N;
3082 };
3083
3096 template<typename REDOP, bool EXCLUSIVE, int N, typename COORD_T = coord_t,
3097 typename A = Realm::GenericAccessor<typename REDOP::RHS,N,COORD_T>,
3098#ifdef LEGION_BOUNDS_CHECKS
3099 bool CHECK_BOUNDS = true>
3100#else
3101 bool CHECK_BOUNDS = false>
3102#endif
3104 private:
3105 static_assert(N > 0, "N must be positive");
3106 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3107 public:
3108 ReductionAccessor(void) { }
3109 ReductionAccessor(const PhysicalRegion &region, FieldID fid,
3110 ReductionOpID redop, bool silence_warnings = false,
3111 const char *warning_string = NULL,
3112 size_t subfield_offset = 0,
3113 size_t actual_field_size = sizeof(typename REDOP::RHS),
3114#ifdef DEBUG_LEGION
3115 bool check_field_size = true
3116#else
3117 bool check_field_size = false
3118#endif
3119 ) { }
3120 // For Realm::AffineAccessor specializations there are additional
3121 // methods for creating accessors with limited bounding boxes and
3122 // affine transformations for using alternative coordinates spaces
3123 // Specify a specific bounds rectangle to use for the accessor
3124 ReductionAccessor(const PhysicalRegion &region, FieldID fid,
3125 ReductionOpID redop,
3126 const Rect<N,COORD_T> bounds,
3127 bool silence_warnings = false,
3128 const char *warning_string = NULL,
3129 size_t subfield_offset = 0,
3130 size_t actual_field_size = sizeof(typename REDOP::RHS),
3131#ifdef DEBUG_LEGION
3132 bool check_field_size = true
3133#else
3134 bool check_field_size = false
3135#endif
3136 ) { }
3137 // Specify a specific Affine transform to use for interpreting points
3138 // Not available for Realm::MultiAffineAccessor specializations
3139 template<int M>
3140 ReductionAccessor(const PhysicalRegion &region, FieldID fid,
3141 ReductionOpID redop,
3142 const AffineTransform<M,N,COORD_T> transform,
3143 bool silence_warnings = false,
3144 const char *warning_string = NULL,
3145 size_t subfield_offset = 0,
3146 size_t actual_field_size = sizeof(typename REDOP::RHS),
3147#ifdef DEBUG_LEGION
3148 bool check_field_size = true
3149#else
3150 bool check_field_size = false
3151#endif
3152 ) { }
3153 // Specify both a transform and a bounds to use
3154 // Not available for Realm::MultiAffineAccessor specializations
3155 template<int M>
3156 ReductionAccessor(const PhysicalRegion &region, FieldID fid,
3157 ReductionOpID redop,
3158 const AffineTransform<M,N,COORD_T> transform,
3159 const Rect<N,COORD_T> bounds,
3160 bool silence_warnings = false,
3161 const char *warning_string = NULL,
3162 size_t subfield_offset = 0,
3163 size_t actual_field_size = sizeof(typename REDOP::RHS),
3164#ifdef DEBUG_LEGION
3165 bool check_field_size = true
3166#else
3167 bool check_field_size = false
3168#endif
3169 ) { }
3170 public:
3171 // Variations of the same four methods above but with multiple
3172 // physical regions specified using input iterators for colocation regions
3173 // Colocation regions from [start, stop)
3174 template<typename InputIterator>
3175 ReductionAccessor(InputIterator start_region,
3176 InputIterator stop_region, FieldID fid,
3177 ReductionOpID redop, bool silence_warnings = false,
3178 const char *warning_string = NULL,
3179 size_t subfield_offset = 0,
3180 size_t actual_field_size = sizeof(typename REDOP::RHS),
3181#ifdef DEBUG_LEGION
3182 bool check_field_size = true
3183#else
3184 bool check_field_size = false
3185#endif
3186 ) { }
3187 // For Realm::AffineAccessor specializations there are additional
3188 // methods for creating accessors with limited bounding boxes and
3189 // affine transformations for using alternative coordinates spaces
3190 // Specify a specific bounds rectangle to use for the accessor
3191 // Colocation regions from [start, stop)
3192 template<typename InputIterator>
3193 ReductionAccessor(InputIterator start_region,
3194 InputIterator stop_region, FieldID fid,
3195 ReductionOpID redop,
3196 const Rect<N,COORD_T> bounds,
3197 bool silence_warnings = false,
3198 const char *warning_string = NULL,
3199 size_t subfield_offset = 0,
3200 size_t actual_field_size = sizeof(typename REDOP::RHS),
3201#ifdef DEBUG_LEGION
3202 bool check_field_size = true
3203#else
3204 bool check_field_size = false
3205#endif
3206 ) { }
3207 // Specify a specific Affine transform to use for interpreting points
3208 // Not available for Realm::MultiAffineAccessor specializations
3209 // Colocation regions from [start, stop)
3210 template<typename InputIterator, int M>
3211 ReductionAccessor(InputIterator start_region,
3212 InputIterator stop_region, FieldID fid,
3213 ReductionOpID redop,
3214 const AffineTransform<M,N,COORD_T> transform,
3215 bool silence_warnings = false,
3216 const char *warning_string = NULL,
3217 size_t subfield_offset = 0,
3218 size_t actual_field_size = sizeof(typename REDOP::RHS),
3219#ifdef DEBUG_LEGION
3220 bool check_field_size = true
3221#else
3222 bool check_field_size = false
3223#endif
3224 ) { }
3225 // Specify both a transform and a bounds to use
3226 // Not available for Realm::MultiAffineAccessor specializations
3227 // Colocation regions from [start, stop)
3228 template<typename InputIterator, int M>
3229 ReductionAccessor(InputIterator start_region,
3230 InputIterator stop_region, FieldID fid,
3231 ReductionOpID redop,
3232 const AffineTransform<M,N,COORD_T> transform,
3233 const Rect<N,COORD_T> bounds,
3234 bool silence_warnings = false,
3235 const char *warning_string = NULL,
3236 size_t subfield_offset = 0,
3237 size_t actual_field_size = sizeof(typename REDOP::RHS),
3238#ifdef DEBUG_LEGION
3239 bool check_field_size = true
3240#else
3241 bool check_field_size = false
3242#endif
3243 ) { }
3244 public:
3245 // Create a ReductionAccessor for an UntypedDeferredValue
3246 // (only with AffineAccessors)
3248 bool silence_warnings = false,
3249 const char *warning_string = NULL,
3250 size_t subfield_offset = 0,
3251 size_t actual_field_size = sizeof(typename REDOP::RHS),
3252#ifdef DEBUG_LEGION
3253 bool check_field_size = true
3254#else
3255 bool check_field_size = false
3256#endif
3257 ) { }
3258 // Create a ReductionAccessor for an UntypedDeferredValue
3259 // Specify a specific bounds rectangle to use for the accessor
3260 // (only with AffineAccessors)
3262 const Rect<N,COORD_T> &bounds,
3263 bool silence_warnings = false,
3264 const char *warning_string = NULL,
3265 size_t subfield_offset = 0,
3266 size_t actual_field_size = sizeof(typename REDOP::RHS),
3267#ifdef DEBUG_LEGION
3268 bool check_field_size = true
3269#else
3270 bool check_field_size = false
3271#endif
3272 ) { }
3273 public:
3274 // Create a ReductionAccessor for an UntypedDeferredBuffer
3275 // (only with AffineAccessors)
3276 ReductionAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3277 bool silence_warnings = false,
3278 const char *warning_string = NULL,
3279 size_t subfield_offset = 0,
3280 size_t actual_field_size = sizeof(typename REDOP::RHS),
3281#ifdef DEBUG_LEGION
3282 bool check_field_size = true
3283#else
3284 bool check_field_size = false
3285#endif
3286 ) { }
3287 // Create a ReductionAccessor for an UntypedDeferredBuffer
3288 // Specify a specific bounds rectangle to use for the accessor
3289 // (only with AffineAccessors)
3290 ReductionAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3291 const Rect<N,COORD_T> &bounds,
3292 bool silence_warnings = false,
3293 const char *warning_string = NULL,
3294 size_t subfield_offset = 0,
3295 size_t actual_field_size = sizeof(typename REDOP::RHS),
3296#ifdef DEBUG_LEGION
3297 bool check_field_size = true
3298#else
3299 bool check_field_size = false
3300#endif
3301 ) { }
3302 // Create a ReductionAccessor for an UntypedDeferredBuffer
3303 // Specify a specific Affine transform to use for interpreting points
3304 // (only with AffineAccessors)
3305 template<int M>
3306 ReductionAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3307 const AffineTransform<M,N,COORD_T> &transform,
3308 bool silence_warnings = false,
3309 const char *warning_string = NULL,
3310 size_t subfield_offset = 0,
3311 size_t actual_field_size = sizeof(typename REDOP::RHS),
3312#ifdef DEBUG_LEGION
3313 bool check_field_size = true
3314#else
3315 bool check_field_size = false
3316#endif
3317 ) { }
3318 // Create a ReductionAccessor for an UntypedDeferredBuffer
3319 // Specify both a transform and a bounds to use
3320 // (only with AffineAccessors)
3321 template<int M>
3322 ReductionAccessor(const UntypedDeferredBuffer<COORD_T> &buffer,
3323 const AffineTransform<M,N,COORD_T> &transform,
3324 const Rect<N,COORD_T> &bounds,
3325 bool silence_warnings = false,
3326 const char *warning_string = NULL,
3327 size_t subfield_offset = 0,
3328 size_t actual_field_size = sizeof(typename REDOP::RHS),
3329#ifdef DEBUG_LEGION
3330 bool check_field_size = true
3331#else
3332 bool check_field_size = false
3333#endif
3334 ) { }
3335 public:
3336 typedef typename REDOP::RHS value_type;
3337 typedef typename REDOP::RHS& reference;
3338 typedef const typename REDOP::RHS& const_reference;
3339 static const int dim = N;
3340 };
3341
3364 template<typename FT, int N, typename COORD_T = coord_t,
3365 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
3366#ifdef LEGION_BOUNDS_CHECKS
3367 bool CHECK_BOUNDS = true>
3368#else
3369 bool CHECK_BOUNDS = false>
3370#endif
3372 public:
3373 PaddingAccessor(void) { }
3374 PaddingAccessor(const PhysicalRegion &region, FieldID fid,
3375 // The actual field size in case it is different from the
3376 // one being used in FT and we still want to check it
3377 size_t actual_field_size = sizeof(FT),
3378#ifdef DEBUG_LEGION
3379 bool check_field_size = true,
3380#else
3381 bool check_field_size = false,
3382#endif
3383 bool silence_warnings = false,
3384 const char *warning_string = NULL,
3385 size_t subfield_offset = 0) { }
3386 };
3387
3388#ifdef LEGION_MULTI_REGION_ACCESSOR
3389 // Multi-Region Accessors are a provisional feature now and are likely
3390 // to be deprecated and removed in the near future. Instead of multi-region
3391 // accessors you should be able to use the new colocation constructors
3392 // on the traditional Field Accessors.
3422 template<typename FT, int N, typename COORD_T = coord_t,
3423 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
3424#ifdef LEGION_BOUNDS_CHECKS
3425 bool CHECK_BOUNDS = true,
3426#else
3427 bool CHECK_BOUNDS = false,
3428#endif
3429#ifdef LEGION_PRIVILEGE_CHECKS
3430 bool CHECK_PRIVILEGES = true,
3431#else
3432 bool CHECK_PRIVILEGES = false,
3433#endif
3434 // Only used if bounds/privilege checks enabled
3435 // Can safely over-approximate, but may cost space
3436 // Especially GPU parameter space
3437 int MAX_REGIONS = 4>
3438 class MultiRegionAccessor {
3439 private:
3440 static_assert(N > 0, "N must be positive");
3441 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3442 public:
3443 MultiRegionAccessor(void) { }
3444 public: // iterator based construction of the multi-region accessors
3445 template<typename InputIterator>
3446 MultiRegionAccessor(InputIterator start, InputIterator stop,
3447 // The actual field size in case it is different from
3448 // the one being used in FT and we still want to check
3449 FieldID fid, size_t actual_field_size = sizeof(FT),
3450#ifdef DEBUG_LEGION
3451 bool check_field_size = true,
3452#else
3453 bool check_field_size = false,
3454#endif
3455 bool silence_warnings = false,
3456 const char *warning_string = NULL,
3457 size_t subfield_offset = 0) { }
3458 // Specify a specific bounds rectangle to use for the accessor
3459 template<typename InputIterator>
3460 MultiRegionAccessor(InputIterator start, InputIterator stop,
3461 const Rect<N,COORD_T> bounds, FieldID fid,
3462 // The actual field size in case it is different from
3463 // the one being used in FT and we still want to check
3464 size_t actual_field_size = sizeof(FT),
3465#ifdef DEBUG_LEGION
3466 bool check_field_size = true,
3467#else
3468 bool check_field_size = false,
3469#endif
3470 bool silence_warnings = false,
3471 const char *warning_string = NULL,
3472 size_t subfield_offset = 0) { }
3473 // Specify a specific Affine transform to use for interpreting points
3474 template<int M, typename InputIterator>
3475 MultiRegionAccessor(InputIterator start, InputIterator stop,
3476 const AffineTransform<M,N,COORD_T> transform,
3477 // The actual field size in case it is different from
3478 // the one being used in FT and we still want to check
3479 FieldID fid, size_t actual_field_size = sizeof(FT),
3480#ifdef DEBUG_LEGION
3481 bool check_field_size = true,
3482#else
3483 bool check_field_size = false,
3484#endif
3485 bool silence_warnings = false,
3486 const char *warning_string = NULL,
3487 size_t subfield_offset = 0) { }
3488 // Specify both a transform and a bounds to use
3489 template<int M, typename InputIterator>
3490 MultiRegionAccessor(InputIterator start, InputIterator stop,
3491 const AffineTransform<M,N,COORD_T> transform,
3492 const Rect<N,COORD_T> bounds, FieldID fid,
3493 // The actual field size in case it is different from the
3494 // one being used in FT and we still want to check it
3495 size_t actual_field_size = sizeof(FT),
3496#ifdef DEBUG_LEGION
3497 bool check_field_size = true,
3498#else
3499 bool check_field_size = false,
3500#endif
3501 bool silence_warnings = false,
3502 const char *warning_string = NULL,
3503 size_t subfield_offset = 0) { }
3504 public: // explicit data structure versions of the implicit iterators above
3505 MultiRegionAccessor(const std::vector<PhysicalRegion> &regions,
3506 // The actual field size in case it is different from
3507 // the one being used in FT and we still want to check
3508 FieldID fid, size_t actual_field_size = sizeof(FT),
3509#ifdef DEBUG_LEGION
3510 bool check_field_size = true,
3511#else
3512 bool check_field_size = false,
3513#endif
3514 bool silence_warnings = false,
3515 const char *warning_string = NULL,
3516 size_t subfield_offset = 0) { }
3517 // Specify a specific bounds rectangle to use for the accessor
3518 MultiRegionAccessor(const std::vector<PhysicalRegion> &regions,
3519 const Rect<N,COORD_T> bounds, FieldID fid,
3520 // The actual field size in case it is different from
3521 // the one being used in FT and we still want to check
3522 size_t actual_field_size = sizeof(FT),
3523#ifdef DEBUG_LEGION
3524 bool check_field_size = true,
3525#else
3526 bool check_field_size = false,
3527#endif
3528 bool silence_warnings = false,
3529 const char *warning_string = NULL,
3530 size_t subfield_offset = 0) { }
3531 // Specify a specific Affine transform to use for interpreting points
3532 template<int M>
3533 MultiRegionAccessor(const std::vector<PhysicalRegion> &regions,
3534 const AffineTransform<M,N,COORD_T> transform,
3535 // The actual field size in case it is different from
3536 // the one being used in FT and we still want to check
3537 FieldID fid, size_t actual_field_size = sizeof(FT),
3538#ifdef DEBUG_LEGION
3539 bool check_field_size = true,
3540#else
3541 bool check_field_size = false,
3542#endif
3543 bool silence_warnings = false,
3544 const char *warning_string = NULL,
3545 size_t subfield_offset = 0) { }
3546 // Specify both a transform and a bounds to use
3547 template<int M>
3548 MultiRegionAccessor(const std::vector<PhysicalRegion> &regions,
3549 const AffineTransform<M,N,COORD_T> transform,
3550 const Rect<N,COORD_T> bounds, FieldID fid,
3551 // The actual field size in case it is different from the
3552 // one being used in FT and we still want to check it
3553 size_t actual_field_size = sizeof(FT),
3554#ifdef DEBUG_LEGION
3555 bool check_field_size = true,
3556#else
3557 bool check_field_size = false,
3558#endif
3559 bool silence_warnings = false,
3560 const char *warning_string = NULL,
3561 size_t subfield_offset = 0) { }
3562 public:
3563 typedef FT value_type;
3564 typedef FT& reference;
3565 typedef const FT& const_reference;
3566 static const int dim = N;
3567 };
3568#endif // LEGION_MULTI_REGION_ACCESSOR
3569
3594 public:
3595 PieceIterator(void);
3596 PieceIterator(const PieceIterator &rhs);
3597 PieceIterator(PieceIterator &&rhs) noexcept;
3598 PieceIterator(const PhysicalRegion &region, FieldID fid,
3599 bool privilege_only = true,
3600 bool silence_warnings = false,
3601 const char *warning_string = NULL);
3602 ~PieceIterator(void);
3603 public:
3604 PieceIterator& operator=(const PieceIterator &rhs);
3605 PieceIterator& operator=(PieceIterator &&rhs) noexcept;
3606 public:
3607 inline bool valid(void) const;
3608 bool step(void);
3609 public:
3610 inline operator bool(void) const;
3611 inline bool operator()(void) const;
3612 inline const Domain& operator*(void) const;
3613 inline const Domain* operator->(void) const;
3614 inline PieceIterator& operator++(void);
3615 inline PieceIterator operator++(int/*postfix*/);
3616 public:
3617 bool operator<(const PieceIterator &rhs) const;
3618 bool operator==(const PieceIterator &rhs) const;
3619 bool operator!=(const PieceIterator &rhs) const;
3620 private:
3621 Internal::PieceIteratorImpl *impl;
3622 int index;
3623 protected:
3624 Domain current_piece;
3625 };
3626
3632 template<int DIM, typename COORD_T = coord_t>
3634 private:
3635 static_assert(DIM > 0, "DIM must be positive");
3636 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3637 public:
3638 PieceIteratorT(void);
3639 PieceIteratorT(const PieceIteratorT &rhs);
3640 PieceIteratorT(PieceIteratorT &&rhs) noexcept;
3641 PieceIteratorT(const PhysicalRegion &region, FieldID fid,
3642 bool privilege_only,
3643 bool silence_warnings = false,
3644 const char *warning_string = NULL);
3645 public:
3646 PieceIteratorT<DIM,COORD_T>& operator=(const PieceIteratorT &rhs);
3647 PieceIteratorT<DIM,COORD_T>& operator=(PieceIteratorT &&rhs) noexcept;
3648 public:
3649 inline bool step(void);
3650 inline const Rect<DIM,COORD_T>& operator*(void) const;
3651 inline const Rect<DIM,COORD_T>* operator->(void) const;
3652 inline PieceIteratorT<DIM,COORD_T>& operator++(void);
3653 inline PieceIteratorT<DIM,COORD_T> operator++(int/*postfix*/);
3654 protected:
3655 Rect<DIM,COORD_T> current_rect;
3656 };
3657
3667 template<PrivilegeMode PM, typename FT, int DIM, typename COORD_T = coord_t>
3669 private:
3670 static_assert(DIM > 0, "DIM must be positive");
3671 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3672 public:
3673 SpanIterator(void) { }
3674 SpanIterator(const PhysicalRegion &region, FieldID fid,
3675 // The actual field size in case it is different from the
3676 // one being used in FT and we still want to check it
3677 size_t actual_field_size = sizeof(FT),
3678#ifdef DEBUG_LEGION
3679 bool check_field_size = true,
3680#else
3681 bool check_field_size = false,
3682#endif
3683 // Iterate only the spans that we have privileges on
3684 bool privileges_only = true,
3685 bool silence_warnings = false,
3686 const char *warning_string = NULL);
3687 public:
3688 inline bool valid(void) const;
3689 inline bool step(void);
3690 public:
3691 inline operator bool(void) const;
3692 inline bool operator()(void) const;
3693 inline const Span<FT,PM>& operator*(void) const;
3694 inline const Span<FT,PM>* operator->(void) const;
3695 inline SpanIterator<PM,FT,DIM,COORD_T>& operator++(void);
3696 inline SpanIterator<PM,FT,DIM,COORD_T> operator++(int);
3697 private:
3698 PieceIteratorT<DIM,COORD_T> piece_iterator;
3699 Realm::MultiAffineAccessor<FT,DIM,COORD_T> accessor;
3700 Span<FT,PM> current;
3701 Point<DIM,COORD_T> partial_step_point;
3702 int dim_order[DIM];
3703 int partial_step_dim;
3704 bool partial_piece;
3705 };
3706
3720 template<typename T>
3722 public:
3723 DeferredValue(T initial_value,
3724 size_t alignment = std::alignment_of<T>());
3725 public:
3726 __CUDA_HD__
3727 inline T read(void) const;
3728 __CUDA_HD__
3729 inline void write(T value) const;
3730 __CUDA_HD__
3731 inline T* ptr(void) const;
3732 __CUDA_HD__
3733 inline T& ref(void) const;
3734 __CUDA_HD__
3735 inline operator T(void) const;
3736 __CUDA_HD__
3737 inline DeferredValue<T>& operator=(T value);
3738 public:
3739 inline void finalize(Context ctx) const;
3740 public:
3741 typedef T value_type;
3742 typedef T& reference;
3743 typedef const T& const_reference;
3744 protected:
3745 friend class UntypedDeferredValue;
3746 DeferredValue(void);
3747 Realm::RegionInstance instance;
3748 Realm::AffineAccessor<T,1,coord_t> accessor;
3749 };
3750
3760 template<typename REDOP, bool EXCLUSIVE=false>
3761 class DeferredReduction: public DeferredValue<typename REDOP::RHS> {
3762 public:
3764 size_t alignment = std::alignment_of<typename REDOP::RHS>());
3765 public:
3766 __CUDA_HD__
3767 inline void reduce(typename REDOP::RHS val) const;
3768 __CUDA_HD__
3769 inline void operator<<=(typename REDOP::RHS val) const;
3770 public:
3771 typedef typename REDOP::RHS value_type;
3772 typedef typename REDOP::RHS& reference;
3773 typedef const typename REDOP::RHS& const_reference;
3774 };
3775
3781 public:
3783 UntypedDeferredValue(size_t field_size, Memory target_memory,
3784 const void *initial_value = NULL,
3785 size_t alignment = 16);
3786 UntypedDeferredValue(size_t field_size,
3787 Memory::Kind memory_kind = Memory::Z_COPY_MEM,
3788 const void *initial_value = NULL,
3789 size_t alignment = 16);
3790 template<typename T>
3791 UntypedDeferredValue(const DeferredValue<T> &rhs);
3792 template<typename REDOP, bool EXCLUSIVE>
3793 UntypedDeferredValue(const DeferredReduction<REDOP,EXCLUSIVE> &rhs);
3794 public:
3795 template<typename T>
3796 inline operator DeferredValue<T>(void) const;
3797 template<typename REDOP, bool EXCLUSIVE>
3798 inline operator DeferredReduction<REDOP,EXCLUSIVE>(void) const;
3799 public:
3800 void finalize(Context ctx) const;
3801 Realm::RegionInstance get_instance(void) const;
3802 private:
3803 template<PrivilegeMode,typename,int,typename,typename,bool>
3804 friend class FieldAccessor;
3805 template<typename,bool,int,typename,typename,bool>
3806 friend class ReductionAccessor;
3807 Realm::RegionInstance instance;
3808 size_t field_size;
3809 };
3810
3828 template<typename T, int DIM, typename COORD_T = coord_t,
3829#ifdef LEGION_BOUNDS_CHECKS
3830 bool CHECK_BOUNDS = true>
3831#else
3832 bool CHECK_BOUNDS = false>
3833#endif
3835 private:
3836 static_assert(DIM > 0, "DIM must be positive");
3837 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3838 public:
3839 DeferredBuffer(void);
3840 public: // Constructors specifying a generic memory kind
3841 DeferredBuffer(Memory::Kind kind,
3842 const Domain &bounds,
3843 const T *initial_value = NULL,
3844 size_t alignment = std::alignment_of<T>(),
3845 bool fortran_order_dims = false);
3846 DeferredBuffer(const Rect<DIM,COORD_T> &bounds,
3847 Memory::Kind kind,
3848 const T *initial_value = NULL,
3849 size_t alignment = std::alignment_of<T>(),
3850 bool fortran_order_dims = false);
3851 public: // Constructors specifying a specific memory
3852 DeferredBuffer(Memory memory,
3853 const Domain &bounds,
3854 const T *initial_value = NULL,
3855 size_t alignment = std::alignment_of<T>(),
3856 bool fortran_order_dims = false);
3857 DeferredBuffer(const Rect<DIM,COORD_T> &bounds,
3858 Memory memory,
3859 const T *initial_value = NULL,
3860 size_t alignment = std::alignment_of<T>(),
3861 bool fortran_order_dims = false);
3862 public: // Constructors specifying a specific ordering
3863 DeferredBuffer(Memory::Kind kind,
3864 const Domain &bounds,
3865 std::array<DimensionKind,DIM> ordering,
3866 const T *initial_value = NULL,
3867 size_t alignment = std::alignment_of<T>());
3868 DeferredBuffer(const Rect<DIM,COORD_T> &bounds,
3869 Memory::Kind kind,
3870 std::array<DimensionKind,DIM> ordering,
3871 const T *initial_value = NULL,
3872 size_t alignment = std::alignment_of<T>());
3873 DeferredBuffer(Memory memory,
3874 const Domain &bounds,
3875 std::array<DimensionKind,DIM> ordering,
3876 const T *initial_value = NULL,
3877 size_t alignment = std::alignment_of<T>());
3878 DeferredBuffer(const Rect<DIM,COORD_T> &bounds,
3879 Memory memory,
3880 std::array<DimensionKind,DIM> ordering,
3881 const T *initial_value = NULL,
3882 size_t alignment = std::alignment_of<T>());
3883 protected:
3884 inline Memory get_memory_from_kind(Memory::Kind kind);
3885 inline void initialize_layout(size_t alignment, bool fortran_order_dims);
3886 inline void initialize(Memory memory,
3887 DomainT<DIM,COORD_T> bounds,
3888 const T *initial_value);
3889 public:
3890 __CUDA_HD__
3891 inline T read(const Point<DIM,COORD_T> &p) const;
3892 __CUDA_HD__
3893 inline void write(const Point<DIM,COORD_T> &p, T value) const;
3894 __CUDA_HD__
3895 inline T* ptr(const Point<DIM,COORD_T> &p) const;
3896 __CUDA_HD__
3897 inline T* ptr(const Rect<DIM,COORD_T> &r) const; // must be dense
3898 __CUDA_HD__
3899 inline T* ptr(const Rect<DIM,COORD_T> &r, size_t strides[DIM]) const;
3900 __CUDA_HD__
3901 inline T& operator[](const Point<DIM,COORD_T> &p) const;
3902 public:
3903 inline void destroy(Realm::Event precondition = Realm::Event::NO_EVENT);
3904 __CUDA_HD__
3905 inline Realm::RegionInstance get_instance(void) const;
3906 __CUDA_HD__
3907 inline Rect<DIM,COORD_T> get_bounds(void) const;
3908 public:
3909 typedef T value_type;
3910 typedef T& reference;
3911 typedef const T& const_reference;
3912 protected:
3913 friend class OutputRegion;
3914 friend class UntypedDeferredBuffer<COORD_T>;
3915 Realm::RegionInstance instance;
3916 Realm::AffineAccessor<T,DIM,COORD_T> accessor;
3917 std::array<DimensionKind,DIM> ordering;
3918 Rect<DIM,COORD_T> bounds;
3919 size_t alignment;
3920 };
3921
3928 template<typename COORD_T = coord_t>
3930 private:
3931 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
3932 public:
3934 public: // Constructors specifying a generic memory kind
3935 UntypedDeferredBuffer(size_t field_size, int dims,
3936 Memory::Kind kind,
3937 const Domain &bounds,
3938 const void *initial_value = NULL,
3939 size_t alignment = 16,
3940 bool fortran_order_dims = false);
3941 UntypedDeferredBuffer(size_t field_size, int dims,
3942 Memory::Kind kind,
3943 IndexSpace bounds,
3944 const void *initial_value = NULL,
3945 size_t alignment = 16,
3946 bool fortran_order_dims = false);
3947 public: // Constructors specifying a specific memory
3948 UntypedDeferredBuffer(size_t field_size, int dims,
3949 Memory memory,
3950 const Domain &bounds,
3951 const void *initial_value = NULL,
3952 size_t alignment = 16,
3953 bool fortran_order_dims = false);
3954 UntypedDeferredBuffer(size_t field_size, int dims,
3955 Memory memory,
3956 IndexSpace bounds,
3957 const void *initial_value = NULL,
3958 size_t alignment = 16,
3959 bool fortran_order_dims = false);
3960 public:
3961 template<typename T, int DIM>
3962 UntypedDeferredBuffer(const DeferredBuffer<T,DIM,COORD_T> &rhs);
3963 public:
3964 template<typename T, int DIM, bool BC>
3965 inline operator DeferredBuffer<T,DIM,COORD_T,BC>(void) const;
3966 public:
3967 inline void destroy(Realm::Event precondition = Realm::Event::NO_EVENT);
3968 inline Realm::RegionInstance get_instance(void) const { return instance; }
3969 private:
3970 template<PrivilegeMode,typename,int,typename,typename,bool>
3971 friend class FieldAccessor;
3972 template<typename,bool,int,typename,typename,bool>
3973 friend class ReductionAccessor;
3974 Realm::RegionInstance instance;
3975 size_t field_size;
3976 int dims;
3977 };
3978
3985 class OutputRegion : public Unserializable<OutputRegion> {
3986 public:
3987 OutputRegion(void);
3988 OutputRegion(const OutputRegion &rhs);
3989 ~OutputRegion(void);
3990 private:
3991 Internal::OutputRegionImpl *impl;
3992 protected:
3993 FRIEND_ALL_RUNTIME_CLASSES
3994 explicit OutputRegion(Internal::OutputRegionImpl *impl);
3995 public:
3996 OutputRegion& operator=(const OutputRegion &rhs);
3997 public:
3998 Memory target_memory(void) const;
3999 // Returns the logical region of this output region.
4000 // The call is legal only when the output region is valid and
4001 // will raise an error otherwise.
4002 LogicalRegion get_logical_region(void) const;
4003 bool is_valid_output_region(void) const;
4004 public:
4005 // Returns a deferred buffer that satisfies the layout constraints of
4006 // this output region. The caller still needs to pass this buffer to
4007 // a return_data call if the buffer needs to be bound to this output
4008 // region. The caller can optionally choose to bind the returned buffer
4009 // to the output region; such a call cannot be made more than once.
4010 template<typename T,
4011 int DIM,
4012 typename COORD_T = coord_t,
4013#ifdef LEGION_BOUNDS_CHECKS
4014 bool CHECK_BOUNDS = true>
4015#else
4016 bool CHECK_BOUNDS = false>
4017#endif
4018 DeferredBuffer<T,DIM,COORD_T,CHECK_BOUNDS>
4019 create_buffer(const Point<DIM, COORD_T> &extents,
4020 FieldID field_id,
4021 const T *initial_value = NULL,
4022 bool return_buffer = false);
4023 private:
4024 void check_type_tag(TypeTag type_tag) const;
4025 void check_field_size(FieldID field_id, size_t field_size) const;
4026 void get_layout(FieldID field_id,
4027 std::vector<DimensionKind> &ordering,
4028 size_t &alignment) const;
4029 public:
4030 template<typename T,
4031 int DIM,
4032 typename COORD_T = coord_t,
4033#ifdef LEGION_BOUNDS_CHECKS
4034 bool CHECK_BOUNDS = true>
4035#else
4036 bool CHECK_BOUNDS = false>
4037#endif
4038 void return_data(const Point<DIM,COORD_T> &extents,
4039 FieldID field_id,
4040 DeferredBuffer<T,DIM,COORD_T,CHECK_BOUNDS> &buffer);
4041 void return_data(const DomainPoint &extents,
4042 FieldID field_id,
4043 Realm::RegionInstance instance,
4044 bool check_constraints = true);
4045 private:
4046 void return_data(const DomainPoint &extents,
4047 FieldID field_id,
4048 Realm::RegionInstance instance,
4049 const LayoutConstraintSet *constraints,
4050 bool check_constraints);
4051 };
4052
4053 //==========================================================================
4054 // Software Coherence Classes
4055 //==========================================================================
4056
4069 public:
4070 AcquireLauncher(LogicalRegion logical_region,
4071 LogicalRegion parent_region,
4072 PhysicalRegion physical_region = PhysicalRegion(),
4073 Predicate pred = Predicate::TRUE_PRED,
4074 MapperID id = 0, MappingTagID tag = 0,
4075 UntypedBuffer map_arg = UntypedBuffer(),
4076 const char *provenance = "");
4077 public:
4078 inline void add_field(FieldID f);
4079 inline void add_grant(Grant g);
4080 inline void add_wait_barrier(PhaseBarrier pb);
4081 inline void add_arrival_barrier(PhaseBarrier pb);
4082 inline void add_wait_handshake(LegionHandshake handshake);
4083 inline void add_arrival_handshake(LegionHandshake handshake);
4084 public:
4085 LogicalRegion logical_region;
4086 LogicalRegion parent_region;
4087 std::set<FieldID> fields;
4088 public:
4089 // This field is now optional (but required with control replication)
4090 PhysicalRegion physical_region;
4091 public:
4092 std::vector<Grant> grants;
4093 std::vector<PhaseBarrier> wait_barriers;
4094 std::vector<PhaseBarrier> arrive_barriers;
4095 Predicate predicate;
4096 MapperID map_id;
4097 MappingTagID tag;
4098 UntypedBuffer map_arg;
4099 public:
4100 // Provenance string for the runtime and tools to use
4101 std::string provenance;
4102 public:
4103 // Inform the runtime about any static dependences
4104 // These will be ignored outside of static traces
4105 const std::vector<StaticDependence> *static_dependences;
4106 public:
4107 bool silence_warnings;
4108 };
4109
4117 public:
4118 ReleaseLauncher(LogicalRegion logical_region,
4119 LogicalRegion parent_region,
4120 PhysicalRegion physical_region = PhysicalRegion(),
4121 Predicate pred = Predicate::TRUE_PRED,
4122 MapperID id = 0, MappingTagID tag = 0,
4123 UntypedBuffer map_arg = UntypedBuffer(),
4124 const char *provenance = "");
4125 public:
4126 inline void add_field(FieldID f);
4127 inline void add_grant(Grant g);
4128 inline void add_wait_barrier(PhaseBarrier pb);
4129 inline void add_arrival_barrier(PhaseBarrier pb);
4130 inline void add_wait_handshake(LegionHandshake handshake);
4131 inline void add_arrival_handshake(LegionHandshake handshake);
4132 public:
4133 LogicalRegion logical_region;
4134 LogicalRegion parent_region;
4135 std::set<FieldID> fields;
4136 public:
4137 // This field is now optional (but required with control replication)
4138 PhysicalRegion physical_region;
4139 public:
4140 std::vector<Grant> grants;
4141 std::vector<PhaseBarrier> wait_barriers;
4142 std::vector<PhaseBarrier> arrive_barriers;
4143 Predicate predicate;
4144 MapperID map_id;
4145 MappingTagID tag;
4146 UntypedBuffer map_arg;
4147 public:
4148 // Provenance string for the runtime and tools to use
4149 std::string provenance;
4150 public:
4151 // Inform the runtime about any static dependences
4152 // These will be ignored outside of static traces
4153 const std::vector<StaticDependence> *static_dependences;
4154 public:
4155 bool silence_warnings;
4156 };
4157
4158 //==========================================================================
4159 // Must Parallelism Classes
4160 //==========================================================================
4161
4176 public:
4177 MustEpochLauncher(MapperID id = 0, MappingTagID tag = 0);
4178 public:
4179 inline void add_single_task(const DomainPoint &point,
4180 const TaskLauncher &launcher);
4181 inline void add_index_task(const IndexTaskLauncher &launcher);
4182 public:
4183 MapperID map_id;
4184 MappingTagID mapping_tag;
4185 std::vector<TaskLauncher> single_tasks;
4186 std::vector<IndexTaskLauncher> index_tasks;
4187 public:
4188 Domain launch_domain;
4189 IndexSpace launch_space;
4190 // Will only be used in control replication context. If left
4191 // unset the runtime will use launch_space/launch_domain
4192 IndexSpace sharding_space;
4193 public:
4194 // Provenance string for the runtime and tools to use
4195 std::string provenance;
4196 public:
4197 bool silence_warnings;
4198 };
4199
4200 //==========================================================================
4201 // Interoperability Classes
4202 //==========================================================================
4203
4214 class LegionHandshake : public Unserializable<LegionHandshake> {
4215 public:
4216 LegionHandshake(void);
4217 LegionHandshake(const LegionHandshake &rhs);
4218 ~LegionHandshake(void);
4219 protected:
4220 Internal::LegionHandshakeImpl *impl;
4221 protected:
4222 // Only the runtime should be able to make these
4223 FRIEND_ALL_RUNTIME_CLASSES
4224 explicit LegionHandshake(Internal::LegionHandshakeImpl *impl);
4225 public:
4226 bool operator==(const LegionHandshake &h) const
4227 { return impl == h.impl; }
4228 bool operator<(const LegionHandshake &h) const
4229 { return impl < h.impl; }
4230 LegionHandshake& operator=(const LegionHandshake &rhs);
4231 public:
4236 void ext_handoff_to_legion(void) const;
4242 void ext_wait_on_legion(void) const;
4243 public:
4248 void legion_handoff_to_ext(void) const;
4253 void legion_wait_on_ext(void) const;
4254 public:
4255 /*
4256 * For asynchronous Legion execution, you can use these
4257 * methods to get a phase barrier associated with the
4258 * handshake object instead of blocking on the legion side
4259 */
4272 };
4273
4280 public:
4281 MPILegionHandshake(void);
4283 ~MPILegionHandshake(void);
4284 protected:
4285 // Only the runtime should be able to make these
4286 FRIEND_ALL_RUNTIME_CLASSES
4287 explicit MPILegionHandshake(Internal::LegionHandshakeImpl *impl);
4288 public:
4289 bool operator==(const MPILegionHandshake &h) const
4290 { return impl == h.impl; }
4291 bool operator<(const MPILegionHandshake &h) const
4292 { return impl < h.impl; }
4293 MPILegionHandshake& operator=(const MPILegionHandshake &rhs);
4294 public:
4299 inline void mpi_handoff_to_legion(void) const { ext_handoff_to_legion(); }
4304 inline void mpi_wait_on_legion(void) const { ext_wait_on_legion(); }
4305 public:
4310 inline void legion_handoff_to_mpi(void) const { legion_handoff_to_ext(); }
4315 inline void legion_wait_on_mpi(void) const { legion_wait_on_ext(); }
4316 };
4317
4318 //==========================================================================
4319 // Operation Classes
4320 //==========================================================================
4321
4328 class Mappable {
4329 public:
4330 Mappable(void);
4331 public:
4332 // Return a globally unique ID for this operation
4333 virtual UniqueID get_unique_id(void) const = 0;
4334 // Return the number of operations that came before
4335 // this operation in the same context (close operations
4336 // return number of previous close operations)
4337 virtual uint64_t get_context_index(void) const = 0;
4338 // Return the depth of this operation in the task tree
4339 virtual int get_depth(void) const = 0;
4340 // Get the parent task associated with this mappable
4341 virtual const Task* get_parent_task(void) const = 0;
4342 // Get the provenance string for this mappable
4343 // By default we return the human readable component but
4344 // you can also get the machine component as well
4345 virtual const std::string_view& get_provenance_string(
4346 bool human = true) const = 0;
4347 public:
4348 virtual MappableType get_mappable_type(void) const = 0;
4349 virtual const Task* as_task(void) const { return NULL; }
4350 virtual const Copy* as_copy(void) const { return NULL; }
4351 virtual const InlineMapping* as_inline(void) const { return NULL; }
4352 virtual const Acquire* as_acquire(void) const { return NULL; }
4353 virtual const Release* as_release(void) const { return NULL; }
4354 virtual const Close* as_close(void) const { return NULL; }
4355 virtual const Fill* as_fill(void) const { return NULL; }
4356 virtual const Partition* as_partition(void) const { return NULL; }
4357 virtual const MustEpoch* as_must_epoch(void) const { return NULL; }
4358 public:
4359 MapperID map_id;
4360 MappingTagID tag;
4361 public:
4362 // The 'parent_task' member is here for backwards compatibility
4363 // It's better to use the 'get_parent_task' method
4364 // as this may be NULL until that method is called
4365 mutable const Task* parent_task;
4366 public:
4367 // Mapper annotated data
4368 void* mapper_data;
4369 size_t mapper_data_size;
4370 public:
4371 // These are here for backwards compatibility from a time when
4372 // the MappableType enum was inside of this class
4373#ifndef __GNUC__
4374 // GCC doesn't like this line even though it's just creating a
4375 // type alias, who knows what their problem is
4376 typedef Legion::MappableType MappableType;
4377#endif
4378 static const MappableType TASK_MAPPABLE = ::LEGION_TASK_MAPPABLE;
4379 static const MappableType COPY_MAPPABLE = ::LEGION_COPY_MAPPABLE;
4380 static const MappableType INLINE_MAPPABLE = ::LEGION_INLINE_MAPPABLE;
4381 static const MappableType ACQUIRE_MAPPABLE = ::LEGION_ACQUIRE_MAPPABLE;
4382 static const MappableType RELEASE_MAPPABLE = ::LEGION_RELEASE_MAPPABLE;
4383 static const MappableType CLOSE_MAPPABLE = ::LEGION_CLOSE_MAPPABLE;
4384 static const MappableType FILL_MAPPABLE = ::LEGION_FILL_MAPPABLE;
4385 static const MappableType PARTITION_MAPPABLE =
4386 ::LEGION_PARTITION_MAPPABLE;
4387 static const MappableType MUST_EPOCH_MAPPABLE =
4388 ::LEGION_MUST_EPOCH_MAPPABLE;
4389 };
4390
4399 class Task : public Mappable {
4400 public:
4401 Task(void);
4402 public:
4403 // Check whether this task has a parent task.
4404 virtual bool has_parent_task(void) const = 0;
4405 // Return the name of the task.
4406 virtual const char* get_task_name(void) const = 0;
4407 // Returns the current slice of the index domain that this
4408 // task is operating over. This method will only return a
4409 // valid domain if this is part of an index space task.
4410 virtual Domain get_slice_domain(void) const = 0;
4411 //------------------------------------------------------------------------
4412 // Control Replication methods
4413 // In general SPMD-style programming in Legion is wrong. If you find
4414 // yourself writing SPMD-style code for large fractions of your program
4415 // then you're probably doing something wrong. There are a few exceptions:
4416 // 1. index attach/detach operations are collective and may need
4417 // to do per-shard work
4418 // 2. I/O in general often needs to do per-shard work
4419 // 3. interaction with collective frameworks like MPI and NCCL
4420 // 4. others?
4421 // For these reasons we allow users to get access to sharding information
4422 // Please, please, please be careful with how you use it
4423 //------------------------------------------------------------------------
4424 virtual ShardID get_shard_id(void) const = 0;
4425 virtual size_t get_total_shards(void) const = 0;
4426 virtual DomainPoint get_shard_point(void) const = 0;
4427 virtual Domain get_shard_domain(void) const = 0;
4428 public:
4429 virtual MappableType get_mappable_type(void) const
4430 { return LEGION_TASK_MAPPABLE; }
4431 virtual const Task* as_task(void) const { return this; }
4432 public:
4433 // Task argument information
4434 TaskID task_id;
4435 std::vector<IndexSpaceRequirement> indexes;
4436 std::vector<RegionRequirement> regions;
4437 std::vector<OutputRequirement> output_regions;
4438 std::vector<Future> futures;
4439 std::vector<Grant> grants;
4440 std::vector<PhaseBarrier> wait_barriers;
4441 std::vector<PhaseBarrier> arrive_barriers;
4442 void* args;
4443 size_t arglen;
4444 public:
4445 // Index task argument information
4446 bool is_index_space;
4447 bool concurrent_task;
4448 bool must_epoch_task;
4449 Domain index_domain;
4450 DomainPoint index_point;
4451 IndexSpace sharding_space;
4452 void* local_args;
4453 size_t local_arglen;
4454 public:
4455 // Meta data information from the runtime
4456 Processor orig_proc;
4457 Processor current_proc;
4458 Processor target_proc;
4459 unsigned steal_count;
4460 bool stealable;
4461 bool speculated;
4462 bool local_function;
4463 };
4464
4470 class Copy : public Mappable {
4471 public:
4472 Copy(void);
4473 public:
4474 virtual MappableType get_mappable_type(void) const
4475 { return LEGION_COPY_MAPPABLE; }
4476 virtual const Copy* as_copy(void) const { return this; }
4477 public:
4478 // Copy Launcher arguments
4479 std::vector<RegionRequirement> src_requirements;
4480 std::vector<RegionRequirement> dst_requirements;
4481 std::vector<RegionRequirement> src_indirect_requirements;
4482 std::vector<RegionRequirement> dst_indirect_requirements;
4483 std::vector<Grant> grants;
4484 std::vector<PhaseBarrier> wait_barriers;
4485 std::vector<PhaseBarrier> arrive_barriers;
4486 public:
4487 // Index copy argument information
4488 bool is_index_space;
4489 Domain index_domain;
4490 DomainPoint index_point;
4491 IndexSpace sharding_space;
4492 };
4493
4499 class InlineMapping : public Mappable {
4500 public:
4501 InlineMapping(void);
4502 public:
4503 virtual MappableType get_mappable_type(void) const
4504 { return LEGION_INLINE_MAPPABLE; }
4505 virtual const InlineMapping* as_inline(void) const { return this; }
4506 virtual ShardID get_parent_shard(void) const { return 0; }
4507 public:
4508 // Inline Launcher arguments
4509 RegionRequirement requirement;
4510 std::vector<Grant> grants;
4511 std::vector<PhaseBarrier> wait_barriers;
4512 std::vector<PhaseBarrier> arrive_barriers;
4513 LayoutConstraintID layout_constraint_id;
4514 };
4515
4521 class Acquire : public Mappable {
4522 public:
4523 Acquire(void);
4524 public:
4525 virtual MappableType get_mappable_type(void) const
4526 { return LEGION_ACQUIRE_MAPPABLE; }
4527 virtual const Acquire* as_acquire(void) const { return this; }
4528 public:
4529 // Acquire Launcher arguments
4530 LogicalRegion logical_region;
4531 LogicalRegion parent_region;
4532 std::set<FieldID> fields;
4533 std::vector<Grant> grants;
4534 std::vector<PhaseBarrier> wait_barriers;
4535 std::vector<PhaseBarrier> arrive_barriers;
4536 };
4537
4543 class Release : public Mappable {
4544 public:
4545 Release(void);
4546 public:
4547 virtual MappableType get_mappable_type(void) const
4548 { return LEGION_RELEASE_MAPPABLE; }
4549 virtual const Release* as_release(void) const { return this; }
4550 public:
4551 // Release Launcher arguments
4552 LogicalRegion logical_region;
4553 LogicalRegion parent_region;
4554 std::set<FieldID> fields;
4555 std::vector<Grant> grants;
4556 std::vector<PhaseBarrier> wait_barriers;
4557 std::vector<PhaseBarrier> arrive_barriers;
4558 };
4559
4569 class Close : public Mappable {
4570 public:
4571 Close(void);
4572 public:
4573 virtual MappableType get_mappable_type(void) const
4574 { return LEGION_CLOSE_MAPPABLE; }
4575 virtual const Close* as_close(void) const { return this; }
4576 public:
4577 // Synthesized region requirement
4578 RegionRequirement requirement;
4579 };
4580
4587 class Fill : public Mappable {
4588 public:
4589 Fill(void);
4590 public:
4591 virtual MappableType get_mappable_type(void) const
4592 { return LEGION_FILL_MAPPABLE; }
4593 virtual const Fill* as_fill(void) const { return this; }
4594 public:
4595 // Synthesized region requirement
4596 RegionRequirement requirement;
4597 std::vector<Grant> grants;
4598 std::vector<PhaseBarrier> wait_barriers;
4599 std::vector<PhaseBarrier> arrive_barriers;
4600 public:
4601 // Index fill argument information
4602 bool is_index_space;
4603 Domain index_domain;
4604 DomainPoint index_point;
4605 IndexSpace sharding_space;
4606 };
4607
4615 class Partition : public Mappable {
4616 public:
4617 Partition(void);
4618 public:
4619 virtual MappableType get_mappable_type(void) const
4620 { return LEGION_PARTITION_MAPPABLE; }
4621 virtual const Partition* as_partition(void) const { return this; }
4622 public:
4623 enum PartitionKind {
4624 BY_FIELD, // create partition by field
4625 BY_IMAGE, // create partition by image
4626 BY_IMAGE_RANGE, // create partition by image range
4627 BY_PREIMAGE, // create partition by preimage
4628 BY_PREIMAGE_RANGE, // create partition by preimage range
4629 BY_ASSOCIATION, // create partition by association
4630 };
4631 virtual PartitionKind get_partition_kind(void) const = 0;
4632 public:
4633 // Synthesized region requirement
4634 RegionRequirement requirement;
4635 public:
4636 // Index partition argument information
4637 bool is_index_space;
4638 Domain index_domain;
4639 DomainPoint index_point;
4640 };
4641
4648 class MustEpoch : public Mappable {
4649 public:
4650 MustEpoch(void);
4651 public:
4652 virtual MappableType get_mappable_type(void) const
4653 { return LEGION_MUST_EPOCH_MAPPABLE; }
4654 virtual const MustEpoch* as_must_epoch(void) const { return this; }
4655 public:
4656 std::vector<const Task*> individual_tasks;
4657 std::vector<const Task*> index_space_tasks;
4658 public:
4659 // Index space of points for the must epoch operation
4660 Domain launch_domain;
4661 IndexSpace sharding_space;
4662 };
4663
4664 //==========================================================================
4665 // Runtime Classes
4666 //==========================================================================
4667
4673 struct InputArgs {
4674 public:
4675 char **argv;
4676 int argc;
4677 };
4678
4684 Machine machine;
4685 Runtime *runtime;
4686 std::set<Processor> local_procs;
4687 UntypedBuffer buffer;
4688 };
4689
4703 public:
4704 TaskConfigOptions(bool leaf = false,
4705 bool inner = false,
4706 bool idempotent = false);
4707 public:
4708 bool leaf;
4709 bool inner;
4710 bool idempotent;
4711 };
4712
4731 public:
4732 ProjectionFunctor(void);
4734 virtual ~ProjectionFunctor(void);
4735 public:
4752 virtual LogicalRegion project(const Mappable *mappable, unsigned index,
4753 LogicalRegion upper_bound,
4754 const DomainPoint &point);
4763 virtual LogicalRegion project(const Mappable *mappable, unsigned index,
4764 LogicalPartition upper_bound,
4765 const DomainPoint &point);
4766
4778 const DomainPoint &point,
4779 const Domain &launch_domain);
4780
4792 const DomainPoint &point,
4793 const Domain &launch_domain);
4794
4808 const DomainPoint &point,
4809 const Domain &launch_domain,
4810 const void *args, size_t size);
4811
4825 const DomainPoint &point,
4826 const Domain &launch_domain,
4827 const void *args, size_t size);
4828
4840 LEGION_DEPRECATED("The interface for projection functors has been "
4841 "updated. Please use the new 'project' methods.")
4842 virtual LogicalRegion project(Context ctx, Task *task,
4843 unsigned index,
4844 LogicalRegion upper_bound,
4845 const DomainPoint &point);
4857 LEGION_DEPRECATED("The interface for projection functors has been "
4858 "updated. Please use the new 'project' methods.")
4859 virtual LogicalRegion project(Context ctx, Task *task,
4860 unsigned index,
4861 LogicalPartition upper_bound,
4862 const DomainPoint &point);
4864
4872 virtual void invert(LogicalRegion region, LogicalRegion upper_bound,
4873 const Domain &launch_domain,
4874 std::vector<DomainPoint> &ordered_points);
4875 virtual void invert(LogicalRegion region, LogicalPartition upper_bound,
4876 const Domain &launch_domain,
4877 std::vector<DomainPoint> &ordered_points);
4879
4881
4901 virtual bool is_complete(LogicalRegion upper_bound,
4902 const Domain &launch_domain);
4903 virtual bool is_complete(LogicalPartition upper_bound,
4904 const Domain &launch_domain);
4905 virtual bool is_complete(Mappable *mappable, unsigned index,
4906 LogicalRegion upper_bound, const Domain &launch_domain);
4907 virtual bool is_complete(Mappable *mappable, unsigned index,
4908 LogicalPartition upper_bound, const Domain &launch_domain);
4910
4917 virtual bool is_exclusive(void) const { return false; }
4918
4919 /*
4920 * Indicate whether this is a functional projection
4921 * functor or whether it depends on the operation being
4922 * launched. This will determine which project method
4923 * is invoked by the runtime.
4924 */
4925 virtual bool is_functional(void) const { return false; }
4926
4932 virtual bool is_invertible(void) const { return false; }
4933
4945 virtual unsigned get_depth(void) const = 0;
4946 private:
4947 friend class Internal::Runtime;
4948 // For pre-registered projection functors the runtime will
4949 // use this to initialize the runtime pointer
4950 inline void set_runtime(Runtime *rt) { runtime = rt; }
4951 protected:
4952 Runtime *runtime;
4953 };
4954
4969 public:
4970 ShardingFunctor(void);
4971 virtual ~ShardingFunctor(void);
4972 public:
4973 // Indicate whether this functor wants to use the ShardID or
4974 // DomainPoint versions of these methods
4975 virtual bool use_points(void) const { return false; }
4976 public:
4977 // The ShardID version of this method
4978 virtual ShardID shard(const DomainPoint &index_point,
4979 const Domain &index_domain,
4980 const size_t total_shards);
4981 // The DomainPoint version of this method
4982 virtual DomainPoint shard_points(const DomainPoint &index_point,
4983 const Domain &index_domain,
4984 const std::vector<DomainPoint> &shard_points,
4985 const Domain &shard_domain);
4986 public:
4987 virtual bool is_invertible(void) const { return false; }
4988 // The ShardID version of this method
4989 virtual void invert(ShardID shard,
4990 const Domain &sharding_domain,
4991 const Domain &index_domain,
4992 const size_t total_shards,
4993 std::vector<DomainPoint> &points);
4994 // The DomainPoint version of this method
4995 virtual void invert_points(const DomainPoint &shard_point,
4996 const std::vector<DomainPoint> &shard_points,
4997 const Domain &shard_domain,
4998 const Domain &index_domain,
4999 const Domain &sharding_domain,
5000 std::vector<DomainPoint> &index_points);
5001 };
5002
5019 public:
5020 virtual ~FutureFunctor(void) { }
5021 public:
5022 virtual const void* callback_get_future(size_t &size, bool &owned,
5023 const Realm::ExternalInstanceResource *&resource,
5024 void (*&freefunc)(const Realm::ExternalInstanceResource&),
5025 const void *&metadata, size_t &metasize) = 0;
5026 virtual void callback_release_future(void) = 0;
5027 };
5028
5038 public:
5039 virtual ~PointTransformFunctor(void) { }
5040 public:
5041 virtual bool is_invertible(void) const { return false; }
5042 // Transform a point from the domain into a point in the range
5043 virtual DomainPoint transform_point(const DomainPoint &point,
5044 const Domain &domain,
5045 const Domain &range) = 0;
5046 // Invert a point from range and convert it into a point in the domain
5047 // This is only called if is_invertible returns true
5048 virtual DomainPoint invert_point(const DomainPoint &point,
5049 const Domain &domain,
5050 const Domain &range)
5051 { return DomainPoint(); }
5052 };
5053
5077 class Runtime {
5078 protected:
5079 // The Runtime bootstraps itself and should
5080 // never need to be explicitly created.
5081 friend class Internal::Runtime;
5082 friend class Future;
5083 Runtime(Internal::Runtime *rt);
5084 public:
5085 //------------------------------------------------------------------------
5086 // Index Space Operations
5087 //------------------------------------------------------------------------
5089
5100 IndexSpace create_index_space(Context ctx, const Domain &bounds,
5101 TypeTag type_tag = 0,
5102 const char *provenance = NULL);
5103 // Template version
5104 template<int DIM, typename COORD_T>
5105 IndexSpaceT<DIM,COORD_T> create_index_space(Context ctx,
5106 const Rect<DIM,COORD_T> &bounds,
5107 const char *provenance = NULL);
5108 template<int DIM, typename COORD_T>
5109 IndexSpaceT<DIM,COORD_T> create_index_space(Context ctx,
5110 const DomainT<DIM,COORD_T> &bounds,
5111 const char *provenance = NULL);
5114
5127 IndexSpace create_index_space(Context ctx, size_t dimensions,
5128 const Future &f, TypeTag type_tag = 0,
5129 const char *provenance = NULL);
5130 template<int DIM, typename COORD_T>
5131 IndexSpaceT<DIM,COORD_T> create_index_space(Context ctx, const Future &f,
5132 const char *provenance = NULL);
5135
5144 const std::vector<DomainPoint> &points,
5145 const char *provenance = NULL);
5146 // Template version
5147 template<int DIM, typename COORD_T>
5148 IndexSpaceT<DIM,COORD_T> create_index_space(Context ctx,
5149 const std::vector<Point<DIM,COORD_T> > &points,
5150 const char *provenance = NULL);
5153
5162 const std::vector<Domain> &rects,
5163 const char *provenance = NULL);
5164 // Template version
5165 template<int DIM, typename COORD_T>
5166 IndexSpaceT<DIM,COORD_T> create_index_space(Context ctx,
5167 const std::vector<Rect<DIM,COORD_T> > &rects,
5168 const char *provenance = NULL);
5171
5181 const std::vector<IndexSpace> &spaces,
5182 const char *provenance = NULL);
5183 // Template version
5184 template<int DIM, typename COORD_T>
5185 IndexSpaceT<DIM,COORD_T> union_index_spaces(Context ctx,
5186 const std::vector<IndexSpaceT<DIM,COORD_T> > &spaces,
5187 const char *provenance = NULL);
5190
5200 const std::vector<IndexSpace> &spaces,
5201 const char *provenance = NULL);
5202 // Template version
5203 template<int DIM, typename COORD_T>
5204 IndexSpaceT<DIM,COORD_T> intersect_index_spaces(Context ctx,
5205 const std::vector<IndexSpaceT<DIM,COORD_T> > &spaces,
5206 const char *provenance = NULL);
5209
5216 IndexSpace left, IndexSpace right,
5217 const char *provenance = NULL);
5218 // Template version
5219 template<int DIM, typename COORD_T>
5220 IndexSpaceT<DIM,COORD_T> subtract_index_spaces(Context ctx,
5221 IndexSpaceT<DIM,COORD_T> left, IndexSpaceT<DIM,COORD_T> right,
5222 const char *provenance = NULL);
5224
5231 LEGION_DEPRECATED("Use the new index space creation routines with a "
5232 "single domain or rectangle.")
5233 IndexSpace create_index_space(Context ctx, size_t max_num_elmts);
5241 LEGION_DEPRECATED("Use the new index space creation routines with a "
5242 "single domain or rectangle.")
5243 IndexSpace create_index_space(Context ctx,
5244 const std::set<Domain> &domains);
5255 void create_shared_ownership(Context ctx, IndexSpace handle);
5266 void destroy_index_space(Context ctx, IndexSpace handle,
5267 const bool unordered = false,
5268 const bool recurse = true,
5269 const char *provenance = NULL);
5270 public:
5281 void create_shared_ownership(Context ctx, IndexPartition handle);
5292 void destroy_index_partition(Context ctx, IndexPartition handle,
5293 const bool unordered = false,
5294 const bool recurse = true,
5295 const char *provenance = NULL);
5296 public:
5297 //------------------------------------------------------------------------
5298 // Dependent Partitioning Operations
5299 //------------------------------------------------------------------------
5301
5321 IndexPartition create_equal_partition(Context ctx, IndexSpace parent,
5322 IndexSpace color_space,
5323 size_t granularity = 1,
5324 Color color =
5325 LEGION_AUTO_GENERATE_ID,
5326 const char *provenance = NULL);
5327 template<int DIM, typename COORD_T,
5328 int COLOR_DIM, typename COLOR_COORD_T>
5329 IndexPartitionT<DIM,COORD_T> create_equal_partition(Context ctx,
5330 IndexSpaceT<DIM,COORD_T> parent,
5331 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5332 size_t granularity = 1,
5333 Color color = LEGION_AUTO_GENERATE_ID,
5334 const char *provenance = NULL);
5337
5354 IndexPartition create_partition_by_weights(Context ctx, IndexSpace parent,
5355 const std::map<DomainPoint,int> &weights,
5356 IndexSpace color_space,
5357 size_t granularity = 1,
5358 Color color = LEGION_AUTO_GENERATE_ID,
5359 const char *provenance = NULL);
5360 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5361 IndexPartitionT<DIM,COORD_T> create_partition_by_weights(Context ctx,
5362 IndexSpaceT<DIM,COORD_T> parent,
5363 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,int> &weights,
5364 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5365 size_t granularity = 1,
5366 Color color = LEGION_AUTO_GENERATE_ID,
5367 const char *provenance = NULL);
5368 // 64-bit versions
5369 IndexPartition create_partition_by_weights(Context ctx, IndexSpace parent,
5370 const std::map<DomainPoint,size_t> &weights,
5371 IndexSpace color_space,
5372 size_t granularity = 1,
5373 Color color = LEGION_AUTO_GENERATE_ID,
5374 const char *provenance = NULL);
5375 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5376 IndexPartitionT<DIM,COORD_T> create_partition_by_weights(Context ctx,
5377 IndexSpaceT<DIM,COORD_T> parent,
5378 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,size_t> &weights,
5379 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5380 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
5381 const char *provenance = NULL);
5382 // Alternate versions of the above method that take a future map where
5383 // the values in the future map will be interpretted as integer weights
5384 // You can use this method with both 32 and 64 bit weights
5385 IndexPartition create_partition_by_weights(Context ctx, IndexSpace parent,
5386 const FutureMap &weights,
5387 IndexSpace color_space,
5388 size_t granularity = 1,
5389 Color color =
5390 LEGION_AUTO_GENERATE_ID,
5391 const char *provenance = NULL);
5392 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5393 IndexPartitionT<DIM,COORD_T> create_partition_by_weights(Context ctx,
5394 IndexSpaceT<DIM,COORD_T> parent,
5395 const FutureMap &weights,
5396 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5397 size_t granularity = 1,
5398 Color color = LEGION_AUTO_GENERATE_ID,
5399 const char *provenance = NULL);
5402
5426 IndexPartition create_partition_by_union(Context ctx,
5427 IndexSpace parent,
5428 IndexPartition handle1,
5429 IndexPartition handle2,
5430 IndexSpace color_space,
5431 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5432 Color color = LEGION_AUTO_GENERATE_ID,
5433 const char *provenance = NULL);
5434 template<int DIM, typename COORD_T,
5435 int COLOR_DIM, typename COLOR_COORD_T>
5436 IndexPartitionT<DIM,COORD_T> create_partition_by_union(Context ctx,
5437 IndexSpaceT<DIM,COORD_T> parent,
5438 IndexPartitionT<DIM,COORD_T> handle1,
5439 IndexPartitionT<DIM,COORD_T> handle2,
5440 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5441 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5442 Color color = LEGION_AUTO_GENERATE_ID,
5443 const char *provenance = NULL);
5446
5471 IndexPartition create_partition_by_intersection(Context ctx,
5472 IndexSpace parent,
5473 IndexPartition handle1,
5474 IndexPartition handle2,
5475 IndexSpace color_space,
5476 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5477 Color color = LEGION_AUTO_GENERATE_ID,
5478 const char *provenance = NULL);
5479 template<int DIM, typename COORD_T,
5480 int COLOR_DIM, typename COLOR_COORD_T>
5481 IndexPartitionT<DIM,COORD_T> create_partition_by_intersection(
5482 Context ctx,
5483 IndexSpaceT<DIM,COORD_T> parent,
5484 IndexPartitionT<DIM,COORD_T> handle1,
5485 IndexPartitionT<DIM,COORD_T> handle2,
5486 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5487 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5488 Color color = LEGION_AUTO_GENERATE_ID,
5489 const char *provenance = NULL);
5492
5512 IndexPartition create_partition_by_intersection(Context ctx,
5513 IndexSpace parent,
5514 IndexPartition partition,
5515 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5516 Color color = LEGION_AUTO_GENERATE_ID,
5517 bool dominates = false,
5518 const char *provenance = NULL);
5519 template<int DIM, typename COORD_T>
5520 IndexPartitionT<DIM,COORD_T> create_partition_by_intersection(Context ctx,
5521 IndexSpaceT<DIM,COORD_T> parent,
5522 IndexPartitionT<DIM,COORD_T> partition,
5523 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5524 Color color = LEGION_AUTO_GENERATE_ID,
5525 bool dominates = false,
5526 const char *provenance = NULL);
5529
5554 IndexPartition create_partition_by_difference(Context ctx,
5555 IndexSpace parent,
5556 IndexPartition handle1,
5557 IndexPartition handle2,
5558 IndexSpace color_space,
5559 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5560 Color color = LEGION_AUTO_GENERATE_ID,
5561 const char *provenance = NULL);
5562 template<int DIM, typename COORD_T,
5563 int COLOR_DIM, typename COLOR_COORD_T>
5564 IndexPartitionT<DIM,COORD_T> create_partition_by_difference(Context ctx,
5565 IndexSpaceT<DIM,COORD_T> parent,
5566 IndexPartitionT<DIM,COORD_T> handle1,
5567 IndexPartitionT<DIM,COORD_T> handle2,
5568 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5569 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5570 Color color = LEGION_AUTO_GENERATE_ID,
5571 const char *provenance = NULL);
5574
5599 Color create_cross_product_partitions(Context ctx,
5600 IndexPartition handle1,
5601 IndexPartition handle2,
5602 std::map<IndexSpace,IndexPartition> &handles,
5603 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5604 Color color = LEGION_AUTO_GENERATE_ID,
5605 const char *provenance = NULL);
5606 template<int DIM, typename COORD_T,
5607 int COLOR_DIM, typename COLOR_COORD_T>
5608 Color create_cross_product_partitions(Context ctx,
5609 IndexPartitionT<DIM,COORD_T> handle1,
5610 IndexPartitionT<DIM,COORD_T> handle2,
5611 typename std::map<
5612 IndexSpaceT<DIM,COORD_T>,
5613 IndexPartitionT<DIM,COORD_T> > &handles,
5614 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5615 Color color = LEGION_AUTO_GENERATE_ID,
5616 const char *provenance = NULL);
5619
5643 void create_association(Context ctx,
5644 LogicalRegion domain,
5645 LogicalRegion domain_parent,
5646 FieldID domain_fid,
5647 IndexSpace range,
5648 MapperID id = 0,
5649 MappingTagID tag = 0,
5650 UntypedBuffer map_arg = UntypedBuffer(),
5651 const char *provenance = NULL);
5652 void create_bidirectional_association(Context ctx,
5653 LogicalRegion domain,
5654 LogicalRegion domain_parent,
5655 FieldID domain_fid,
5656 LogicalRegion range,
5657 LogicalRegion range_parent,
5658 FieldID range_fid,
5659 MapperID id = 0,
5660 MappingTagID tag = 0,
5661 UntypedBuffer map_arg =
5662 UntypedBuffer(),
5663 const char *provenance = NULL);
5664 // Template versions
5665 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
5666 void create_association(Context ctx,
5667 LogicalRegionT<DIM1,COORD_T1> domain,
5668 LogicalRegionT<DIM1,COORD_T1> domain_parent,
5669 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
5670 IndexSpaceT<DIM2,COORD_T2> range,
5671 MapperID id = 0,
5672 MappingTagID tag = 0,
5673 UntypedBuffer map_arg = UntypedBuffer(),
5674 const char *provenance = NULL);
5675 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
5676 void create_bidirectional_association(Context ctx,
5677 LogicalRegionT<DIM1,COORD_T1> domain,
5678 LogicalRegionT<DIM1,COORD_T1> domain_parent,
5679 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
5680 LogicalRegionT<DIM2,COORD_T2> range,
5681 LogicalRegionT<DIM2,COORD_T2> range_parent,
5682 FieldID range_fid, // type: Point<DIM1,COORD_T1>
5683 MapperID id = 0,
5684 MappingTagID tag = 0,
5685 UntypedBuffer map_arg = UntypedBuffer(),
5686 const char *provenance = NULL);
5689
5714 IndexPartition create_partition_by_restriction(Context ctx,
5715 IndexSpace parent,
5716 IndexSpace color_space,
5717 DomainTransform transform,
5718 Domain extent,
5719 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5720 Color color = LEGION_AUTO_GENERATE_ID,
5721 const char *provenance = NULL);
5722 // Template version
5723 template<int DIM, int COLOR_DIM, typename COORD_T>
5724 IndexPartitionT<DIM,COORD_T> create_partition_by_restriction(Context ctx,
5725 IndexSpaceT<DIM,COORD_T> parent,
5726 IndexSpaceT<COLOR_DIM,COORD_T> color_space,
5727 Transform<DIM,COLOR_DIM,COORD_T> transform,
5728 Rect<DIM,COORD_T> extent,
5729 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5730 Color color = LEGION_AUTO_GENERATE_ID,
5731 const char *provenance = NULL);
5734
5749 IndexPartition create_partition_by_blockify(Context ctx,
5750 IndexSpace parent,
5751 DomainPoint blocking_factor,
5752 Color color = LEGION_AUTO_GENERATE_ID,
5753 const char *provenance = NULL);
5754 // Template version
5755 template<int DIM, typename COORD_T>
5756 IndexPartitionT<DIM,COORD_T> create_partition_by_blockify(Context ctx,
5757 IndexSpaceT<DIM,COORD_T> parent,
5758 Point<DIM,COORD_T> blocking_factor,
5759 Color color = LEGION_AUTO_GENERATE_ID,
5760 const char *provenance = NULL);
5773 IndexPartition create_partition_by_blockify(Context ctx,
5774 IndexSpace parent,
5775 DomainPoint blockify_factor,
5776 DomainPoint origin,
5777 Color color = LEGION_AUTO_GENERATE_ID,
5778 const char *provenance = NULL);
5779 // Template version
5780 template<int DIM, typename COORD_T>
5781 IndexPartitionT<DIM,COORD_T> create_partition_by_blockify(Context ctx,
5782 IndexSpaceT<DIM,COORD_T> parent,
5783 Point<DIM,COORD_T> blocking_factor,
5784 Point<DIM,COORD_T> origin,
5785 Color color = LEGION_AUTO_GENERATE_ID,
5786 const char *provenance = NULL);
5789
5809 IndexPartition create_partition_by_domain(Context ctx,
5810 IndexSpace parent,
5811 const std::map<DomainPoint,Domain> &domains,
5812 IndexSpace color_space,
5813 bool perform_intersections = true,
5814 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5815 Color color = LEGION_AUTO_GENERATE_ID,
5816 const char *provenance = NULL);
5817 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5818 IndexPartitionT<DIM,COORD_T> create_partition_by_domain(Context ctx,
5819 IndexSpaceT<DIM,COORD_T> parent,
5820 const std::map<
5821 Point<COLOR_DIM,COLOR_COORD_T>,
5822 DomainT<DIM,COORD_T> > &domains,
5823 IndexSpaceT<COLOR_DIM,
5824 COLOR_COORD_T> color_space,
5825 bool perform_intersections = true,
5826 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5827 Color color = LEGION_AUTO_GENERATE_ID,
5828 const char *provenance = NULL);
5846 IndexPartition create_partition_by_domain(Context ctx,
5847 IndexSpace parent,
5848 const FutureMap &domain_future_map,
5849 IndexSpace color_space,
5850 bool perform_intersections = true,
5851 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5852 Color color = LEGION_AUTO_GENERATE_ID,
5853 const char *provenance = NULL);
5854 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5855 IndexPartitionT<DIM,COORD_T> create_partition_by_domain(Context ctx,
5856 IndexSpaceT<DIM,COORD_T> parent,
5857 const FutureMap &domain_future_map,
5858 IndexSpaceT<COLOR_DIM,
5859 COLOR_COORD_T> color_space,
5860 bool perform_intersections = true,
5861 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5862 Color color = LEGION_AUTO_GENERATE_ID,
5863 const char *provenance = NULL);
5866
5883 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
5884 IndexPartitionT<DIM,COORD_T> create_partition_by_rectangles(Context ctx,
5885 IndexSpaceT<DIM,COORD_T> parent,
5886 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,
5887 std::vector<Rect<DIM,COORD_T> > > &rectangles,
5888 IndexSpaceT<COLOR_DIM,
5889 COLOR_COORD_T> color_space,
5890 bool perform_intersections = true,
5891 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5892 Color color = LEGION_AUTO_GENERATE_ID,
5893 const char *provenance = NULL,
5894 bool collective = false);
5897
5925 IndexPartition create_partition_by_field(Context ctx,
5926 LogicalRegion handle,
5927 LogicalRegion parent,
5928 FieldID fid,
5929 IndexSpace color_space,
5930 Color color =
5931 LEGION_AUTO_GENERATE_ID,
5932 MapperID id = 0,
5933 MappingTagID tag = 0,
5934 PartitionKind part_kind =
5935 LEGION_DISJOINT_KIND,
5936 UntypedBuffer map_arg =
5937 UntypedBuffer(),
5938 const char *provenance = NULL);
5939 template<int DIM, typename COORD_T,
5940 int COLOR_DIM, typename COLOR_COORD_T>
5941 IndexPartitionT<DIM,COORD_T> create_partition_by_field(Context ctx,
5942 LogicalRegionT<DIM,COORD_T> handle,
5943 LogicalRegionT<DIM,COORD_T> parent,
5944 FieldID fid, // type: Point<COLOR_DIM,COLOR_COORD_T>
5945 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
5946 Color color = LEGION_AUTO_GENERATE_ID,
5947 MapperID id = 0, MappingTagID tag = 0,
5948 PartitionKind part_kind = LEGION_DISJOINT_KIND,
5949 UntypedBuffer map_arg = UntypedBuffer(),
5950 const char *provenance = NULL);
5953
5986 IndexPartition create_partition_by_image(Context ctx,
5987 IndexSpace handle,
5988 LogicalPartition projection,
5989 LogicalRegion parent,
5990 FieldID fid,
5991 IndexSpace color_space,
5992 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5993 Color color = LEGION_AUTO_GENERATE_ID,
5994 MapperID id = 0, MappingTagID tag = 0,
5995 UntypedBuffer map_arg = UntypedBuffer(),
5996 const char *provenance = NULL);
5997 template<int DIM1, typename COORD_T1,
5998 int DIM2, typename COORD_T2,
5999 int COLOR_DIM, typename COLOR_COORD_T>
6000 IndexPartitionT<DIM2,COORD_T2> create_partition_by_image(Context ctx,
6001 IndexSpaceT<DIM2,COORD_T2> handle,
6002 LogicalPartitionT<DIM1,COORD_T1> projection,
6003 LogicalRegionT<DIM1,COORD_T1> parent,
6004 FieldID fid, // type: Point<DIM2,COORD_T2>
6005 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
6006 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6007 Color color = LEGION_AUTO_GENERATE_ID,
6008 MapperID id = 0, MappingTagID tag = 0,
6009 UntypedBuffer map_arg = UntypedBuffer(),
6010 const char *provenance = NULL);
6011 // Range versions of image
6012 IndexPartition create_partition_by_image_range(Context ctx,
6013 IndexSpace handle,
6014 LogicalPartition projection,
6015 LogicalRegion parent,
6016 FieldID fid,
6017 IndexSpace color_space,
6018 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6019 Color color = LEGION_AUTO_GENERATE_ID,
6020 MapperID id = 0, MappingTagID tag = 0,
6021 UntypedBuffer map_arg = UntypedBuffer(),
6022 const char *provenance = NULL);
6023 template<int DIM1, typename COORD_T1,
6024 int DIM2, typename COORD_T2,
6025 int COLOR_DIM, typename COLOR_COORD_T>
6026 IndexPartitionT<DIM2,COORD_T2> create_partition_by_image_range(
6027 Context ctx,
6028 IndexSpaceT<DIM2,COORD_T2> handle,
6029 LogicalPartitionT<DIM1,COORD_T1> projection,
6030 LogicalRegionT<DIM1,COORD_T1> parent,
6031 FieldID fid, // type: Rect<DIM2,COORD_T2>
6032 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
6033 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6034 Color color = LEGION_AUTO_GENERATE_ID,
6035 MapperID id = 0, MappingTagID tag = 0,
6036 UntypedBuffer map_arg = UntypedBuffer(),
6037 const char *provenance = NULL);
6040
6070 IndexPartition create_partition_by_preimage(Context ctx,
6071 IndexPartition projection,
6072 LogicalRegion handle,
6073 LogicalRegion parent,
6074 FieldID fid,
6075 IndexSpace color_space,
6076 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6077 Color color = LEGION_AUTO_GENERATE_ID,
6078 MapperID id = 0, MappingTagID tag = 0,
6079 UntypedBuffer map_arg = UntypedBuffer(),
6080 const char *provenance = NULL);
6081 template<int DIM1, typename COORD_T1,
6082 int DIM2, typename COORD_T2,
6083 int COLOR_DIM, typename COLOR_COORD_T>
6084 IndexPartitionT<DIM1,COORD_T1> create_partition_by_preimage(Context ctx,
6085 IndexPartitionT<DIM2,COORD_T2> projection,
6086 LogicalRegionT<DIM1,COORD_T1> handle,
6087 LogicalRegionT<DIM1,COORD_T1> parent,
6088 FieldID fid, // type: Point<DIM2,COORD_T2>
6089 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
6090 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6091 Color color = LEGION_AUTO_GENERATE_ID,
6092 MapperID id = 0, MappingTagID tag = 0,
6093 UntypedBuffer map_arg = UntypedBuffer(),
6094 const char *provenance = NULL);
6095 // Range versions of preimage
6096 IndexPartition create_partition_by_preimage_range(Context ctx,
6097 IndexPartition projection,
6098 LogicalRegion handle,
6099 LogicalRegion parent,
6100 FieldID fid,
6101 IndexSpace color_space,
6102 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6103 Color color = LEGION_AUTO_GENERATE_ID,
6104 MapperID id = 0, MappingTagID tag = 0,
6105 UntypedBuffer map_arg = UntypedBuffer(),
6106 const char *provenance = NULL);
6107 template<int DIM1, typename COORD_T1,
6108 int DIM2, typename COORD_T2,
6109 int COLOR_DIM, typename COLOR_COORD_T>
6110 IndexPartitionT<DIM1,COORD_T1> create_partition_by_preimage_range(
6111 Context ctx,
6112 IndexPartitionT<DIM2,COORD_T2> projection,
6113 LogicalRegionT<DIM1,COORD_T1> handle,
6114 LogicalRegionT<DIM1,COORD_T1> parent,
6115 FieldID fid, // type: Rect<DIM2,COORD_T2>
6116 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
6117 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6118 Color color = LEGION_AUTO_GENERATE_ID,
6119 MapperID id = 0, MappingTagID tag = 0,
6120 UntypedBuffer map_arg = UntypedBuffer(),
6121 const char *provenance = NULL);
6123 public:
6124 //------------------------------------------------------------------------
6125 // Computed Index Spaces and Partitions
6126 //------------------------------------------------------------------------
6128
6154 IndexPartition create_pending_partition(Context ctx,
6155 IndexSpace parent,
6156 IndexSpace color_space,
6157 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6158 Color color = LEGION_AUTO_GENERATE_ID,
6159 const char *provenance = NULL);
6160 template<int DIM, typename COORD_T,
6161 int COLOR_DIM, typename COLOR_COORD_T>
6162 IndexPartitionT<DIM,COORD_T> create_pending_partition(Context ctx,
6163 IndexSpaceT<DIM,COORD_T> parent,
6164 IndexSpaceT<COLOR_DIM,COLOR_COORD_T> color_space,
6165 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6166 Color color = LEGION_AUTO_GENERATE_ID,
6167 const char *provenance = NULL);
6170
6186 IndexSpace create_index_space_union(Context ctx, IndexPartition parent,
6187 const DomainPoint &color,
6188 const std::vector<IndexSpace> &handles,
6189 const char *provenance = NULL);
6190 template<int DIM, typename COORD_T,
6191 int COLOR_DIM, typename COLOR_COORD_T>
6192 IndexSpaceT<DIM,COORD_T> create_index_space_union(Context ctx,
6193 IndexPartitionT<DIM,COORD_T> parent,
6194 Point<COLOR_DIM,COLOR_COORD_T> color,
6195 const typename std::vector<
6196 IndexSpaceT<DIM,COORD_T> > &handles,
6197 const char *provenance = NULL);
6200
6213 IndexSpace create_index_space_union(Context ctx, IndexPartition parent,
6214 const DomainPoint &color,
6215 IndexPartition handle,
6216 const char *provenance = NULL);
6217 template<int DIM, typename COORD_T,
6218 int COLOR_DIM, typename COLOR_COORD_T>
6219 IndexSpaceT<DIM,COORD_T> create_index_space_union(Context ctx,
6220 IndexPartitionT<DIM,COORD_T> parent,
6221 Point<COLOR_DIM,COLOR_COORD_T> color,
6222 IndexPartitionT<DIM,COORD_T> handle,
6223 const char *provenance = NULL);
6226
6242 IndexSpace create_index_space_intersection(Context ctx,
6243 IndexPartition parent,
6244 const DomainPoint &color,
6245 const std::vector<IndexSpace> &handles,
6246 const char *provenance = NULL);
6247 template<int DIM, typename COORD_T,
6248 int COLOR_DIM, typename COLOR_COORD_T>
6249 IndexSpaceT<DIM,COORD_T> create_index_space_intersection(Context ctx,
6250 IndexPartitionT<DIM,COORD_T> parent,
6251 Point<COLOR_DIM,COLOR_COORD_T> color,
6252 const typename std::vector<
6253 IndexSpaceT<DIM,COORD_T> > &handles,
6254 const char *provenance = NULL);
6257
6270 IndexSpace create_index_space_intersection(Context ctx,
6271 IndexPartition parent,
6272 const DomainPoint &color,
6273 IndexPartition handle,
6274 const char *provenannce=NULL);
6275 template<int DIM, typename COORD_T,
6276 int COLOR_DIM, typename COLOR_COORD_T>
6277 IndexSpaceT<DIM,COORD_T> create_index_space_intersection(Context ctx,
6278 IndexPartitionT<DIM,COORD_T> parent,
6279 Point<COLOR_DIM,COLOR_COORD_T> color,
6280 IndexPartitionT<DIM,COORD_T> handle,
6281 const char *provenance = NULL);
6284
6305 IndexSpace create_index_space_difference(Context ctx,
6306 IndexPartition parent,
6307 const DomainPoint &color,
6308 IndexSpace initial,
6309 const std::vector<IndexSpace> &handles,
6310 const char *provenancne = NULL);
6311 template<int DIM, typename COORD_T,
6312 int COLOR_DIM, typename COLOR_COORD_T>
6313 IndexSpaceT<DIM,COORD_T> create_index_space_difference(Context ctx,
6314 IndexPartitionT<DIM,COORD_T> parent,
6315 Point<COLOR_DIM,COLOR_COORD_T> color,
6316 IndexSpaceT<DIM,COORD_T> initial,
6317 const typename std::vector<
6318 IndexSpaceT<DIM,COORD_T> > &handles,
6319 const char *provenance = NULL);
6321 public:
6322 //------------------------------------------------------------------------
6323 // Index Tree Traversal Operations
6324 //------------------------------------------------------------------------
6326
6334 IndexPartition get_index_partition(Context ctx, IndexSpace parent,
6335 Color color);
6336 IndexPartition get_index_partition(Context ctx, IndexSpace parent,
6337 const DomainPoint &color);
6338 // Context free versions
6339 IndexPartition get_index_partition(IndexSpace parent, Color color);
6340 IndexPartition get_index_partition(IndexSpace parent,
6341 const DomainPoint &color);
6342 // Template version
6343 template<int DIM, typename COORD_T>
6344 IndexPartitionT<DIM,COORD_T> get_index_partition(
6345 IndexSpaceT<DIM,COORD_T> parent, Color color);
6346
6348
6350
6358 bool has_index_partition(Context ctx, IndexSpace parent, Color color);
6359 bool has_index_partition(Context ctx, IndexSpace parent,
6360 const DomainPoint &color);
6361 // Context free
6362 bool has_index_partition(IndexSpace parent, Color color);
6363 bool has_index_partition(IndexSpace parent,
6364 const DomainPoint &color);
6365 // Template version
6366 template<int DIM, typename COORD_T>
6367 bool has_index_partition(IndexSpaceT<DIM,COORD_T> parent, Color color);
6369
6371
6379 IndexSpace get_index_subspace(Context ctx, IndexPartition p,
6380 Color color);
6381 IndexSpace get_index_subspace(Context ctx, IndexPartition p,
6382 const DomainPoint &color);
6383 // Context free versions
6384 IndexSpace get_index_subspace(IndexPartition p, Color color);
6385 IndexSpace get_index_subspace(IndexPartition p,
6386 const DomainPoint &color);
6387 // Template version
6388 template<int DIM, typename COORD_T,
6389 int COLOR_DIM, typename COLOR_COORD_T>
6390 IndexSpaceT<DIM,COORD_T> get_index_subspace(
6391 IndexPartitionT<DIM,COORD_T> p,
6392 Point<COLOR_DIM,COLOR_COORD_T> color);
6394
6396
6404 bool has_index_subspace(Context ctx, IndexPartition p,
6405 const DomainPoint &color);
6406 // Context free
6407 bool has_index_subspace(IndexPartition p,
6408 const DomainPoint &color);
6409 // Template version
6410 template<int DIM, typename COORD_T,
6411 int COLOR_DIM, typename COLOR_COORD_T>
6412 bool has_index_subspace(IndexPartitionT<DIM,COORD_T> p,
6413 Point<COLOR_DIM,COLOR_COORD_T> color);
6415
6417
6427 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6428 bool has_multiple_domains(Context ctx, IndexSpace handle);
6429 // Context free
6430 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6431 bool has_multiple_domains(IndexSpace handle);
6433
6435
6442 Domain get_index_space_domain(Context ctx, IndexSpace handle);
6443 // Context free
6444 Domain get_index_space_domain(IndexSpace handle);
6445 // Template version
6446 template<int DIM, typename COORD_T>
6447 DomainT<DIM,COORD_T> get_index_space_domain(
6448 IndexSpaceT<DIM,COORD_T> handle);
6450
6452
6462 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6463 void get_index_space_domains(Context ctx, IndexSpace handle,
6464 std::vector<Domain> &domains);
6465 // Context free
6466 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6467 void get_index_space_domains(IndexSpace handle,
6468 std::vector<Domain> &domains);
6470
6472
6479 Domain get_index_partition_color_space(Context ctx, IndexPartition p);
6480 // Context free
6481 Domain get_index_partition_color_space(IndexPartition p);
6482 // Template version
6483 template<int DIM, typename COORD_T,
6484 int COLOR_DIM, typename COLOR_COORD_T>
6485 DomainT<COLOR_DIM,COLOR_COORD_T>
6486 get_index_partition_color_space(IndexPartitionT<DIM,COORD_T> p);
6488
6490
6496 IndexSpace get_index_partition_color_space_name(Context ctx,
6497 IndexPartition p);
6498 // Context free
6499 IndexSpace get_index_partition_color_space_name(IndexPartition p);
6500 // Template version
6501 template<int DIM, typename COORD_T,
6502 int COLOR_DIM, typename COLOR_COORD_T>
6503 IndexSpaceT<COLOR_DIM,COLOR_COORD_T>
6504 get_index_partition_color_space_name(IndexPartitionT<DIM,COORD_T> p);
6506
6508
6517 void get_index_space_partition_colors(Context ctx, IndexSpace sp,
6518 std::set<Color> &colors);
6519 void get_index_space_partition_colors(Context ctx, IndexSpace sp,
6520 std::set<DomainPoint> &colors);
6521 // Context free versions
6522 void get_index_space_partition_colors(IndexSpace sp,
6523 std::set<Color> &colors);
6524 void get_index_space_partition_colors(IndexSpace sp,
6525 std::set<DomainPoint> &colors);
6527
6529
6535 bool is_index_partition_disjoint(Context ctx, IndexPartition p);
6536 // Context free
6537 bool is_index_partition_disjoint(IndexPartition p);
6539
6541
6547 bool is_index_partition_complete(Context ctx, IndexPartition p);
6548 // Context free
6549 bool is_index_partition_complete(IndexPartition p);
6551
6553
6561 Color get_index_space_color(Context ctx, IndexSpace handle);
6562 DomainPoint get_index_space_color_point(Context ctx, IndexSpace handle);
6563 // Context free
6564 Color get_index_space_color(IndexSpace handle);
6565 DomainPoint get_index_space_color_point(IndexSpace handle);
6566 // Template version
6567 template<int DIM, typename COORD_T,
6568 int COLOR_DIM, typename COLOR_COORD_T>
6569 Point<COLOR_DIM,COLOR_COORD_T>
6570 get_index_space_color(IndexSpaceT<DIM,COORD_T> handle);
6572
6574
6581 Color get_index_partition_color(Context ctx, IndexPartition handle);
6582 DomainPoint get_index_partition_color_point(Context ctx,
6583 IndexPartition handle);
6584 // Context free
6585 Color get_index_partition_color(IndexPartition handle);
6586 DomainPoint get_index_partition_color_point(IndexPartition handle);
6588
6590
6596 IndexSpace get_parent_index_space(Context ctx, IndexPartition handle);
6597 // Context free
6598 IndexSpace get_parent_index_space(IndexPartition handle);
6599 // Template version
6600 template<int DIM, typename COORD_T>
6601 IndexSpaceT<DIM,COORD_T> get_parent_index_space(
6602 IndexPartitionT<DIM,COORD_T> handle);
6604
6606
6612 bool has_parent_index_partition(Context ctx, IndexSpace handle);
6613 // Context free
6614 bool has_parent_index_partition(IndexSpace handle);
6616
6618
6625 IndexPartition get_parent_index_partition(Context ctx, IndexSpace handle);
6626 // Context free
6627 IndexPartition get_parent_index_partition(IndexSpace handle);
6628 // Template version
6629 template<int DIM, typename COORD_T>
6630 IndexPartitionT<DIM,COORD_T> get_parent_index_partition(
6631 IndexSpaceT<DIM,COORD_T> handle);
6633
6635
6641 unsigned get_index_space_depth(Context ctx, IndexSpace handle);
6642 // Context free
6643 unsigned get_index_space_depth(IndexSpace handle);
6645
6647
6653 unsigned get_index_partition_depth(Context ctx, IndexPartition handle);
6654 // Context free
6655 unsigned get_index_partition_depth(IndexPartition handle);
6657 public:
6658 //------------------------------------------------------------------------
6659 // Safe Cast Operations
6660 //------------------------------------------------------------------------
6670 DomainPoint safe_cast(Context ctx, DomainPoint point,
6671 LogicalRegion region);
6672
6681 template<int DIM, typename COORD_T>
6682 bool safe_cast(Context ctx,
6683 Point<DIM,COORD_T> point,
6684 LogicalRegionT<DIM,COORD_T> region);
6685 public:
6686 //------------------------------------------------------------------------
6687 // Field Space Operations
6688 //------------------------------------------------------------------------
6696 FieldSpace create_field_space(Context ctx, const char *provenance = NULL);
6708 FieldSpace create_field_space(Context ctx,
6709 const std::vector<size_t> &field_sizes,
6710 std::vector<FieldID> &resulting_fields,
6711 CustomSerdezID serdez_id = 0,
6712 const char *provenance = NULL);
6724 FieldSpace create_field_space(Context ctx,
6725 const std::vector<Future> &field_sizes,
6726 std::vector<FieldID> &resulting_fields,
6727 CustomSerdezID serdez_id = 0,
6728 const char *provenance = NULL);
6739 void create_shared_ownership(Context ctx, FieldSpace handle);
6749 void destroy_field_space(Context ctx, FieldSpace handle,
6750 const bool unordered = false,
6751 const char *provenance = NULL);
6752
6754
6761 size_t get_field_size(Context ctx, FieldSpace handle, FieldID fid);
6762 // Context free
6763 size_t get_field_size(FieldSpace handle, FieldID fid);
6765
6767
6773 void get_field_space_fields(Context ctx, FieldSpace handle,
6774 std::vector<FieldID> &fields);
6775 // Context free
6776 void get_field_space_fields(FieldSpace handle,
6777 std::vector<FieldID> &fields);
6779
6781
6787 void get_field_space_fields(Context ctx, FieldSpace handle,
6788 std::set<FieldID> &fields);
6789 // Context free
6790 void get_field_space_fields(FieldSpace handle,
6791 std::set<FieldID> &fields);
6793 public:
6794 //------------------------------------------------------------------------
6795 // Logical Region Operations
6796 //------------------------------------------------------------------------
6810 LogicalRegion create_logical_region(Context ctx, IndexSpace index,
6811 FieldSpace fields,
6812 bool task_local = false,
6813 const char *provenance = NULL);
6814 // Template version
6815 template<int DIM, typename COORD_T>
6816 LogicalRegionT<DIM,COORD_T> create_logical_region(Context ctx,
6817 IndexSpaceT<DIM,COORD_T> index,
6818 FieldSpace fields,
6819 bool task_local = false,
6820 const char *provenance = NULL);
6831 void create_shared_ownership(Context ctx, LogicalRegion handle);
6841 void destroy_logical_region(Context ctx, LogicalRegion handle,
6842 const bool unordered = false,
6843 const char *provenance = NULL);
6844
6852 LEGION_DEPRECATED("Destruction of logical partitions are no-ops now."
6853 "Logical partitions are automatically destroyed when their root "
6854 "logical region or their index spartition are destroyed.")
6855 void destroy_logical_partition(Context ctx, LogicalPartition handle,
6856 const bool unordered = false);
6857
6876 void reset_equivalence_sets(Context ctx, LogicalRegion parent,
6877 LogicalRegion region,
6878 const std::set<FieldID> &fields);
6879 public:
6880 //------------------------------------------------------------------------
6881 // Logical Region Tree Traversal Operations
6882 //------------------------------------------------------------------------
6884
6893 LogicalPartition get_logical_partition(Context ctx, LogicalRegion parent,
6894 IndexPartition handle);
6895 // Context free
6896 LogicalPartition get_logical_partition(LogicalRegion parent,
6897 IndexPartition handle);
6898 // Template version
6899 template<int DIM, typename COORD_T>
6900 LogicalPartitionT<DIM,COORD_T> get_logical_partition(
6901 LogicalRegionT<DIM,COORD_T> parent,
6902 IndexPartitionT<DIM,COORD_T> handle);
6904
6906
6914 LogicalPartition get_logical_partition_by_color(Context ctx,
6915 LogicalRegion parent,
6916 Color c);
6917 LogicalPartition get_logical_partition_by_color(Context ctx,
6918 LogicalRegion parent,
6919 const DomainPoint &c);
6920 // Context free
6921 LogicalPartition get_logical_partition_by_color(LogicalRegion parent,
6922 Color c);
6923 LogicalPartition get_logical_partition_by_color(LogicalRegion parent,
6924 const DomainPoint &c);
6925 // Template version
6926 template<int DIM, typename COORD_T>
6927 LogicalPartitionT<DIM,COORD_T> get_logical_partition_by_color(
6928 LogicalRegionT<DIM,COORD_T> parent,
6929 Color c);
6931
6933
6941 bool has_logical_partition_by_color(Context ctx,
6942 LogicalRegion parent,
6943 const DomainPoint &c);
6944 // Context free
6945 bool has_logical_partition_by_color(LogicalRegion parent,
6946 const DomainPoint &c);
6948
6950
6959 LogicalPartition get_logical_partition_by_tree(Context ctx,
6960 IndexPartition handle,
6961 FieldSpace fspace,
6962 RegionTreeID tid);
6963 // Context free
6964 LogicalPartition get_logical_partition_by_tree(IndexPartition handle,
6965 FieldSpace fspace,
6966 RegionTreeID tid);
6967 // Template version
6968 template<int DIM, typename COORD_T>
6969 LogicalPartitionT<DIM,COORD_T> get_logical_partition_by_tree(
6970 IndexPartitionT<DIM,COORD_T> handle,
6971 FieldSpace fspace, RegionTreeID tid);
6973
6975
6984 LogicalRegion get_logical_subregion(Context ctx, LogicalPartition parent,
6985 IndexSpace handle);
6986 // Context free
6987 LogicalRegion get_logical_subregion(LogicalPartition parent,
6988 IndexSpace handle);
6989 // Template version
6990 template<int DIM, typename COORD_T>
6991 LogicalRegionT<DIM,COORD_T> get_logical_subregion(
6992 LogicalPartitionT<DIM,COORD_T> parent,
6993 IndexSpaceT<DIM,COORD_T> handle);
6995
6997
7005 LogicalRegion get_logical_subregion_by_color(Context ctx,
7006 LogicalPartition parent,
7007 Color c);
7008 LogicalRegion get_logical_subregion_by_color(Context ctx,
7009 LogicalPartition parent,
7010 const DomainPoint &c);
7011 // Context free
7012 LogicalRegion get_logical_subregion_by_color(LogicalPartition parent,
7013 Color c);
7014 LogicalRegion get_logical_subregion_by_color(LogicalPartition parent,
7015 const DomainPoint &c);
7016 // Template version
7017 template<int DIM, typename COORD_T,
7018 int COLOR_DIM, typename COLOR_COORD_T>
7019 LogicalRegionT<DIM,COORD_T> get_logical_subregion_by_color(
7020 LogicalPartitionT<DIM,COORD_T> parent,
7021 Point<COLOR_DIM,COLOR_COORD_T> color);
7023
7025
7033 bool has_logical_subregion_by_color(Context ctx,
7034 LogicalPartition parent,
7035 const DomainPoint &c);
7036 // Context free
7037 bool has_logical_subregion_by_color(LogicalPartition parent,
7038 const DomainPoint &c);
7039 // Template version
7040 template<int DIM, typename COORD_T,
7041 int COLOR_DIM, typename COLOR_COORD_T>
7042 bool has_logical_subregion_by_color(LogicalPartitionT<DIM,COORD_T> parent,
7043 Point<COLOR_DIM,COLOR_COORD_T> color);
7045
7047
7056 LogicalRegion get_logical_subregion_by_tree(Context ctx,
7057 IndexSpace handle,
7058 FieldSpace fspace,
7059 RegionTreeID tid);
7060 // Context free
7061 LogicalRegion get_logical_subregion_by_tree(IndexSpace handle,
7062 FieldSpace fspace,
7063 RegionTreeID tid);
7064 // Template version
7065 template<int DIM, typename COORD_T>
7066 LogicalRegionT<DIM,COORD_T> get_logical_subregion_by_tree(
7067 IndexSpaceT<DIM,COORD_T> handle,
7068 FieldSpace space, RegionTreeID tid);
7070
7072
7080 Color get_logical_region_color(Context ctx, LogicalRegion handle);
7081 DomainPoint get_logical_region_color_point(Context ctx,
7082 LogicalRegion handle);
7083 // Context free versions
7084 Color get_logical_region_color(LogicalRegion handle);
7085 DomainPoint get_logical_region_color_point(LogicalRegion handle);
7086 // Template version
7087 template<int DIM, typename COORD_T,
7088 int COLOR_DIM, typename COLOR_COORD_T>
7089 Point<COLOR_DIM,COLOR_COORD_T>
7090 get_logical_region_color_point(LogicalRegionT<DIM,COORD_T> handle);
7092
7094
7101 Color get_logical_partition_color(Context ctx, LogicalPartition handle);
7102 DomainPoint get_logical_partition_color_point(Context ctx,
7103 LogicalPartition handle);
7104 // Context free versions
7105 Color get_logical_partition_color(LogicalPartition handle);
7106 DomainPoint get_logical_partition_color_point(LogicalPartition handle);
7108
7110
7116 LogicalRegion get_parent_logical_region(Context ctx,
7117 LogicalPartition handle);
7118 // Context free
7119 LogicalRegion get_parent_logical_region(LogicalPartition handle);
7120 // Template version
7121 template<int DIM, typename COORD_T>
7122 LogicalRegionT<DIM,COORD_T> get_parent_logical_region(
7123 LogicalPartitionT<DIM,COORD_T> handle);
7125
7127
7133 bool has_parent_logical_partition(Context ctx, LogicalRegion handle);
7134 // Context free
7135 bool has_parent_logical_partition(LogicalRegion handle);
7137
7139
7145 LogicalPartition get_parent_logical_partition(Context ctx,
7146 LogicalRegion handle);
7147 // Context free
7148 LogicalPartition get_parent_logical_partition(LogicalRegion handle);
7149 // Template version
7150 template<int DIM, typename COORD_T>
7151 LogicalPartitionT<DIM,COORD_T> get_parent_logical_partition(
7152 LogicalRegionT<DIM,COORD_T> handle);
7154 public:
7155 //------------------------------------------------------------------------
7156 // Allocator and Argument Map Operations
7157 //------------------------------------------------------------------------
7164 FieldAllocator create_field_allocator(Context ctx, FieldSpace handle);
7165
7174 LEGION_DEPRECATED("ArgumentMap can be constructed directly.")
7175 ArgumentMap create_argument_map(Context ctx);
7176 public:
7177 //------------------------------------------------------------------------
7178 // Task Launch Operations
7179 //------------------------------------------------------------------------
7189 Future execute_task(Context ctx,
7190 const TaskLauncher &launcher,
7191 std::vector<OutputRequirement> *outputs = NULL);
7192
7203 FutureMap execute_index_space(
7204 Context ctx, const IndexTaskLauncher &launcher,
7205 std::vector<OutputRequirement> *outputs = NULL);
7206
7229 Future execute_index_space(
7230 Context ctx, const IndexTaskLauncher &launcher,
7231 ReductionOpID redop, bool ordered = true,
7232 std::vector<OutputRequirement> *outputs = NULL);
7233
7257 Future reduce_future_map(Context ctx, const FutureMap &future_map,
7258 ReductionOpID redop, bool ordered = true,
7259 MapperID map_id = 0, MappingTagID tag = 0,
7260 const char *provenance = NULL,
7261 Future initial_value = Future());
7262
7290 FutureMap construct_future_map(Context ctx, IndexSpace domain,
7291 const std::map<DomainPoint,UntypedBuffer> &data,
7292 bool collective = false, ShardingID sid = 0,
7293 bool implicit_sharding = false,
7294 const char *provenance = NULL);
7295 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
7296 FutureMap construct_future_map(Context ctx, const Domain &domain,
7297 const std::map<DomainPoint,UntypedBuffer> &data,
7298 bool collective = false, ShardingID sid = 0,
7299 bool implicit_sharding = false);
7300
7324 FutureMap construct_future_map(Context ctx, IndexSpace domain,
7325 const std::map<DomainPoint,Future> &futures,
7326 bool collective = false, ShardingID sid = 0,
7327 bool implicit_sharding = false,
7328 const char *provenance = NULL);
7329 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
7330 FutureMap construct_future_map(Context ctx, const Domain &domain,
7331 const std::map<DomainPoint,Future> &futures,
7332 bool collective = false, ShardingID sid = 0,
7333 bool implicit_sharding = false);
7334
7352 typedef DomainPoint (*PointTransformFnptr)(const DomainPoint &point,
7353 const Domain &domain,
7354 const Domain &range);
7355 FutureMap transform_future_map(Context ctx, const FutureMap &fm,
7356 IndexSpace new_domain,
7357 PointTransformFnptr fnptr,
7358 const char *provenance = NULL);
7376 FutureMap transform_future_map(Context ctx, const FutureMap &fm,
7377 IndexSpace new_domain,
7378 PointTransformFunctor *functor,
7379 bool take_ownership = false,
7380 const char *provenance = NULL);
7381
7397 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7398 "launcher interface.")
7399 Future execute_task(Context ctx, TaskID task_id,
7400 const std::vector<IndexSpaceRequirement> &indexes,
7401 const std::vector<FieldSpaceRequirement> &fields,
7402 const std::vector<RegionRequirement> &regions,
7403 const UntypedBuffer &arg,
7404 const Predicate &predicate = Predicate::TRUE_PRED,
7405 MapperID id = 0,
7406 MappingTagID tag = 0);
7407
7426 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7427 "launcher interface.")
7428 FutureMap execute_index_space(Context ctx, TaskID task_id,
7429 const Domain domain,
7430 const std::vector<IndexSpaceRequirement> &indexes,
7431 const std::vector<FieldSpaceRequirement> &fields,
7432 const std::vector<RegionRequirement> &regions,
7433 const UntypedBuffer &global_arg,
7434 const ArgumentMap &arg_map,
7435 const Predicate &predicate = Predicate::TRUE_PRED,
7436 bool must_paralleism = false,
7437 MapperID id = 0,
7438 MappingTagID tag = 0);
7439
7461 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7462 "launcher interface.")
7463 Future execute_index_space(Context ctx, TaskID task_id,
7464 const Domain domain,
7465 const std::vector<IndexSpaceRequirement> &indexes,
7466 const std::vector<FieldSpaceRequirement> &fields,
7467 const std::vector<RegionRequirement> &regions,
7468 const UntypedBuffer &global_arg,
7469 const ArgumentMap &arg_map,
7470 ReductionOpID reduction,
7471 const UntypedBuffer &initial_value,
7472 const Predicate &predicate = Predicate::TRUE_PRED,
7473 bool must_parallelism = false,
7474 MapperID id = 0,
7475 MappingTagID tag = 0);
7476 public:
7477 //------------------------------------------------------------------------
7478 // Inline Mapping Operations
7479 //------------------------------------------------------------------------
7489 PhysicalRegion map_region(Context ctx, const InlineLauncher &launcher);
7490
7504 PhysicalRegion map_region(Context ctx, const RegionRequirement &req,
7505 MapperID id = 0, MappingTagID tag = 0,
7506 const char *provenance = NULL);
7507
7519 PhysicalRegion map_region(Context ctx, unsigned idx,
7520 MapperID id = 0, MappingTagID tag = 0,
7521 const char *provenance = NULL);
7522
7532 void remap_region(Context ctx, PhysicalRegion region,
7533 const char *provenance = NULL);
7534
7542 void unmap_region(Context ctx, PhysicalRegion region);
7543
7551 void unmap_all_regions(Context ctx);
7552 public:
7553 //------------------------------------------------------------------------
7554 // Output Region Operations
7555 //------------------------------------------------------------------------
7561 OutputRegion get_output_region(Context ctx, unsigned index);
7562
7568 void get_output_regions(Context ctx, std::vector<OutputRegion> &regions);
7569 public:
7570 //------------------------------------------------------------------------
7571 // Fill Field Operations
7572 //------------------------------------------------------------------------
7587 template<typename T>
7588 void fill_field(Context ctx, LogicalRegion handle, LogicalRegion parent,
7589 FieldID fid, const T &value,
7590 Predicate pred = Predicate::TRUE_PRED);
7591
7605 void fill_field(Context ctx, LogicalRegion handle, LogicalRegion parent,
7606 FieldID fid, const void *value, size_t value_size,
7607 Predicate pred = Predicate::TRUE_PRED);
7608
7621 void fill_field(Context ctx, LogicalRegion handle, LogicalRegion parent,
7622 FieldID fid, Future f,
7623 Predicate pred = Predicate::TRUE_PRED);
7624
7635 template<typename T>
7636 void fill_fields(Context ctx, LogicalRegion handle, LogicalRegion parent,
7637 const std::set<FieldID> &fields, const T &value,
7638 Predicate pred = Predicate::TRUE_PRED);
7639
7652 void fill_fields(Context ctx, LogicalRegion handle, LogicalRegion parent,
7653 const std::set<FieldID> &fields,
7654 const void *value, size_t value_size,
7655 Predicate pred = Predicate::TRUE_PRED);
7656
7667 void fill_fields(Context ctx, LogicalRegion handle, LogicalRegion parent,
7668 const std::set<FieldID> &fields,
7669 Future f, Predicate pred = Predicate::TRUE_PRED);
7670
7677 void fill_fields(Context ctx, const FillLauncher &launcher);
7678
7685 void fill_fields(Context ctx, const IndexFillLauncher &launcher);
7686
7692 void discard_fields(Context ctx, const DiscardLauncher &launcher);
7693 public:
7694 //------------------------------------------------------------------------
7695 // Attach Operations
7696 //------------------------------------------------------------------------
7697
7704 PhysicalRegion attach_external_resource(Context ctx,
7705 const AttachLauncher &launcher);
7706
7718 Future detach_external_resource(Context ctx, PhysicalRegion region,
7719 const bool flush = true,
7720 const bool unordered = false,
7721 const char *provenance = NULL);
7722
7740 ExternalResources attach_external_resources(Context ctx,
7741 const IndexAttachLauncher &launcher);
7742
7755 Future detach_external_resources(Context ctx, ExternalResources external,
7756 const bool flush = true,
7757 const bool unordered = false,
7758 const char *provenance = NULL);
7759
7766 void progress_unordered_operations(Context ctx);
7767
7798 LEGION_DEPRECATED("Attaching specific HDF5 file type is deprecated "
7799 "in favor of generic attach launcher interface.")
7800 PhysicalRegion attach_hdf5(Context ctx, const char *file_name,
7801 LogicalRegion handle, LogicalRegion parent,
7802 const std::map<FieldID,const char*> &field_map,
7803 LegionFileMode mode);
7804
7821 LEGION_DEPRECATED("Detaching specific HDF5 file type is deprecated "
7822 "in favor of generic detach interface.")
7823 void detach_hdf5(Context ctx, PhysicalRegion region);
7824
7831 LEGION_DEPRECATED("Attaching generic file type is deprecated "
7832 "in favor of generic attach launcher interface.")
7833 PhysicalRegion attach_file(Context ctx, const char *file_name,
7834 LogicalRegion handle, LogicalRegion parent,
7835 const std::vector<FieldID> &field_vec,
7836 LegionFileMode mode);
7837
7843 LEGION_DEPRECATED("Detaching generic file type is deprecated "
7844 "in favor of generic detach interface.")
7845 void detach_file(Context ctx, PhysicalRegion region);
7846 public:
7847 //------------------------------------------------------------------------
7848 // Copy Operations
7849 //------------------------------------------------------------------------
7857 void issue_copy_operation(Context ctx, const CopyLauncher &launcher);
7858
7866 void issue_copy_operation(Context ctx, const IndexCopyLauncher &launcher);
7867 public:
7868 //------------------------------------------------------------------------
7869 // Predicate Operations
7870 //------------------------------------------------------------------------
7880 Predicate create_predicate(Context ctx, const Future &f,
7881 const char *provenance = NULL);
7882
7892 Predicate predicate_not(Context ctx, const Predicate &p,
7893 const char *provenance = NULL);
7894
7905 Predicate predicate_and(Context ctx,
7906 const Predicate &p1, const Predicate &p2,
7907 const char *provenance = NULL);
7908
7919 Predicate predicate_or(Context ctx,
7920 const Predicate &p1, const Predicate &p2,
7921 const char *provenance = NULL);
7922
7929 Predicate create_predicate(Context ctx,const PredicateLauncher &launcher);
7930
7939 Future get_predicate_future(Context ctx, const Predicate &p,
7940 const char *provenance = NULL);
7941 public:
7942 //------------------------------------------------------------------------
7943 // Lock Operations
7944 //------------------------------------------------------------------------
7950 Lock create_lock(Context ctx);
7951
7962 void destroy_lock(Context ctx, Lock l);
7963
7976 Grant acquire_grant(Context ctx,
7977 const std::vector<LockRequest> &requests);
7978
7988 void release_grant(Context ctx, Grant grant);
7989 public:
7990 //------------------------------------------------------------------------
7991 // Phase Barrier operations
7992 //------------------------------------------------------------------------
8002 PhaseBarrier create_phase_barrier(Context ctx, unsigned arrivals);
8003
8014 void destroy_phase_barrier(Context ctx, PhaseBarrier pb);
8015
8031 PhaseBarrier advance_phase_barrier(Context ctx, PhaseBarrier pb);
8032 public:
8033 //------------------------------------------------------------------------
8034 // Dynamic Collective operations
8035 //------------------------------------------------------------------------
8050 DynamicCollective create_dynamic_collective(Context ctx,
8051 unsigned arrivals,
8052 ReductionOpID redop,
8053 const void *init_value,
8054 size_t init_size);
8055
8062 void destroy_dynamic_collective(Context ctx, DynamicCollective dc);
8063
8073 void arrive_dynamic_collective(Context ctx,
8075 const void *buffer,
8076 size_t size, unsigned count = 1);
8077
8087 void defer_dynamic_collective_arrival(Context ctx,
8089 const Future &f,
8090 unsigned count = 1);
8091
8102 Future get_dynamic_collective_result(Context ctx, DynamicCollective dc,
8103 const char *provenance = NULL);
8104
8113 DynamicCollective advance_dynamic_collective(Context ctx,
8115 public:
8116 //------------------------------------------------------------------------
8117 // User-Managed Software Coherence
8118 //------------------------------------------------------------------------
8125 void issue_acquire(Context ctx, const AcquireLauncher &launcher);
8126
8133 void issue_release(Context ctx, const ReleaseLauncher &launcher);
8134 public:
8135 //------------------------------------------------------------------------
8136 // Fence Operations
8137 //------------------------------------------------------------------------
8146 Future issue_mapping_fence(Context ctx, const char *provenance = NULL);
8147
8157 Future issue_execution_fence(Context ctx, const char *provenance = NULL);
8158 public:
8159 //------------------------------------------------------------------------
8160 // Tracing Operations
8161 //------------------------------------------------------------------------
8191 void begin_trace(Context ctx, TraceID tid, bool logical_only = false,
8192 bool static_trace = false, const std::set<RegionTreeID> *managed = NULL,
8193 const char *provenance = NULL);
8197 void end_trace(Context ctx, TraceID tid, const char *provenance = NULL);
8212 LEGION_DEPRECATED("Use begin_trace with static_trace=true")
8213 void begin_static_trace(Context ctx,
8214 const std::set<RegionTreeID> *managed = NULL);
8219 LEGION_DEPRECATED("Use end_trace")
8220 void end_static_trace(Context ctx);
8221
8226 TraceID generate_dynamic_trace_id(void);
8227
8238 TraceID generate_library_trace_ids(const char *name, size_t count);
8239
8247 static TraceID generate_static_trace_id(void);
8248 public:
8249 //------------------------------------------------------------------------
8250 // Frame Operations
8251 //------------------------------------------------------------------------
8265 void complete_frame(Context ctx, const char *provenance = NULL);
8266 public:
8267 //------------------------------------------------------------------------
8268 // Must Parallelism
8269 //------------------------------------------------------------------------
8277 FutureMap execute_must_epoch(Context ctx,
8278 const MustEpochLauncher &launcher);
8279 public:
8280 //------------------------------------------------------------------------
8281 // Tunable Variables
8282 //------------------------------------------------------------------------
8283
8297 Future select_tunable_value(Context ctx, TunableID tid,
8298 MapperID mapper = 0, MappingTagID tag = 0,
8299 const void *args = NULL, size_t argsize = 0);
8300 Future select_tunable_value(Context ctx, const TunableLauncher &launcher);
8301
8308 LEGION_DEPRECATED("Tunable values should now be obtained via the "
8309 "generic interface that returns a future result.")
8310 int get_tunable_value(Context ctx, TunableID tid,
8311 MapperID mapper = 0, MappingTagID tag = 0);
8312 public:
8313 //------------------------------------------------------------------------
8314 // Task Local Interface
8315 //------------------------------------------------------------------------
8321 const Task* get_local_task(Context ctx);
8322
8330 void* get_local_task_variable_untyped(Context ctx, LocalVariableID id);
8331 template<typename T>
8332 T* get_local_task_variable(Context ctx, LocalVariableID id);
8333
8344 void set_local_task_variable_untyped(Context ctx, LocalVariableID id,
8345 const void *value, void (*destructor)(void*) = NULL);
8346 template<typename T>
8347 void set_local_task_variable(Context ctx, LocalVariableID id,
8348 const T* value, void (*destructor)(void*) = NULL);
8349 public:
8350 //------------------------------------------------------------------------
8351 // Timing Operations
8352 //------------------------------------------------------------------------
8361 Future get_current_time(Context ctx, Future precondition = Future());
8362
8371 Future get_current_time_in_microseconds(Context ctx,
8372 Future precondition = Future());
8373
8382 Future get_current_time_in_nanoseconds(Context ctx,
8383 Future precondition = Future());
8384
8391 Future issue_timing_measurement(Context ctx,
8392 const TimingLauncher &launcher);
8393
8400 static long long get_zero_time(void);
8401 public:
8402 //------------------------------------------------------------------------
8403 // Miscellaneous Operations
8404 //------------------------------------------------------------------------
8419 Mapping::Mapper* get_mapper(Context ctx, MapperID id,
8420 Processor target = Processor::NO_PROC);
8421
8435 Mapping::MapperContext begin_mapper_call(Context ctx, MapperID id,
8436 Processor target = Processor::NO_PROC);
8437
8443 void end_mapper_call(Mapping::MapperContext ctx);
8444
8451 Processor get_executing_processor(Context ctx);
8452
8459 const Task* get_current_task(Context ctx);
8460
8472 size_t query_available_memory(Context ctx, Memory target);
8473
8490 void raise_region_exception(Context ctx, PhysicalRegion region,
8491 bool nuclear);
8492
8503 void yield(Context ctx);
8504
8542 void concurrent_task_barrier(Context ctx);
8543
8555 void start_profiling_range(Context ctx);
8556 void stop_profiling_range(Context ctx, const char *provenance);
8557 public:
8558 //------------------------------------------------------------------------
8559 // MPI Interoperability
8560 //------------------------------------------------------------------------
8564 bool is_MPI_interop_configured(void);
8565
8573 const std::map<int/*rank*/,AddressSpace>& find_forward_MPI_mapping(void);
8574
8582 const std::map<AddressSpace,int/*rank*/>& find_reverse_MPI_mapping(void);
8583
8587 int find_local_MPI_rank(void);
8588 public:
8589 //------------------------------------------------------------------------
8590 // Semantic Information
8591 //------------------------------------------------------------------------
8601 void attach_semantic_information(TaskID task_id, SemanticTag tag,
8602 const void *buffer, size_t size,
8603 bool is_mutable = false, bool local_only = false);
8604
8613 void attach_semantic_information(IndexSpace handle, SemanticTag tag,
8614 const void *buffer, size_t size, bool is_mutable = false);
8615
8624 void attach_semantic_information(IndexPartition handle, SemanticTag tag,
8625 const void *buffer, size_t size, bool is_mutable = false);
8626
8635 void attach_semantic_information(FieldSpace handle, SemanticTag tag,
8636 const void *buffer, size_t size, bool is_mutable = false);
8637
8647 void attach_semantic_information(FieldSpace handle, FieldID fid,
8648 SemanticTag tag, const void *buffer,
8649 size_t size, bool is_mutable = false);
8650
8659 void attach_semantic_information(LogicalRegion handle, SemanticTag tag,
8660 const void *buffer, size_t size, bool is_mutable = false);
8661
8670 void attach_semantic_information(LogicalPartition handle,
8671 SemanticTag tag, const void *buffer,
8672 size_t size, bool is_mutable = false);
8673
8681 void attach_name(TaskID task_id, const char *name,
8682 bool is_mutable = false,
8683 bool local_only = false);
8684
8691 void attach_name(IndexSpace handle, const char *name,
8692 bool is_mutable = false);
8693
8700 void attach_name(IndexPartition handle, const char *name,
8701 bool is_mutable = false);
8702
8709 void attach_name(FieldSpace handle, const char *name,
8710 bool is_mutable = false);
8711
8719 void attach_name(FieldSpace handle, FieldID fid,
8720 const char *name, bool is_mutable = false);
8721
8728 void attach_name(LogicalRegion handle, const char *name,
8729 bool is_mutable = false);
8730
8737 void attach_name(LogicalPartition handle, const char *name,
8738 bool is_mutable = false);
8739
8750 bool retrieve_semantic_information(TaskID task_id, SemanticTag tag,
8751 const void *&result, size_t &size,
8752 bool can_fail = false,
8753 bool wait_until_ready = false);
8754
8765 bool retrieve_semantic_information(IndexSpace handle, SemanticTag tag,
8766 const void *&result, size_t &size,
8767 bool can_fail = false,
8768 bool wait_until_ready = false);
8769
8780 bool retrieve_semantic_information(IndexPartition handle, SemanticTag tag,
8781 const void *&result, size_t &size,
8782 bool can_fail = false,
8783 bool wait_until_ready = false);
8784
8795 bool retrieve_semantic_information(FieldSpace handle, SemanticTag tag,
8796 const void *&result, size_t &size,
8797 bool can_fail = false,
8798 bool wait_until_ready = false);
8799
8811 bool retrieve_semantic_information(FieldSpace handle, FieldID fid,
8812 SemanticTag tag,
8813 const void *&result, size_t &size,
8814 bool can_fail = false,
8815 bool wait_until_ready = false);
8816
8827 bool retrieve_semantic_information(LogicalRegion handle, SemanticTag tag,
8828 const void *&result, size_t &size,
8829 bool can_fail = false,
8830 bool wait_until_ready = false);
8831
8842 bool retrieve_semantic_information(LogicalPartition handle,
8843 SemanticTag tag,
8844 const void *&result, size_t &size,
8845 bool can_fail = false,
8846 bool wait_until_ready = false);
8847
8853 void retrieve_name(TaskID task_id, const char *&result);
8854
8860 void retrieve_name(IndexSpace handle, const char *&result);
8861
8867 void retrieve_name(IndexPartition handle, const char *&result);
8868
8874 void retrieve_name(FieldSpace handle, const char *&result);
8875
8882 void retrieve_name(FieldSpace handle, FieldID fid, const char *&result);
8883
8889 void retrieve_name(LogicalRegion handle, const char *&result);
8890
8896 void retrieve_name(LogicalPartition handle, const char *&result);
8897
8898 public:
8899 //------------------------------------------------------------------------
8900 // Printing operations, these are useful for only generating output
8901 // from a single task if the task has been replicated (either directly
8902 // or as part of control replication).
8903 //------------------------------------------------------------------------
8911 void print_once(Context ctx, FILE *f, const char *message);
8912
8919 void log_once(Context ctx, Realm::LoggerMessage &message);
8920 public:
8921 //------------------------------------------------------------------------
8922 // Registration Callback Operations
8923 // All of these calls must be made while in the registration
8924 // function called before start-up. This function is specified
8925 // by calling the 'set_registration_callback' static method.
8926 //------------------------------------------------------------------------
8927
8932 Mapping::MapperRuntime* get_mapper_runtime(void);
8933
8938 MapperID generate_dynamic_mapper_id(void);
8939
8950 MapperID generate_library_mapper_ids(const char *name, size_t count);
8951
8959 static MapperID generate_static_mapper_id(void);
8960
8972 void add_mapper(MapperID map_id, Mapping::Mapper *mapper,
8973 Processor proc = Processor::NO_PROC);
8974
8986 void replace_default_mapper(Mapping::Mapper *mapper,
8987 Processor proc = Processor::NO_PROC);
8988
8989 public:
8994 ProjectionID generate_dynamic_projection_id(void);
8995
9006 ProjectionID generate_library_projection_ids(const char *name,
9007 size_t count);
9008
9016 static ProjectionID generate_static_projection_id(void);
9017
9031 void register_projection_functor(ProjectionID pid,
9032 ProjectionFunctor *functor,
9033 bool silence_warnings = false,
9034 const char *warning_string = NULL);
9035
9045 static void preregister_projection_functor(ProjectionID pid,
9046 ProjectionFunctor *functor);
9047
9054 static ProjectionFunctor* get_projection_functor(ProjectionID pid);
9055
9060 ShardingID generate_dynamic_sharding_id(void);
9061
9072 ShardingID generate_library_sharding_ids(const char *name, size_t count);
9073
9081 static ShardingID generate_static_sharding_id(void);
9082
9095 void register_sharding_functor(ShardingID sid,
9096 ShardingFunctor *functor,
9097 bool silence_warnings = false,
9098 const char *warning_string = NULL);
9099
9110 static void preregister_sharding_functor(ShardingID sid,
9111 ShardingFunctor *functor);
9112
9119 static ShardingFunctor* get_sharding_functor(ShardingID sid);
9120 public:
9125 ReductionOpID generate_dynamic_reduction_id(void);
9126
9137 ReductionOpID generate_library_reduction_ids(const char *name,
9138 size_t count);
9139
9147 static ReductionOpID generate_static_reduction_id(void);
9148
9163 template<typename REDOP>
9164 static void register_reduction_op(ReductionOpID redop_id,
9165 bool permit_duplicates = false);
9166
9187 static void register_reduction_op(ReductionOpID redop_id,
9188 ReductionOp *op,
9189 SerdezInitFnptr init_fnptr = NULL,
9190 SerdezFoldFnptr fold_fnptr = NULL,
9191 bool permit_duplicates = false);
9192
9198 static const ReductionOp* get_reduction_op(ReductionOpID redop_id);
9199
9200#ifdef LEGION_GPU_REDUCTIONS
9201 template<typename REDOP>
9202 LEGION_DEPRECATED("Use register_reduction_op instead")
9203 static void preregister_gpu_reduction_op(ReductionOpID redop_id);
9204#endif
9205 public:
9210 CustomSerdezID generate_dynamic_serdez_id(void);
9211
9222 CustomSerdezID generate_library_serdez_ids(const char *name,
9223 size_t count);
9224
9232 static CustomSerdezID generate_static_serdez_id(void);
9233
9247 template<typename SERDEZ>
9248 static void register_custom_serdez_op(CustomSerdezID serdez_id,
9249 bool permit_duplicates = false);
9250
9263 static void register_custom_serdez_op(CustomSerdezID serdez_id,
9264 SerdezOp *serdez_op,
9265 bool permit_duplicates = false);
9266
9272 static const SerdezOp* get_serdez_op(CustomSerdezID serdez_id);
9273 public:
9274 //------------------------------------------------------------------------
9275 // Start-up Operations
9276 // Everything below here is a static function that is used to configure
9277 // the runtime prior to calling the start method to begin execution.
9278 //------------------------------------------------------------------------
9279 public:
9285 static const char* get_legion_version(void);
9286
9475 static int start(int argc, char **argv, bool background = false,
9476 bool supply_default_mapper = true, bool filter = false);
9477
9493 static void initialize(int *argc, char ***argv,
9494 bool filter = false, bool parse = true);
9495
9501 static int wait_for_shutdown(void);
9502
9510 static void set_return_code(int return_code);
9511
9519 static void set_top_level_task_id(TaskID top_id);
9520
9527 static void set_top_level_task_mapper_id(MapperID mapper_id);
9528
9536
9555 Context begin_implicit_task(TaskID top_task_id,
9556 MapperID mapper_id,
9557 Processor::Kind proc_kind,
9558 const char *task_name = NULL,
9559 bool control_replicable = false,
9560 unsigned shard_per_address_space = 1,
9561 int shard_id = -1,
9562 DomainPoint shard_point = DomainPoint());
9563
9572
9580
9591 void finish_implicit_task(Context ctx,
9592 Realm::Event effects = Realm::Event::NO_EVENT);
9593
9599 static size_t get_maximum_dimension(void);
9600
9610 static void configure_MPI_interoperability(int rank);
9611
9625 static LegionHandshake create_external_handshake(bool init_in_ext = true,
9626 int ext_participants = 1,
9627 int legion_participants = 1);
9628
9640 static MPILegionHandshake create_handshake(bool init_in_MPI = true,
9641 int mpi_participants = 1,
9642 int legion_participants = 1);
9643
9654 template<LogicalRegion (*PROJ_PTR)(LogicalRegion, const DomainPoint&,
9655 Runtime*)>
9656 LEGION_DEPRECATED("Projection functions should now be specified "
9657 "using projection functor objects")
9658 static ProjectionID register_region_function(ProjectionID handle);
9659
9669 template<LogicalRegion (*PROJ_PTR)(LogicalPartition, const DomainPoint&,
9670 Runtime*)>
9671 LEGION_DEPRECATED("Projection functions should now be specified "
9672 "using projection functor objects")
9673 static ProjectionID register_partition_function(ProjectionID handle);
9674 public:
9691 static void add_registration_callback(RegistrationCallbackFnptr callback,
9692 bool dedup = true, size_t dedup_tag = 0);
9693 static void add_registration_callback(
9694 RegistrationWithArgsCallbackFnptr callback, const UntypedBuffer &buffer,
9695 bool dedup = true, size_t dedup_tag = 0);
9696
9722 RegistrationCallbackFnptr callback, bool global,
9723 bool deduplicate = true, size_t dedup_tag = 0);
9724 static void perform_registration_callback(
9725 RegistrationWithArgsCallbackFnptr callback,
9726 const UntypedBuffer &buffer, bool global,
9727 bool deduplicate = true , size_t dedup_tag = 0);
9728
9740 LEGION_DEPRECATED("Legion now supports multiple registration callbacks "
9741 "added via the add_registration_callback method.")
9742 static void set_registration_callback(RegistrationCallbackFnptr callback);
9743
9749 static const InputArgs& get_input_args(void);
9750 public:
9754 static void enable_profiling(void);
9758 static void disable_profiling(void);
9762 static void dump_profiling(void);
9763 public:
9764 //------------------------------------------------------------------------
9765 // Layout Registration Operations
9766 //------------------------------------------------------------------------
9775 LayoutConstraintID register_layout(
9776 const LayoutConstraintRegistrar &registrar);
9777
9783 void release_layout(LayoutConstraintID layout_id);
9784
9796 static LayoutConstraintID preregister_layout(
9797 const LayoutConstraintRegistrar &registrar,
9798 LayoutConstraintID layout_id =
9799 LEGION_AUTO_GENERATE_ID);
9800
9806 FieldSpace get_layout_constraint_field_space(
9807 LayoutConstraintID layout_id);
9808
9814 void get_layout_constraints(LayoutConstraintID layout_id,
9815 LayoutConstraintSet &layout_constraints);
9816
9822 const char* get_layout_constraints_name(LayoutConstraintID layout_id);
9823 public:
9824 //------------------------------------------------------------------------
9825 // Task Registration Operations
9826 //------------------------------------------------------------------------
9827
9832 TaskID generate_dynamic_task_id(void);
9833
9844 TaskID generate_library_task_ids(const char *name, size_t count);
9845
9853 static TaskID generate_static_task_id(void);
9854
9862 template<typename T,
9863 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9864 Context, Runtime*)>
9865 VariantID register_task_variant(const TaskVariantRegistrar &registrar,
9866 VariantID vid = LEGION_AUTO_GENERATE_ID);
9867
9876 template<typename T, typename UDT,
9877 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9878 Context, Runtime*, const UDT&)>
9879 VariantID register_task_variant(const TaskVariantRegistrar &registrar,
9880 const UDT &user_data,
9881 VariantID vid = LEGION_AUTO_GENERATE_ID);
9882
9890 template<
9891 void (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9892 Context, Runtime*)>
9893 VariantID register_task_variant(const TaskVariantRegistrar &registrar,
9894 VariantID vid = LEGION_AUTO_GENERATE_ID);
9895
9904 template<typename UDT,
9905 void (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9906 Context, Runtime*, const UDT&)>
9907 VariantID register_task_variant(const TaskVariantRegistrar &registrar,
9908 const UDT &user_data,
9909 VariantID vid = LEGION_AUTO_GENERATE_ID);
9910
9930 VariantID register_task_variant(const TaskVariantRegistrar &registrar,
9931 const CodeDescriptor &codedesc,
9932 const void *user_data = NULL,
9933 size_t user_len = 0,
9934 size_t return_type_size =
9935 LEGION_MAX_RETURN_SIZE,
9936 VariantID vid = LEGION_AUTO_GENERATE_ID,
9937 bool has_return_type_size = true);
9938
9949 template<typename T,
9950 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9951 Context, Runtime*)>
9952 static VariantID preregister_task_variant(
9953 const TaskVariantRegistrar &registrar,
9954 const char *task_name = NULL,
9955 VariantID vid = LEGION_AUTO_GENERATE_ID);
9956
9968 template<typename T, typename UDT,
9969 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9970 Context, Runtime*, const UDT&)>
9971 static VariantID preregister_task_variant(
9972 const TaskVariantRegistrar &registrar,
9973 const UDT &user_data,
9974 const char *task_name = NULL,
9975 VariantID vid = LEGION_AUTO_GENERATE_ID);
9976
9987 template<
9988 void (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
9989 Context, Runtime*)>
9990 static VariantID preregister_task_variant(
9991 const TaskVariantRegistrar &registrar,
9992 const char *task_name = NULL,
9993 VariantID vid = LEGION_AUTO_GENERATE_ID);
9994
10006 template<typename UDT,
10007 void (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
10008 Context, Runtime*, const UDT&)>
10009 static VariantID preregister_task_variant(
10010 const TaskVariantRegistrar &registrar, const UDT &user_data,
10011 const char *task_name = NULL,
10012 VariantID vid = LEGION_AUTO_GENERATE_ID);
10013
10035 static VariantID preregister_task_variant(
10036 const TaskVariantRegistrar &registrar,
10037 const CodeDescriptor &codedesc,
10038 const void *user_data = NULL,
10039 size_t user_len = 0,
10040 const char *task_name = NULL,
10041 VariantID vid = LEGION_AUTO_GENERATE_ID,
10042 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
10043 bool has_return_type_size = true,
10044 bool check_task_id = true);
10045
10059 static void legion_task_preamble(const void *data, size_t datalen,
10060 Processor p, const Task *& task,
10061 const std::vector<PhysicalRegion> *& reg,
10062 Context& ctx, Runtime *& runtime);
10063
10081 static void legion_task_postamble(Context ctx,
10082 const void *retvalptr = NULL,
10083 size_t retvalsize = 0,
10084 bool owned = false,
10085 Realm::RegionInstance inst =
10086 Realm::RegionInstance::NO_INST,
10087 const void *metadataptr = NULL,
10088 size_t metadatasize = 0);
10089
10108 static void legion_task_postamble(Context ctx,
10109 const void *retvalptr, size_t retvalsize, bool owned,
10110 const Realm::ExternalInstanceResource &allocation,
10111 void (*freefunc)(const Realm::ExternalInstanceResource&) = NULL,
10112 const void *metadataptr = NULL, size_t metadatasize = 0);
10113
10123 static void legion_task_postamble(Context ctx,
10124 FutureFunctor *callback_functor,
10125 bool owned = false);
10126 public:
10127 // ------------------ Deprecated task registration -----------------------
10141 template<typename T,
10142 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
10143 Context, Runtime*)>
10144 LEGION_DEPRECATED("Task registration should be done with "
10146 static TaskID register_legion_task(TaskID id, Processor::Kind proc_kind,
10147 bool single, bool index,
10148 VariantID vid =LEGION_AUTO_GENERATE_ID,
10150 const char *task_name = NULL);
10164 template<
10165 void (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
10166 Context, Runtime*)>
10167 LEGION_DEPRECATED("Task registration should be done with "
10169 static TaskID register_legion_task(TaskID id, Processor::Kind proc_kind,
10170 bool single, bool index,
10171 VariantID vid =LEGION_AUTO_GENERATE_ID,
10173 const char *task_name = NULL);
10189 template<typename T, typename UDT,
10190 T (*TASK_PTR)(const Task*, const std::vector<PhysicalRegion>&,
10191 Context, Runtime*, const UDT&)>
10192 LEGION_DEPRECATED("Task registration should be done with "
10194 static TaskID register_legion_task(TaskID id, Processor::Kind proc_kind,
10195 bool single, bool index,
10196 const UDT &user_data,
10197 VariantID vid =LEGION_AUTO_GENERATE_ID,
10199 const char *task_name = NULL);
10215 template<typename UDT,
10216 void (*TASK_PTR)(const Task*,const std::vector<PhysicalRegion>&,
10217 Context, Runtime*, const UDT&)>
10218 LEGION_DEPRECATED("Task registration should be done with "
10220 static TaskID register_legion_task(TaskID id, Processor::Kind proc_kind,
10221 bool single, bool index,
10222 const UDT &user_data,
10223 VariantID vid =LEGION_AUTO_GENERATE_ID,
10225 const char *task_name = NULL);
10226 public:
10233 static bool has_runtime(void);
10234
10242 static Runtime* get_runtime(Processor p = Processor::NO_PROC);
10243
10250 static bool has_context(void);
10251
10258 static Context get_context(void);
10259
10265 static const Task* get_context_task(Context ctx);
10266 private:
10267 IndexPartition create_restricted_partition(Context ctx,
10268 IndexSpace parent,
10269 IndexSpace color_space,
10270 const void *transform,
10271 size_t transform_size,
10272 const void *extent,
10273 size_t extent_size,
10274 PartitionKind part_kind, Color color,
10275 const char *provenance);
10276 IndexSpace create_index_space_union_internal(Context ctx,
10277 IndexPartition parent,
10278 const void *realm_color,size_t color_size,
10279 TypeTag type_tag, const char *provenance,
10280 const std::vector<IndexSpace> &handles);
10281 IndexSpace create_index_space_union_internal(Context ctx,
10282 IndexPartition parent,
10283 const void *realm_color,size_t color_size,
10284 TypeTag type_tag, const char *provenance,
10285 IndexPartition handle);
10286 IndexSpace create_index_space_intersection_internal(Context ctx,
10287 IndexPartition parent,
10288 const void *realm_color,size_t color_size,
10289 TypeTag type_tag, const char *provenance,
10290 const std::vector<IndexSpace> &handles);
10291 IndexSpace create_index_space_intersection_internal(Context ctx,
10292 IndexPartition parent,
10293 const void *realm_color,size_t color_size,
10294 TypeTag type_tag, const char *provenance,
10295 IndexPartition handle);
10296 IndexSpace create_index_space_difference_internal(Context ctx,
10297 IndexPartition paretn,
10298 const void *realm_color, size_t color_size,
10299 TypeTag type_tag, const char *provenance,
10300 IndexSpace initial,
10301 const std::vector<IndexSpace> &handles);
10302 IndexSpace get_index_subspace_internal(IndexPartition handle,
10303 const void *realm_color,TypeTag type_tag);
10304 bool has_index_subspace_internal(IndexPartition handle,
10305 const void *realm_color,TypeTag type_tag);
10306 void get_index_partition_color_space_internal(IndexPartition handle,
10307 void *realm_is, TypeTag type_tag);
10308 void get_index_space_domain_internal(IndexSpace handle,
10309 void *realm_is, TypeTag type_tag);
10310 void get_index_space_color_internal(IndexSpace handle,
10311 void *realm_color, TypeTag type_tag);
10312 bool safe_cast_internal(Context ctx, LogicalRegion region,
10313 const void *realm_point,TypeTag type_tag);
10314 LogicalRegion get_logical_subregion_by_color_internal(
10315 LogicalPartition parent,
10316 const void *realm_color,TypeTag type_tag);
10317 bool has_logical_subregion_by_color_internal(
10318 LogicalPartition parent,
10319 const void *realm_color,TypeTag type_tag);
10320 private:
10321 // Methods for the wrapper functions to get information from the runtime
10322 friend class LegionTaskWrapper;
10323 friend class LegionSerialization;
10324 private:
10325 template<typename T>
10326 friend class DeferredValue;
10327 template<typename T, int DIM, typename COORD_T, bool CHECK_BOUNDS>
10328 friend class DeferredBuffer;
10329 friend class UntypedDeferredValue;
10330 template<typename>
10331 friend class UntypedDeferredBuffer;
10332 Realm::RegionInstance create_task_local_instance(Memory memory,
10333 Realm::InstanceLayoutGeneric *layout);
10334 void destroy_task_local_instance(Realm::RegionInstance instance,
10335 Realm::Event precondition);
10336 public:
10337 // This method is hidden down here and not publicly documented because
10338 // users shouldn't really need it for anything, however there are some
10339 // reasonable cases where it might be utilitized for things like doing
10340 // file I/O or printf that people might want it for so we've got it
10341 ShardID get_shard_id(Context ctx, bool I_know_what_I_am_doing = false);
10342 // We'll also allow users to get the total number of shards in the context
10343 // if they also ar willing to attest they know what they are doing
10344 size_t get_num_shards(Context ctx, bool I_know_what_I_am_doing = false);
10345 // This is another hidden method for control replication because it's
10346 // still somewhat experimental. In some cases there are unavoidable
10347 // sources of randomness that can mess with the needed invariants for
10348 // control replication (e.g. garbage collectors). This method will
10349 // allow the application to pass in an array of elements from each shard
10350 // and the runtime will fill in an output buffer with an ordered array of
10351 // elements that were passed in by every shard. Each shard will get the
10352 // same elements that were present in all the other shards in the same
10353 // order in the output array. The number of elements in the output buffer
10354 // is returned as a future (of type size_t) as the runtime will return
10355 // immediately and the application can continue running ahead. The
10356 // application must keep the input and output buffers allocated until
10357 // the future resolves. By definition the output buffer need be no bigger
10358 // than the input buffer since only elements that are in the input buffer
10359 // on any shard can appear in the output buffer. Note you can use this
10360 // method safely in contexts that are not control replicated as well:
10361 // the input will just be mem-copied to the output and num_elements
10362 // returned as the future result.
10363 Future consensus_match(Context ctx, const void *input, void *output,
10364 size_t num_elements, size_t element_size, const char *provenance = NULL);
10365 private:
10366 friend class Mapper;
10367 Internal::Runtime *runtime;
10368 };
10369
10370}; // namespace Legion
10371
10372#include "legion/legion.inl"
10373
10374// Include this here so we get the mapper interface in the header file
10375// We have to put it here though since the mapper interface depends
10376// on the rest of the legion interface
10377#include "legion/legion_mapping.h"
10378
10379#endif // __LEGION_RUNTIME_H__
10380#endif // defined LEGION_ENABLE_CXX_BINDINGS
10381
10382// EOF
Definition legion.h:4521
Definition legion.h:563
void set_point(const DomainPoint &point, const UntypedBuffer &arg, bool replace=true)
bool remove_point(const DomainPoint &point)
bool remove_point(const PT point[DIM])
bool has_point(const DomainPoint &point)
void set_point_arg(const PT point[DIM], const UntypedBuffer &arg, bool replace=false)
void set_point(const DomainPoint &point, const Future &f, bool replace=true)
UntypedBuffer get_point(const DomainPoint &point) const
Definition legion_types.h:209
Definition legion_types.h:210
Definition legion.h:4569
Definition legion.h:4470
Definition legion.h:3834
Definition legion.h:3761
Definition legion.h:3721
Definition legion_domain.h:253
Definition legion_domain.h:132
Definition legion_domain.h:610
Definition legion.h:843
Definition legion.h:2738
Definition legion.h:2806
Definition legion.h:378
FieldID allocate_field(size_t field_size, FieldID desired_fieldid=LEGION_AUTO_GENERATE_ID, CustomSerdezID serdez_id=0, bool local_field=false, const char *provenance=NULL)
void allocate_local_fields(const std::vector< size_t > &field_sizes, std::vector< FieldID > &resulting_fields, CustomSerdezID serdez_id=0, const char *provenance=NULL)
FieldID allocate_local_field(size_t field_size, FieldID desired_fieldid=LEGION_AUTO_GENERATE_ID, CustomSerdezID serdez_id=0, const char *provenance=NULL)
void allocate_fields(const std::vector< size_t > &field_sizes, std::vector< FieldID > &resulting_fields, CustomSerdezID serdez_id=0, bool local_fields=false, const char *provenance=NULL)
FieldSpace get_field_space(void) const
void free_fields(const std::set< FieldID > &to_free, const bool unordered=false, const char *provenance=NULL)
void free_field(FieldID fid, const bool unordered=false, const char *provenance=NULL)
Definition legion.h:200
static const FieldSpace NO_SPACE
Definition legion.h:202
Definition legion.h:4587
Definition legion.h:5018
Definition legion.h:1183
void get_memories(std::set< Memory > &memories, bool silence_warnings=false, const char *warning_string=NULL) const
const void * get_buffer(Memory::Kind memory, size_t *extent_in_bytes=NULL, bool check_extent=false, bool silence_warnings=false, const char *warning_string=NULL) const
Span< T, PM > get_span(Memory::Kind memory, bool silence_warnings=false, const char *warning_string=NULL) const
void get_void_result(bool silence_warnings=false, const char *warning_string=NULL) const
T get_result(bool silence_warnings=false, const char *warning_string=NULL) const
bool is_empty(bool block=false, bool silence_warnings=false, const char *warning_string=NULL) const
bool is_ready(bool subscribe=false) const
Definition legion.h:1397
Domain get_future_map_domain(void) const
void get_void_result(const PT point[DIM]) const
T get_result(const DomainPoint &point, bool silence_warnings=false, const char *warning_string=NULL) const
void wait_all_results(bool silence_warnings=false, const char *warning_string=NULL) const
void get_void_result(const DomainPoint &point, bool silence_warnings=false, const char *warning_string=NULL) const
Future get_future(const PT point[DIM]) const
Future get_future(const DomainPoint &point) const
RT get_result(const PT point[DIM]) const
Definition legion.h:760
Definition legion.h:141
Definition legion.h:176
Definition legion.h:85
static const IndexSpace NO_SPACE
Definition legion.h:87
Definition legion.h:120
Definition legion.h:4499
Definition legion_types.h:2958
Definition legion.h:4214
void legion_handoff_to_ext(void) const
PhaseBarrier get_legion_wait_phase_barrier(void) const
PhaseBarrier get_legion_arrive_phase_barrier(void) const
void ext_handoff_to_legion(void) const
void legion_wait_on_ext(void) const
void ext_wait_on_legion(void) const
void advance_legion_handshake(void) const
Definition legion.h:715
Definition legion.h:304
static const LogicalPartition NO_PART
Definition legion.h:306
Definition legion.h:343
Definition legion.h:236
static const LogicalRegion NO_REGION
Definition legion.h:238
Definition legion.h:274
Definition legion.h:4279
void legion_handoff_to_mpi(void) const
Definition legion.h:4310
void mpi_handoff_to_legion(void) const
Definition legion.h:4299
void legion_wait_on_mpi(void) const
Definition legion.h:4315
void mpi_wait_on_legion(void) const
Definition legion.h:4304
Definition legion.h:4328
Definition legion.h:4648
Definition legion.h:3985
Definition legion.h:3371
Definition legion.h:4615
Definition legion.h:807
Definition legion.h:2591
LogicalRegion get_logical_region(void) const
void get_memories(std::set< Memory > &memories, bool silence_warnings=false, const char *warning_string=NULL) const
void wait_until_valid(bool silence_warnings=false, const char *warning_string=NULL)
PrivilegeMode get_privilege(void) const
bool is_valid(void) const
bool is_mapped(void) const
void get_fields(std::vector< FieldID > &fields) const
Definition legion.h:3593
Definition legion.h:3633
Definition legion.h:5037
Definition legion.h:656
Definition legion.h:4730
virtual unsigned get_depth(void) const =0
virtual LogicalRegion project(const Mappable *mappable, unsigned index, LogicalPartition upper_bound, const DomainPoint &point)
virtual LogicalRegion project(LogicalPartition upper_bound, const DomainPoint &point, const Domain &launch_domain, const void *args, size_t size)
virtual LogicalRegion project(const Mappable *mappable, unsigned index, LogicalRegion upper_bound, const DomainPoint &point)
virtual LogicalRegion project(LogicalRegion upper_bound, const DomainPoint &point, const Domain &launch_domain)
virtual bool is_invertible(void) const
Definition legion.h:4932
virtual LogicalRegion project(LogicalPartition upper_bound, const DomainPoint &point, const Domain &launch_domain)
virtual LogicalRegion project(LogicalRegion upper_bound, const DomainPoint &point, const Domain &launch_domain, const void *args, size_t size)
Definition legion.h:3103
Definition legion.h:4543
Definition legion.h:5077
static const SerdezOp * get_serdez_op(CustomSerdezID serdez_id)
static void register_custom_serdez_op(CustomSerdezID serdez_id, bool permit_duplicates=false)
Context begin_implicit_task(TaskID top_task_id, MapperID mapper_id, Processor::Kind proc_kind, const char *task_name=NULL, bool control_replicable=false, unsigned shard_per_address_space=1, int shard_id=-1, DomainPoint shard_point=DomainPoint())
static int wait_for_shutdown(void)
void unbind_implicit_task_from_external_thread(Context ctx)
IndexSpace create_index_space(Context ctx, const std::vector< DomainPoint > &points, const char *provenance=NULL)
CustomSerdezID generate_dynamic_serdez_id(void)
static void set_return_code(int return_code)
static LegionHandshake create_external_handshake(bool init_in_ext=true, int ext_participants=1, int legion_participants=1)
IndexSpace create_index_space(Context ctx, size_t dimensions, const Future &f, TypeTag type_tag=0, const char *provenance=NULL)
static void configure_MPI_interoperability(int rank)
static void set_top_level_task_id(TaskID top_id)
IndexSpace union_index_spaces(Context ctx, const std::vector< IndexSpace > &spaces, const char *provenance=NULL)
CustomSerdezID generate_library_serdez_ids(const char *name, size_t count)
void finish_implicit_task(Context ctx, Realm::Event effects=Realm::Event::NO_EVENT)
static CustomSerdezID generate_static_serdez_id(void)
static int start(int argc, char **argv, bool background=false, bool supply_default_mapper=true, bool filter=false)
Future launch_top_level_task(const TaskLauncher &launcher)
static ProjectionID register_region_function(ProjectionID handle)
static ProjectionID register_partition_function(ProjectionID handle)
IndexSpace create_index_space(Context ctx, const std::vector< Domain > &rects, const char *provenance=NULL)
static void register_custom_serdez_op(CustomSerdezID serdez_id, SerdezOp *serdez_op, bool permit_duplicates=false)
IndexSpace intersect_index_spaces(Context ctx, const std::vector< IndexSpace > &spaces, const char *provenance=NULL)
static void set_top_level_task_mapper_id(MapperID mapper_id)
void bind_implicit_task_to_external_thread(Context ctx)
static const char * get_legion_version(void)
IndexSpace subtract_index_spaces(Context ctx, IndexSpace left, IndexSpace right, const char *provenance=NULL)
IndexSpace create_index_space(Context ctx, const Domain &bounds, TypeTag type_tag=0, const char *provenance=NULL)
static MPILegionHandshake create_handshake(bool init_in_MPI=true, int mpi_participants=1, int legion_participants=1)
static void perform_registration_callback(RegistrationCallbackFnptr callback, bool global, bool deduplicate=true, size_t dedup_tag=0)
static void initialize(int *argc, char ***argv, bool filter=false, bool parse=true)
static size_t get_maximum_dimension(void)
static void add_registration_callback(RegistrationCallbackFnptr callback, bool dedup=true, size_t dedup_tag=0)
Definition legion.h:4968
Definition legion_domain.h:734
Definition legion.h:3668
Definition legion.h:4399
Definition legion_types.h:207
Definition legion_types.h:3466
Definition legion.h:524
Definition legion.h:3929
Definition legion.h:3780
void legion_task_preamble(const void *data, size_t datalen, realm_id_t proc_id, legion_task_t *taskptr, const legion_physical_region_t **regionptr, unsigned *num_regions_ptr, legion_context_t *ctxptr, legion_runtime_t *runtimeptr)
void legion_task_postamble(legion_runtime_t runtime, legion_context_t ctx, const void *retval, size_t retsize)
Definition legion.h:4068
Definition legion.h:2212
Definition legion.h:1835
Definition legion.h:2171
Definition legion.h:1146
Definition legion.h:2004
Definition legion.h:2304
Definition legion.h:1916
Definition legion.h:2064
Definition legion.h:1118
Definition legion.h:1650
Definition legion.h:1775
Definition legion.h:4673
Definition legion.h:2460
Definition legion.h:739
Definition legion.h:4175
Definition legion.h:1078
IndexSpace color_space
Definition legion.h:1108
FieldSpace field_space
Definition legion.h:1105
bool global_indexing
Definition legion.h:1106
bool valid_requirement
Definition legion.h:1107
Definition legion.h:2497
Definition legion.h:2394
Definition legion.h:875
ProjectionType handle_type
Definition legion.h:1003
std::set< FieldID > privilege_fields
Definition legion.h:994
RegionRequirement(LogicalPartition pid, ProjectionID _proj, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, PrivilegeMode _priv, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
RegionRequirement(LogicalRegion _handle, ProjectionID _proj, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, PrivilegeMode _priv, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
ProjectionID projection
Definition legion.h:1004
LogicalRegion parent
Definition legion.h:998
void * projection_args
Definition legion.h:1006
std::vector< FieldID > instance_fields
Definition legion.h:995
LogicalPartition partition
Definition legion.h:993
RegionRequirement & add_field(FieldID fid, bool instance=true)
MappingTagID tag
Definition legion.h:1000
CoherenceProperty prop
Definition legion.h:997
ReductionOpID redop
Definition legion.h:999
RegionRequirement(LogicalRegion _handle, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, ReductionOpID op, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
RegionRequirement(LogicalPartition pid, ProjectionID _proj, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, ReductionOpID op, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
PrivilegeMode privilege
Definition legion.h:996
RegionRequirement(LogicalRegion _handle, ProjectionID _proj, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, ReductionOpID op, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
size_t projection_args_size
Definition legion.h:1007
RegionFlags flags
Definition legion.h:1001
RegionRequirement(LogicalRegion _handle, const std::set< FieldID > &privilege_fields, const std::vector< FieldID > &instance_fields, PrivilegeMode _priv, CoherenceProperty _prop, LogicalRegion _parent, MappingTagID _tag=0, bool _verified=false)
LogicalRegion region
Definition legion.h:992
Definition legion.h:4683
Definition legion.h:4116
Definition legion.h:1509
Definition legion.h:4702
Definition legion.h:1547
Definition legion.h:2521
Definition legion.h:2410
Definition legion.h:2428