20 #if !defined(LEGION_ENABLE_C_BINDINGS) && !defined(LEGION_DISABLE_C_BINDINGS)
22 #define LEGION_ENABLE_C_BINDINGS
25 #if !defined(LEGION_ENABLE_CXX_BINDINGS) && !defined(LEGION_DISABLE_CXX_BINDINGS)
27 #define LEGION_ENABLE_CXX_BINDINGS
31 #ifdef LEGION_ENABLE_C_BINDINGS
35 #ifdef LEGION_ENABLE_CXX_BINDINGS
36 #ifndef __LEGION_RUNTIME_H__
37 #define __LEGION_RUNTIME_H__
52 #if __cplusplus < 201103L
53 #error "Legion requires C++11 as the minimum standard version"
58 #include "legion/legion_constraint.h"
59 #include "legion/legion_redop.h"
61 #define LEGION_PRINT_ONCE(runtime, ctx, file, fmt, ...) \
64 snprintf(message, 4096, fmt, ##__VA_ARGS__); \
65 runtime->print_once(ctx, file, message); \
90 FRIEND_ALL_RUNTIME_CLASSES
91 IndexSpace(IndexSpaceID
id, IndexTreeID tid, TypeTag tag);
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 IndexSpaceID get_id(
void)
const {
return id; }
100 inline IndexTreeID get_tree_id(
void)
const {
return tid; }
101 inline bool exists(
void)
const {
return (
id != 0); }
102 inline TypeTag get_type_tag(
void)
const {
return type_tag; }
103 inline int get_dim(
void)
const;
105 friend std::ostream& operator<<(std::ostream& os,
106 const IndexSpace& is);
118 template<
int DIM,
typename COORD_T = coord_t>
121 static_assert(DIM > 0,
"DIM must be positive");
122 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
125 FRIEND_ALL_RUNTIME_CLASSES
145 FRIEND_ALL_RUNTIME_CLASSES
146 IndexPartition(IndexPartitionID
id, IndexTreeID tid, TypeTag tag);
154 inline IndexPartitionID get_id(
void)
const {
return id; }
155 inline IndexTreeID get_tree_id(
void)
const {
return tid; }
156 inline bool exists(
void)
const {
return (
id != 0); }
157 inline TypeTag get_type_tag(
void)
const {
return type_tag; }
158 inline int get_dim(
void)
const;
160 friend std::ostream& operator<<(std::ostream& os,
173 template<
int DIM,
typename COORD_T = coord_t>
176 static_assert(DIM > 0,
"DIM must be positive");
177 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
180 FRIEND_ALL_RUNTIME_CLASSES
203 FRIEND_ALL_RUNTIME_CLASSES
208 inline bool operator==(
const FieldSpace &rhs)
const;
209 inline bool operator!=(
const FieldSpace &rhs)
const;
210 inline bool operator<(
const FieldSpace &rhs)
const;
211 inline bool operator>(
const FieldSpace &rhs)
const;
212 inline FieldSpaceID get_id(
void)
const {
return id; }
213 inline bool exists(
void)
const {
return (
id != 0); }
215 friend std::ostream& operator<<(std::ostream& os,
const FieldSpace& fs);
238 FRIEND_ALL_RUNTIME_CLASSES
247 inline IndexSpace get_index_space(
void)
const {
return index_space; }
248 inline FieldSpace get_field_space(
void)
const {
return field_space; }
249 inline RegionTreeID get_tree_id(
void)
const {
return tree_id; }
250 inline bool exists(
void)
const {
return (tree_id != 0); }
251 inline TypeTag get_type_tag(
void)
const
252 {
return index_space.get_type_tag(); }
253 inline int get_dim(
void)
const {
return index_space.get_dim(); }
255 friend std::ostream& operator<<(std::ostream& os,
256 const LogicalRegion& lr);
258 RegionTreeID tree_id;
259 IndexSpace index_space;
260 FieldSpace field_space;
269 template<
int DIM,
typename COORD_T = coord_t>
272 static_assert(DIM > 0,
"DIM must be positive");
273 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
276 FRIEND_ALL_RUNTIME_CLASSES
305 FRIEND_ALL_RUNTIME_CLASSES
315 {
return index_partition; }
316 inline FieldSpace get_field_space(
void)
const {
return field_space; }
317 inline RegionTreeID get_tree_id(
void)
const {
return tree_id; }
318 inline bool exists(
void)
const {
return (tree_id != 0); }
319 inline TypeTag get_type_tag(
void)
const
320 {
return index_partition.get_type_tag(); }
321 inline int get_dim(
void)
const {
return index_partition.get_dim(); }
323 friend std::ostream& operator<<(std::ostream& os,
324 const LogicalPartition& lp);
326 RegionTreeID tree_id;
327 IndexPartition index_partition;
328 FieldSpace field_space;
337 template<
int DIM,
typename COORD_T = coord_t>
340 static_assert(DIM > 0,
"DIM must be positive");
341 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
344 FRIEND_ALL_RUNTIME_CLASSES
380 FRIEND_ALL_RUNTIME_CLASSES
388 inline bool exists(
void)
const {
return (impl != NULL); }
411 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
412 CustomSerdezID serdez_id = 0,
413 bool local_field =
false,
414 const char *provenance = NULL);
416 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
417 CustomSerdezID serdez_id = 0,
418 bool local_field =
false,
419 const char *provenance = NULL);
430 const char *provenance = NULL);
440 FieldID desired_fieldid = LEGION_AUTO_GENERATE_ID,
441 CustomSerdezID serdez_id = 0,
const char *provenance = NULL);
461 std::vector<FieldID> &resulting_fields,
462 CustomSerdezID serdez_id = 0,
463 bool local_fields =
false,
464 const char *provenance = NULL);
466 std::vector<FieldID> &resulting_fields,
467 CustomSerdezID serdez_id = 0,
468 bool local_fields =
false,
469 const char *provenance = NULL);
480 const bool unordered =
false,
481 const char *provenance = NULL);
490 std::vector<FieldID> &resulting_fields,
491 CustomSerdezID serdez_id = 0,
492 const char *provenance = NULL);
498 Internal::FieldAllocatorImpl *impl;
517 : args(
const_cast<void*
>(arg)), arglen(argsize) { }
519 : args(rhs.args), arglen(rhs.arglen) { }
521 : args(rhs.args), arglen(rhs.arglen) { }
523 inline size_t get_size(
void)
const {
return arglen; }
524 inline void* get_ptr(
void)
const {
return args; }
527 {
return (args == arg.args) && (arglen == arg.arglen); }
529 {
return (args < arg.args) && (arglen < arg.arglen); }
531 { args = rhs.args; arglen = rhs.arglen;
return *
this; }
533 { args = rhs.args; arglen = rhs.arglen;
return *
this; }
563 inline bool operator==(
const ArgumentMap &rhs)
const
564 {
return (impl == rhs.impl); }
565 inline bool operator<(
const ArgumentMap &rhs)
const
566 {
return (impl < rhs.impl); }
567 inline bool exists(
void)
const {
return (impl != NULL); }
582 bool replace =
true);
590 bool replace =
true);
614 template<
typename PT,
unsigned DIM>
616 bool replace =
false);
622 template<
typename PT,
unsigned DIM>
625 FRIEND_ALL_RUNTIME_CLASSES
626 Internal::ArgumentMapImpl *impl;
628 explicit ArgumentMap(Internal::ArgumentMapImpl *i);
656 FRIEND_ALL_RUNTIME_CLASSES
657 Internal::PredicateImpl *impl;
659 explicit Predicate(Internal::PredicateImpl *impl);
663 inline bool operator==(
const Predicate &p)
const;
664 inline bool operator<(
const Predicate &p)
const;
665 inline bool operator!=(
const Predicate &p)
const;
666 inline bool exists(
void)
const {
return (impl != NULL); }
709 FRIEND_ALL_RUNTIME_CLASSES
712 bool operator<(
const Lock &rhs)
const;
713 bool operator==(
const Lock &rhs)
const;
715 void acquire(
unsigned mode = 0,
bool exclusive =
true);
718 Reservation reservation_lock;
756 FRIEND_ALL_RUNTIME_CLASSES
757 explicit Grant(Internal::GrantImpl *impl);
759 bool operator==(
const Grant &g)
const
760 {
return impl == g.impl; }
761 bool operator<(
const Grant &g)
const
762 {
return impl < g.impl; }
765 Internal::GrantImpl *impl;
801 FRIEND_ALL_RUNTIME_CLASSES
808 void arrive(
unsigned count = 1);
810 void alter_arrival_count(
int delta);
811 Realm::Barrier get_barrier(
void)
const {
return phase_barrier; }
812 bool exists(
void)
const;
815 friend std::ostream& operator<<(std::ostream& os,
const PhaseBarrier& pb);
837 FRIEND_ALL_RUNTIME_CLASSES
841 void arrive(
const void *value,
size_t size,
unsigned count = 1);
873 PrivilegeMode _priv, CoherenceProperty _prop,
875 bool _verified =
false);
882 PrivilegeMode _priv, CoherenceProperty _prop,
884 bool _verified =
false);
891 PrivilegeMode _priv, CoherenceProperty _prop,
893 bool _verified =
false);
901 ReductionOpID op, CoherenceProperty _prop,
903 bool _verified =
false);
910 ReductionOpID op, CoherenceProperty _prop,
912 bool _verified =
false);
919 ReductionOpID op, CoherenceProperty _prop,
921 bool _verified =
false);
926 MappingTagID _tag = 0,
bool _verified =
false);
928 PrivilegeMode _priv, CoherenceProperty _prop,
930 bool _verified =
false);
932 PrivilegeMode _priv, CoherenceProperty _prop,
934 bool _verified =
false);
937 MappingTagID _tag = 0,
bool _verified =
false);
939 ReductionOpID op, CoherenceProperty _prop,
941 bool _verified =
false);
943 ReductionOpID op, CoherenceProperty _prop,
945 bool _verified =
false);
961 bool instance =
true);
965 inline bool is_verified(
void)
const
966 {
return (
flags & LEGION_VERIFIED_FLAG); }
967 inline bool is_no_access(
void)
const
968 {
return (
flags & LEGION_NO_ACCESS_FLAG); }
969 inline bool is_restricted(
void)
const
970 {
return (
flags & LEGION_RESTRICTED_FLAG); }
971 LEGION_DEPRECATED(
"Premapping regions is no longer supported.")
972 inline
bool must_premap(
void)
const
975 const void* get_projection_args(
size_t *size)
const;
976 void set_projection_args(
const void *args,
size_t size,
bool own =
false);
978 bool has_field_privilege(FieldID fid)
const;
1072 const std::set<FieldID> &fields,
1084 template <
int DIM,
typename COORD_T>
1085 void set_type_tag();
1110 AllocateMode privilege;
1118 bool _verified =
false);
1138 AllocateMode privilege;
1144 bool _verified =
false);
1179 Internal::FutureImpl *impl;
1182 FRIEND_ALL_RUNTIME_CLASSES
1183 explicit Future(Internal::FutureImpl *impl);
1185 inline bool exists(
void)
const {
return (impl != NULL); }
1186 inline bool operator==(
const Future &f)
const
1187 {
return impl == f.impl; }
1188 inline bool operator<(
const Future &f)
const
1189 {
return impl < f.impl; }
1201 template<
typename T>
1203 const char *warning_string = NULL)
const;
1210 const char *warning_string = NULL)
const;
1222 bool is_empty(
bool block =
false,
bool silence_warnings =
false,
1223 const char *warning_string = NULL)
const;
1247 template<
typename T, PrivilegeMode PM = LEGION_READ_ONLY>
1249 bool silence_warnings =
false,
1250 const char *warning_string = NULL)
const;
1266 size_t *extent_in_bytes = NULL,
1267 bool check_extent =
false,
1268 bool silence_warnings =
false,
1269 const char *warning_string = NULL)
const;
1284 template<
typename T>
1285 LEGION_DEPRECATED(
"Use 'Future::get_span' instead")
1287 const
char *warning_string = NULL) const;
1300 const
char *warning_string = NULL) const;
1318 template<typename T>
1321 inline
bool valid(
void) const;
1323 inline
void wait(
void) const;
1330 template<typename T>
1331 LEGION_DEPRECATED("Use the version without a runtime pointer argument")
1333 template<typename T>
1340 LEGION_DEPRECATED("Use the version without a runtime pointer argument")
1342 const
void *buffer,
size_t bytes,
bool take_ownership = false);
1344 const
void *buffer,
size_t bytes,
bool take_ownership = false,
1345 const
char *provenance = NULL,
bool shard_local = false);
1347 const Realm::ExternalInstanceResource &resource,
1348 void (*freefunc)(const Realm::ExternalInstanceResource&) = NULL,
1349 const
char *provenance = NULL,
bool shard_local = false);
1352 template<PrivilegeMode, typename,
int, typename, typename,
bool>
1354 Realm::RegionInstance get_instance(Memory::Kind kind,
1355 size_t field_size,
bool check_field_size,
1356 const
char *warning_string,
bool silence_warnings) const;
1357 void report_incompatible_accessor(const
char *accessor_kind,
1358 Realm::RegionInstance instance) const;
1381 Internal::FutureMapImpl *impl;
1384 FRIEND_ALL_RUNTIME_CLASSES
1385 explicit FutureMap(Internal::FutureMapImpl *impl);
1387 inline bool exists(
void)
const {
return (impl != NULL); }
1388 inline bool operator==(
const FutureMap &f)
const
1389 {
return impl == f.impl; }
1390 inline bool operator<(
const FutureMap &f)
const
1391 {
return impl < f.impl; }
1393 {
return get_future(point); }
1405 template<
typename T>
1407 bool silence_warnings =
false,
1408 const char *warning_string = NULL)
const;
1425 bool silence_warnings =
false,
1426 const char *warning_string = NULL)
const;
1435 template<
typename RT,
typename PT,
unsigned DIM>
1445 template<
typename PT,
unsigned DIM>
1452 template<
typename PT,
unsigned DIM>
1462 const char *warning_string = NULL)
const;
1489 unsigned previous_req_index,
1490 unsigned current_req_index,
1491 DependenceType dtype,
1492 bool validates =
false,
1493 bool shard_only =
false);
1495 inline void add_field(FieldID fid);
1500 unsigned previous_offset;
1502 unsigned previous_req_index;
1504 unsigned current_req_index;
1506 DependenceType dependence_type;
1513 std::set<FieldID> dependent_fields;
1530 MappingTagID tag = 0,
1532 const char *provenance =
"");
1538 inline void add_field(
unsigned idx, FieldID fid,
bool inst =
true);
1540 inline void add_future(
Future f);
1541 inline void add_grant(
Grant g);
1547 inline void set_predicate_false_future(
Future f);
1550 inline void set_independent_requirements(
bool independent);
1553 std::vector<IndexSpaceRequirement> index_requirements;
1554 std::vector<RegionRequirement> region_requirements;
1555 std::vector<Future> futures;
1556 std::vector<Grant> grants;
1557 std::vector<PhaseBarrier> wait_barriers;
1558 std::vector<PhaseBarrier> arrive_barriers;
1575 Future predicate_false_future;
1579 std::string provenance;
1583 const std::vector<StaticDependence> *static_dependences;
1593 bool enable_inlining;
1603 bool local_function_task;
1609 bool independent_requirements;
1613 bool elide_future_return;
1615 bool silence_warnings;
1636 MappingTagID tag = 0,
1638 const char *provenance =
"");
1646 MappingTagID tag = 0,
1648 const char *provenance =
"");
1654 inline void add_field(
unsigned idx, FieldID fid,
bool inst =
true);
1656 inline void add_future(
Future f);
1657 inline void add_grant(
Grant g);
1663 inline void set_predicate_false_future(
Future f);
1666 inline void set_independent_requirements(
bool independent);
1674 std::vector<IndexSpaceRequirement> index_requirements;
1675 std::vector<RegionRequirement> region_requirements;
1676 std::vector<Future> futures;
1679 std::vector<ArgumentMap> point_futures;
1680 std::vector<Grant> grants;
1681 std::vector<PhaseBarrier> wait_barriers;
1682 std::vector<PhaseBarrier> arrive_barriers;
1697 bool must_parallelism;
1707 Future predicate_false_future;
1711 std::string provenance;
1715 const std::vector<StaticDependence> *static_dependences;
1725 bool enable_inlining;
1731 bool independent_requirements;
1735 bool elide_future_return;
1737 bool silence_warnings;
1756 MappingTagID tag = 0,
1757 LayoutConstraintID layout_id = 0,
1759 const char *provenance =
"");
1761 inline void add_field(FieldID fid,
bool inst =
true);
1763 inline void add_grant(
Grant g);
1770 std::vector<Grant> grants;
1771 std::vector<PhaseBarrier> wait_barriers;
1772 std::vector<PhaseBarrier> arrive_barriers;
1777 LayoutConstraintID layout_constraint_id;
1780 std::string provenance;
1784 const std::vector<StaticDependence> *static_dependences;
1814 MapperID
id = 0, MappingTagID tag = 0,
1816 const char *provenance =
"");
1820 inline void add_src_field(
unsigned idx, FieldID fid,
bool inst =
true);
1821 inline void add_dst_field(
unsigned idx, FieldID fid,
bool inst =
true);
1824 inline void add_src_indirect_field(FieldID src_idx_fid,
1826 bool is_range_indirection =
false,
1828 inline void add_dst_indirect_field(FieldID dst_idx_fid,
1830 bool is_range_indirection =
false,
1834 bool is_range_indirection =
false);
1837 bool is_range_indirection =
false);
1839 inline void add_grant(
Grant g);
1845 std::vector<RegionRequirement> src_requirements;
1846 std::vector<RegionRequirement> dst_requirements;
1847 std::vector<RegionRequirement> src_indirect_requirements;
1848 std::vector<RegionRequirement> dst_indirect_requirements;
1849 std::vector<bool> src_indirect_is_range;
1850 std::vector<bool> dst_indirect_is_range;
1851 std::vector<Grant> grants;
1852 std::vector<PhaseBarrier> wait_barriers;
1853 std::vector<PhaseBarrier> arrive_barriers;
1865 std::string provenance;
1869 const std::vector<StaticDependence> *static_dependences;
1873 bool possible_src_indirect_out_of_range;
1874 bool possible_dst_indirect_out_of_range;
1877 bool possible_dst_indirect_aliasing;
1879 bool silence_warnings;
1896 MapperID
id = 0, MappingTagID tag = 0,
1898 const char *provenance =
"");
1900 MapperID
id = 0, MappingTagID tag = 0,
1902 const char *provenance =
"");
1906 inline void add_src_field(
unsigned idx, FieldID fid,
bool inst =
true);
1907 inline void add_dst_field(
unsigned idx, FieldID fid,
bool inst =
true);
1910 inline void add_src_indirect_field(FieldID src_idx_fid,
1912 bool is_range_indirection =
false,
1914 inline void add_dst_indirect_field(FieldID dst_idx_fid,
1916 bool is_range_indirection =
false,
1920 bool is_range_indirection =
false);
1923 bool is_range_indirection =
false);
1925 inline void add_grant(
Grant g);
1931 std::vector<RegionRequirement> src_requirements;
1932 std::vector<RegionRequirement> dst_requirements;
1933 std::vector<RegionRequirement> src_indirect_requirements;
1934 std::vector<RegionRequirement> dst_indirect_requirements;
1935 std::vector<bool> src_indirect_is_range;
1936 std::vector<bool> dst_indirect_is_range;
1937 std::vector<Grant> grants;
1938 std::vector<PhaseBarrier> wait_barriers;
1939 std::vector<PhaseBarrier> arrive_barriers;
1951 std::string provenance;
1955 const std::vector<StaticDependence> *static_dependences;
1959 bool possible_src_indirect_out_of_range;
1960 bool possible_dst_indirect_out_of_range;
1963 bool possible_dst_indirect_aliasing;
1968 bool collective_src_indirect_points;
1969 bool collective_dst_indirect_points;
1971 bool silence_warnings;
1985 MapperID
id = 0, MappingTagID tag = 0,
1987 const char *provenance =
"");
1990 MapperID
id = 0, MappingTagID tag = 0,
1992 const char *provenance =
"");
1995 inline void set_future(
Future f);
1996 inline void add_field(FieldID fid);
1997 inline void add_grant(
Grant g);
2008 std::set<FieldID> fields;
2009 std::vector<Grant> grants;
2010 std::vector<PhaseBarrier> wait_barriers;
2011 std::vector<PhaseBarrier> arrive_barriers;
2022 std::string provenance;
2026 const std::vector<StaticDependence> *static_dependences;
2028 bool silence_warnings;
2046 ProjectionID projection = 0,
2048 MapperID
id = 0, MappingTagID tag = 0,
2050 const char *provenance =
"");
2053 ProjectionID projection = 0,
2055 MapperID
id = 0, MappingTagID tag = 0,
2057 const char *provenance =
"");
2060 ProjectionID projection = 0,
2062 MapperID
id = 0, MappingTagID tag = 0,
2064 const char *provenance =
"");
2067 ProjectionID projection = 0,
2069 MapperID
id = 0, MappingTagID tag = 0,
2071 const char *provenance =
"");
2075 ProjectionID projection = 0,
2077 MapperID
id = 0, MappingTagID tag = 0,
2079 const char *provenance =
"");
2082 ProjectionID projection = 0,
2084 MapperID
id = 0, MappingTagID tag = 0,
2086 const char *provenance =
"");
2089 ProjectionID projection = 0,
2091 MapperID
id = 0, MappingTagID tag = 0,
2093 const char *provenance =
"");
2096 ProjectionID projection = 0,
2098 MapperID
id = 0, MappingTagID tag = 0,
2100 const char *provenance =
"");
2103 inline void set_future(
Future f);
2104 inline void add_field(FieldID fid);
2105 inline void add_grant(
Grant g);
2119 ProjectionID projection;
2123 std::set<FieldID> fields;
2124 std::vector<Grant> grants;
2125 std::vector<PhaseBarrier> wait_barriers;
2126 std::vector<PhaseBarrier> arrive_barriers;
2132 std::string provenance;
2136 const std::vector<StaticDependence> *static_dependences;
2138 bool silence_warnings;
2151 inline void add_field(FieldID fid);
2155 std::set<FieldID> fields;
2158 std::string provenance;
2162 const std::vector<StaticDependence> *static_dependences;
2164 bool silence_warnings;
2192 const bool restricted =
true,
2193 const bool mapped =
true);
2198 inline void initialize_constraints(
bool column_major,
bool soa,
2199 const std::vector<FieldID> &fields,
2200 const std::map<FieldID,size_t> *alignments = NULL);
2201 LEGION_DEPRECATED(
"Use Realm::ExternalFileResource instead")
2202 inline void attach_file(
const char *file_name,
2203 const std::vector<FieldID> &fields,
2204 LegionFileMode mode);
2205 LEGION_DEPRECATED(
"Use Realm::ExternalHDF5Resource instead")
2206 inline void attach_hdf5(
const char *file_name,
2207 const std::map<FieldID,const char*> &field_map,
2208 LegionFileMode mode);
2211 LEGION_DEPRECATED(
"Use Realm::ExternalMemoryResource instead")
2212 inline void attach_array_aos(
void *base,
bool column_major,
2213 const std::vector<FieldID> &fields,
2214 Memory memory = Memory::NO_MEMORY,
2215 const std::map<FieldID,size_t> *alignments = NULL);
2216 LEGION_DEPRECATED(
"Use Realm::ExternalMemoryResource instead")
2217 inline void attach_array_soa(
void *base,
bool column_major,
2218 const std::vector<FieldID> &fields,
2219 Memory memory = Memory::NO_MEMORY,
2220 const std::map<FieldID,size_t> *alignments = NULL);
2222 ExternalResource resource;
2225 std::set<FieldID> privilege_fields;
2228 const Realm::ExternalInstanceResource* external_resource;
2230 LayoutConstraintSet constraints;
2247 bool deduplicate_across_shards;
2250 std::string provenance;
2253 LEGION_DEPRECATED(
"file_name is deprecated, use external_resource")
2254 const char *file_name;
2255 LEGION_DEPRECATED(
"mode is deprecated, use external_resource")
2256 LegionFileMode mode;
2257 LEGION_DEPRECATED(
"file_fields is deprecated, use external_resource")
2258 std::vector<FieldID> file_fields;
2260 std::map<FieldID,
const char*> field_files;
2267 const std::vector<StaticDependence> *static_dependences;
2284 const bool restricted =
true);
2289 inline void initialize_constraints(
bool column_major,
bool soa,
2290 const std::vector<FieldID> &fields,
2291 const std::map<FieldID,size_t> *alignments = NULL);
2293 const Realm::ExternalInstanceResource *resource);
2294 LEGION_DEPRECATED(
"Use Realm::ExternalFileResource instead")
2296 const char *file_name,
2297 const std::vector<FieldID> &fields,
2298 LegionFileMode mode);
2299 LEGION_DEPRECATED(
"Use Realm::ExternalHDF5Resource instead")
2301 const char *file_name,
2302 const std::map<FieldID,const char*> &field_map,
2303 LegionFileMode mode);
2306 LEGION_DEPRECATED(
"Use Realm::ExternalMemoryResource instead")
2308 void *base,
bool column_major,
2309 const std::vector<FieldID> &fields,
2310 Memory memory = Memory::NO_MEMORY,
2311 const std::map<FieldID,size_t> *alignments = NULL);
2312 LEGION_DEPRECATED(
"Use Realm::ExternalMemoryResource instead")
2314 void *base,
bool column_major,
2315 const std::vector<FieldID> &fields,
2316 Memory memory = Memory::NO_MEMORY,
2317 const std::map<FieldID,size_t> *alignments = NULL);
2319 ExternalResource resource;
2321 std::set<FieldID> privilege_fields;
2322 std::vector<LogicalRegion> handles;
2326 std::vector<const Realm::ExternalInstanceResource*> external_resources;
2328 LayoutConstraintSet constraints;
2335 bool deduplicate_across_shards;
2338 std::string provenance;
2341 LEGION_DEPRECATED(
"mode is deprecated, use external_resources")
2342 LegionFileMode mode;
2343 LEGION_DEPRECATED(
"file_names is deprecated, use external_resources")
2344 std::vector<const char*> file_names;
2345 LEGION_DEPRECATED(
"file_fields is deprecated, use external_resources")
2346 std::vector<FieldID> file_fields;
2349 std::vector<
const char*> > field_files;
2352 LEGION_DEPRECATED(
"pointers is deprecated, use external_resources")
2353 std::vector<PointerConstraint> pointers;
2357 std::vector<size_t> footprint;
2361 const std::vector<StaticDependence> *static_dependences;
2374 inline void add_predicate(
const Predicate &pred);
2377 std::vector<Predicate> predicates;
2378 std::string provenance;
2390 inline void add_precondition(
const Future &f);
2392 TimingMeasurement measurement;
2393 std::set<Future> preconditions;
2396 std::string provenance;
2407 MapperID mapper = 0,
2408 MappingTagID tag = 0,
2409 size_t return_type_size = SIZE_MAX);
2415 std::vector<Future> futures;
2416 size_t return_type_size;
2419 std::string provenance;
2440 const char *layout_name = NULL);
2443 add_constraint(
const SpecializedConstraint &constraint);
2445 add_constraint(
const MemoryConstraint &constraint);
2447 add_constraint(
const OrderingConstraint &constraint);
2449 add_constraint(
const TilingConstraint &constraint);
2451 add_constraint(
const FieldConstraint &constraint);
2453 add_constraint(
const DimensionConstraint &constraint);
2455 add_constraint(
const AlignmentConstraint &constraint);
2457 add_constraint(
const OffsetConstraint &constraint);
2459 add_constraint(
const PointerConstraint &constraint);
2461 add_constraint(
const PaddingConstraint &constraint);
2464 LayoutConstraintSet layout_constraints;
2465 const char* layout_name;
2480 const char *variant_name = NULL);
2482 bool global =
true);
2485 add_constraint(
const ISAConstraint &constraint);
2487 add_constraint(
const ProcessorConstraint &constraint);
2489 add_constraint(
const ResourceConstraint &constraint);
2491 add_constraint(
const LaunchConstraint &constraint);
2493 add_constraint(
const ColocationConstraint &constraint);
2496 add_layout_constraint_set(
unsigned index, LayoutConstraintID desc);
2498 inline void set_leaf(
bool is_leaf =
true);
2499 inline void set_inner(
bool is_inner =
true);
2500 inline void set_idempotent(
bool is_idempotent =
true);
2501 inline void set_replicable(
bool is_replicable =
true);
2502 inline void set_concurrent(
bool is_concurrent =
true);
2503 inline void set_concurrent_barrier(
bool needs_barrier =
true);
2505 inline void add_generator_task(TaskID tid);
2508 bool global_registration;
2509 const char* task_variant_name;
2511 ExecutionConstraintSet execution_constraints;
2512 TaskLayoutConstraintSet layout_constraints;
2515 std::set<TaskID> generator_tasks;
2519 bool idempotent_variant;
2520 bool replicable_variant;
2521 bool concurrent_variant;
2522 bool concurrent_barrier;
2544 Internal::PhysicalRegionImpl *impl;
2546 FRIEND_ALL_RUNTIME_CLASSES
2551 inline bool exists(
void)
const {
return (impl != NULL); }
2553 {
return (impl == reg.impl); }
2555 {
return (impl < reg.impl); }
2569 const char *warning_string = NULL);
2589 bool silence_warnings =
false,
2590 const char *warning_string = NULL)
const;
2596 template<
int DIM,
typename COORD_T>
2597 DomainT<DIM,COORD_T> get_bounds(
void)
const;
2600 template<
int DIM,
typename COORD_T>
2601 operator DomainT<DIM,COORD_T>(
void)
const;
2604 template<
int DIM,
typename COORD_T>
2605 operator Rect<DIM,COORD_T>(
void)
const;
2608 template<PrivilegeMode,
typename,
int,
typename,
typename,
bool>
2610 template<
typename,
bool,
int,
typename,
typename,
bool>
2612 template<
typename,
int,
typename,
typename,
bool,
bool,
int>
2613 friend class MultiRegionAccessor;
2614 template<
typename,
int,
typename,
typename,
bool>
2616 template<
typename,
int,
typename,
typename>
2618 template<
typename, PrivilegeMode>
2623 template<PrivilegeMode,
typename,
int,
typename>
2625 template<
typename,
int,
typename>
2626 friend class UnsafeSpanIterator;
2627 Realm::RegionInstance get_instance_info(PrivilegeMode mode,
2628 FieldID fid,
size_t field_size,
2629 void *realm_is, TypeTag type_tag,
2630 const char *warning_string,
2631 bool silence_warnings,
2632 bool generic_accessor,
2633 bool check_field_size,
2634 ReductionOpID redop = 0)
const;
2635 Realm::RegionInstance get_instance_info(PrivilegeMode mode,
2636 const std::vector<PhysicalRegion> &other_regions,
2637 FieldID fid,
size_t field_size,
2638 void *realm_is, TypeTag type_tag,
2639 const char *warning_string,
2640 bool silence_warnings,
2641 bool generic_accessor,
2642 bool check_field_size,
2644 ReductionOpID redop = 0)
const;
2645 Realm::RegionInstance get_padding_info(FieldID fid,
size_t field_size,
2647 const char *warning_string,
2648 bool silence_warnings,
2649 bool generic_accessor,
2650 bool check_field_size)
const;
2651 void report_incompatible_accessor(
const char *accessor_kind,
2652 Realm::RegionInstance instance, FieldID fid)
const;
2653 void report_incompatible_multi_accessor(
unsigned index, FieldID fid,
2654 Realm::RegionInstance inst1,
2655 Realm::RegionInstance inst2)
const;
2656 void report_colocation_violation(
const char *accessor_kind, FieldID fid,
2657 Realm::RegionInstance inst1,
2658 Realm::RegionInstance inst2,
2660 bool reduction =
false)
const;
2661 static void empty_colocation_regions(
const char *accessor_kind,
2662 FieldID fid,
bool reduction =
false);
2663 static void fail_bounds_check(
DomainPoint p, FieldID fid,
2664 PrivilegeMode mode,
bool multi =
false);
2665 static void fail_bounds_check(
Domain d, FieldID fid,
2666 PrivilegeMode mode,
bool multi =
false);
2667 static void fail_privilege_check(
DomainPoint p, FieldID fid,
2668 PrivilegeMode mode);
2669 static void fail_privilege_check(
Domain d, FieldID fid,
2670 PrivilegeMode mode);
2671 static void fail_padding_check(
DomainPoint p, FieldID fid);
2673 void get_bounds(
void *realm_is, TypeTag type_tag)
const;
2690 Internal::ExternalResourcesImpl *impl;
2692 FRIEND_ALL_RUNTIME_CLASSES
2697 inline bool exists(
void)
const {
return (impl != NULL); }
2699 {
return (impl == reg.impl); }
2701 {
return (impl < reg.impl); }
2703 size_t size(
void)
const;
2744 template<PrivilegeMode MODE,
typename FT,
int N,
typename COORD_T = coord_t,
2745 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
2746 #ifdef LEGION_BOUNDS_CHECKS
2747 bool CHECK_BOUNDS =
true>
2749 bool CHECK_BOUNDS =
false>
2753 static_assert(N > 0,
"N must be positive");
2754 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
2760 size_t actual_field_size =
sizeof(FT),
2762 bool check_field_size =
true,
2764 bool check_field_size =
false,
2766 bool silence_warnings =
false,
2767 const char *warning_string = NULL,
2768 size_t subfield_offset = 0) { }
2774 const Rect<N,COORD_T> bounds,
2777 size_t actual_field_size =
sizeof(FT),
2779 bool check_field_size =
true,
2781 bool check_field_size =
false,
2783 bool silence_warnings =
false,
2784 const char *warning_string = NULL,
2785 size_t subfield_offset = 0) { }
2793 size_t actual_field_size =
sizeof(FT),
2795 bool check_field_size =
true,
2797 bool check_field_size =
false,
2799 bool silence_warnings =
false,
2800 const char *warning_string = NULL,
2801 size_t subfield_offset = 0) { }
2807 const Rect<N,COORD_T> bounds,
2810 size_t actual_field_size =
sizeof(FT),
2812 bool check_field_size =
true,
2814 bool check_field_size =
false,
2816 bool silence_warnings =
false,
2817 const char *warning_string = NULL,
2818 size_t subfield_offset = 0) { }
2822 Memory::Kind kind = Memory::NO_MEMKIND,
2825 size_t actual_field_size =
sizeof(FT),
2827 bool check_field_size =
true,
2829 bool check_field_size =
false,
2831 bool silence_warnings =
false,
2832 const char *warning_string = NULL,
2833 size_t subfield_offset = 0) { }
2837 const Rect<N,COORD_T> bounds,
2838 Memory::Kind kind = Memory::NO_MEMKIND,
2841 size_t actual_field_size =
sizeof(FT),
2843 bool check_field_size =
true,
2845 bool check_field_size =
false,
2847 bool silence_warnings =
false,
2848 const char *warning_string = NULL,
2849 size_t subfield_offset = 0) { }
2854 template<
typename InputIterator>
2856 InputIterator stop_region, FieldID fid,
2859 size_t actual_field_size =
sizeof(FT),
2861 bool check_field_size =
true,
2863 bool check_field_size =
false,
2865 bool silence_warnings =
false,
2866 const char *warning_string = NULL,
2867 size_t subfield_offset = 0) { }
2873 template<
typename InputIterator>
2875 InputIterator stop_region, FieldID fid,
2876 const Rect<N,COORD_T> bounds,
2879 size_t actual_field_size =
sizeof(FT),
2881 bool check_field_size =
true,
2883 bool check_field_size =
false,
2885 bool silence_warnings =
false,
2886 const char *warning_string = NULL,
2887 size_t subfield_offset = 0) { }
2891 template<
typename InputIterator,
int M>
2893 InputIterator stop_region, FieldID fid,
2897 size_t actual_field_size =
sizeof(FT),
2899 bool check_field_size =
true,
2901 bool check_field_size =
false,
2903 bool silence_warnings =
false,
2904 const char *warning_string = NULL,
2905 size_t subfield_offset = 0) { }
2909 template<
typename InputIterator,
int M>
2911 InputIterator stop_region, FieldID fid,
2913 const Rect<N,COORD_T> bounds,
2916 size_t actual_field_size =
sizeof(FT),
2918 bool check_field_size =
true,
2920 bool check_field_size =
false,
2922 bool silence_warnings =
false,
2923 const char *warning_string = NULL,
2924 size_t subfield_offset = 0) { }
2931 size_t actual_field_size =
sizeof(FT),
2933 bool check_field_size =
true,
2935 bool check_field_size =
false,
2937 bool silence_warnings =
false,
2938 const char *warning_string = NULL,
2939 size_t subfield_offset = 0) { }
2944 const Rect<N,COORD_T> &bounds,
2947 size_t actual_field_size =
sizeof(FT),
2949 bool check_field_size =
true,
2951 bool check_field_size =
false,
2953 bool silence_warnings =
false,
2954 const char *warning_string = NULL,
2955 size_t subfield_offset = 0) { }
2962 size_t actual_field_size =
sizeof(FT),
2964 bool check_field_size =
true,
2966 bool check_field_size =
false,
2968 bool silence_warnings =
false,
2969 const char *warning_string = NULL,
2970 size_t subfield_offset = 0) { }
2975 const Rect<N,COORD_T> &bounds,
2978 size_t actual_field_size =
sizeof(FT),
2980 bool check_field_size =
true,
2982 bool check_field_size =
false,
2984 bool silence_warnings =
false,
2985 const char *warning_string = NULL,
2986 size_t subfield_offset = 0) { }
2995 size_t actual_field_size =
sizeof(FT),
2997 bool check_field_size =
true,
2999 bool check_field_size =
false,
3001 bool silence_warnings =
false,
3002 const char *warning_string = NULL,
3003 size_t subfield_offset = 0) { }
3010 const Rect<N,COORD_T> &bounds,
3013 size_t actual_field_size =
sizeof(FT),
3015 bool check_field_size =
true,
3017 bool check_field_size =
false,
3019 bool silence_warnings =
false,
3020 const char *warning_string = NULL,
3021 size_t subfield_offset = 0) { }
3023 typedef FT value_type;
3024 typedef FT& reference;
3025 typedef const FT& const_reference;
3026 static const int dim = N;
3041 template<
typename REDOP,
bool EXCLUSIVE,
int N,
typename COORD_T = coord_t,
3042 typename A = Realm::GenericAccessor<typename REDOP::RHS,N,COORD_T>,
3043 #ifdef LEGION_BOUNDS_CHECKS
3044 bool CHECK_BOUNDS =
true>
3046 bool CHECK_BOUNDS =
false>
3050 static_assert(N > 0,
"N must be positive");
3051 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3055 ReductionOpID redop,
bool silence_warnings =
false,
3056 const char *warning_string = NULL,
3057 size_t subfield_offset = 0,
3058 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3060 bool check_field_size =
true
3062 bool check_field_size =
false
3070 ReductionOpID redop,
3071 const Rect<N,COORD_T> bounds,
3072 bool silence_warnings =
false,
3073 const char *warning_string = NULL,
3074 size_t subfield_offset = 0,
3075 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3077 bool check_field_size =
true
3079 bool check_field_size =
false
3086 ReductionOpID redop,
3088 bool silence_warnings =
false,
3089 const char *warning_string = NULL,
3090 size_t subfield_offset = 0,
3091 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3093 bool check_field_size =
true
3095 bool check_field_size =
false
3102 ReductionOpID redop,
3104 const Rect<N,COORD_T> bounds,
3105 bool silence_warnings =
false,
3106 const char *warning_string = NULL,
3107 size_t subfield_offset = 0,
3108 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3110 bool check_field_size =
true
3112 bool check_field_size =
false
3119 template<
typename InputIterator>
3121 InputIterator stop_region, FieldID fid,
3122 ReductionOpID redop,
bool silence_warnings =
false,
3123 const char *warning_string = NULL,
3124 size_t subfield_offset = 0,
3125 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3127 bool check_field_size =
true
3129 bool check_field_size =
false
3137 template<
typename InputIterator>
3139 InputIterator stop_region, FieldID fid,
3140 ReductionOpID redop,
3141 const Rect<N,COORD_T> bounds,
3142 bool silence_warnings =
false,
3143 const char *warning_string = NULL,
3144 size_t subfield_offset = 0,
3145 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3147 bool check_field_size =
true
3149 bool check_field_size =
false
3155 template<
typename InputIterator,
int M>
3157 InputIterator stop_region, FieldID fid,
3158 ReductionOpID redop,
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),
3165 bool check_field_size =
true
3167 bool check_field_size =
false
3173 template<
typename InputIterator,
int M>
3175 InputIterator stop_region, FieldID fid,
3176 ReductionOpID redop,
3178 const Rect<N,COORD_T> bounds,
3179 bool silence_warnings =
false,
3180 const char *warning_string = NULL,
3181 size_t subfield_offset = 0,
3182 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3184 bool check_field_size =
true
3186 bool check_field_size =
false
3193 bool silence_warnings =
false,
3194 const char *warning_string = NULL,
3195 size_t subfield_offset = 0,
3196 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3198 bool check_field_size =
true
3200 bool check_field_size =
false
3207 const Rect<N,COORD_T> &bounds,
3208 bool silence_warnings =
false,
3209 const char *warning_string = NULL,
3210 size_t subfield_offset = 0,
3211 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3213 bool check_field_size =
true
3215 bool check_field_size =
false
3222 bool silence_warnings =
false,
3223 const char *warning_string = NULL,
3224 size_t subfield_offset = 0,
3225 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3227 bool check_field_size =
true
3229 bool check_field_size =
false
3236 const Rect<N,COORD_T> &bounds,
3237 bool silence_warnings =
false,
3238 const char *warning_string = NULL,
3239 size_t subfield_offset = 0,
3240 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3242 bool check_field_size =
true
3244 bool check_field_size =
false
3253 bool silence_warnings =
false,
3254 const char *warning_string = NULL,
3255 size_t subfield_offset = 0,
3256 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3258 bool check_field_size =
true
3260 bool check_field_size =
false
3269 const Rect<N,COORD_T> &bounds,
3270 bool silence_warnings =
false,
3271 const char *warning_string = NULL,
3272 size_t subfield_offset = 0,
3273 size_t actual_field_size =
sizeof(
typename REDOP::RHS),
3275 bool check_field_size =
true
3277 bool check_field_size =
false
3281 typedef typename REDOP::RHS value_type;
3282 typedef typename REDOP::RHS& reference;
3283 typedef const typename REDOP::RHS& const_reference;
3284 static const int dim = N;
3309 template<
typename FT,
int N,
typename COORD_T = coord_t,
3310 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
3311 #ifdef LEGION_BOUNDS_CHECKS
3312 bool CHECK_BOUNDS =
true>
3314 bool CHECK_BOUNDS =
false>
3322 size_t actual_field_size =
sizeof(FT),
3324 bool check_field_size =
true,
3326 bool check_field_size =
false,
3328 bool silence_warnings =
false,
3329 const char *warning_string = NULL,
3330 size_t subfield_offset = 0) { }
3333 #ifdef LEGION_MULTI_REGION_ACCESSOR
3367 template<
typename FT,
int N,
typename COORD_T = coord_t,
3368 typename A = Realm::GenericAccessor<FT,N,COORD_T>,
3369 #ifdef LEGION_BOUNDS_CHECKS
3370 bool CHECK_BOUNDS =
true,
3372 bool CHECK_BOUNDS =
false,
3374 #ifdef LEGION_PRIVILEGE_CHECKS
3375 bool CHECK_PRIVILEGES =
true,
3377 bool CHECK_PRIVILEGES =
false,
3382 int MAX_REGIONS = 4>
3383 class MultiRegionAccessor {
3385 static_assert(N > 0,
"N must be positive");
3386 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3388 MultiRegionAccessor(
void) { }
3390 template<
typename InputIterator>
3391 MultiRegionAccessor(InputIterator start, InputIterator stop,
3394 FieldID fid,
size_t actual_field_size =
sizeof(FT),
3396 bool check_field_size =
true,
3398 bool check_field_size =
false,
3400 bool silence_warnings =
false,
3401 const char *warning_string = NULL,
3402 size_t subfield_offset = 0) { }
3404 template<
typename InputIterator>
3405 MultiRegionAccessor(InputIterator start, InputIterator stop,
3406 const Rect<N,COORD_T> bounds, FieldID fid,
3409 size_t actual_field_size =
sizeof(FT),
3411 bool check_field_size =
true,
3413 bool check_field_size =
false,
3415 bool silence_warnings =
false,
3416 const char *warning_string = NULL,
3417 size_t subfield_offset = 0) { }
3419 template<
int M,
typename InputIterator>
3420 MultiRegionAccessor(InputIterator start, InputIterator stop,
3421 const AffineTransform<M,N,COORD_T> transform,
3424 FieldID fid,
size_t actual_field_size =
sizeof(FT),
3426 bool check_field_size =
true,
3428 bool check_field_size =
false,
3430 bool silence_warnings =
false,
3431 const char *warning_string = NULL,
3432 size_t subfield_offset = 0) { }
3434 template<
int M,
typename InputIterator>
3435 MultiRegionAccessor(InputIterator start, InputIterator stop,
3436 const AffineTransform<M,N,COORD_T> transform,
3437 const Rect<N,COORD_T> bounds, FieldID fid,
3440 size_t actual_field_size =
sizeof(FT),
3442 bool check_field_size =
true,
3444 bool check_field_size =
false,
3446 bool silence_warnings =
false,
3447 const char *warning_string = NULL,
3448 size_t subfield_offset = 0) { }
3450 MultiRegionAccessor(
const std::vector<PhysicalRegion> ®ions,
3453 FieldID fid,
size_t actual_field_size =
sizeof(FT),
3455 bool check_field_size =
true,
3457 bool check_field_size =
false,
3459 bool silence_warnings =
false,
3460 const char *warning_string = NULL,
3461 size_t subfield_offset = 0) { }
3463 MultiRegionAccessor(
const std::vector<PhysicalRegion> ®ions,
3464 const Rect<N,COORD_T> bounds, FieldID fid,
3467 size_t actual_field_size =
sizeof(FT),
3469 bool check_field_size =
true,
3471 bool check_field_size =
false,
3473 bool silence_warnings =
false,
3474 const char *warning_string = NULL,
3475 size_t subfield_offset = 0) { }
3478 MultiRegionAccessor(
const std::vector<PhysicalRegion> ®ions,
3479 const AffineTransform<M,N,COORD_T> transform,
3482 FieldID fid,
size_t actual_field_size =
sizeof(FT),
3484 bool check_field_size =
true,
3486 bool check_field_size =
false,
3488 bool silence_warnings =
false,
3489 const char *warning_string = NULL,
3490 size_t subfield_offset = 0) { }
3493 MultiRegionAccessor(
const std::vector<PhysicalRegion> ®ions,
3494 const AffineTransform<M,N,COORD_T> transform,
3495 const Rect<N,COORD_T> bounds, FieldID fid,
3498 size_t actual_field_size =
sizeof(FT),
3500 bool check_field_size =
true,
3502 bool check_field_size =
false,
3504 bool silence_warnings =
false,
3505 const char *warning_string = NULL,
3506 size_t subfield_offset = 0) { }
3508 typedef FT value_type;
3509 typedef FT& reference;
3510 typedef const FT& const_reference;
3511 static const int dim = N;
3544 bool privilege_only =
true,
3545 bool silence_warnings =
false,
3546 const char *warning_string = NULL);
3552 inline bool valid(
void)
const;
3555 inline operator bool(
void)
const;
3556 inline bool operator()(
void)
const;
3557 inline const Domain& operator*(
void)
const;
3558 inline const Domain* operator->(
void)
const;
3566 Internal::PieceIteratorImpl *impl;
3577 template<
int DIM,
typename COORD_T = coord_t>
3580 static_assert(DIM > 0,
"DIM must be positive");
3581 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3587 bool privilege_only,
3588 bool silence_warnings =
false,
3589 const char *warning_string = NULL);
3594 inline bool step(
void);
3595 inline const Rect<DIM,COORD_T>& operator*(
void)
const;
3596 inline const Rect<DIM,COORD_T>* operator->(
void)
const;
3600 Rect<DIM,COORD_T> current_rect;
3612 template<PrivilegeMode PM,
typename FT,
int DIM,
typename COORD_T = coord_t>
3615 static_assert(DIM > 0,
"DIM must be positive");
3616 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3622 size_t actual_field_size =
sizeof(FT),
3624 bool check_field_size =
true,
3626 bool check_field_size =
false,
3629 bool privileges_only =
true,
3630 bool silence_warnings =
false,
3631 const char *warning_string = NULL);
3633 inline bool valid(
void)
const;
3634 inline bool step(
void);
3636 inline operator bool(
void)
const;
3637 inline bool operator()(
void)
const;
3644 Realm::MultiAffineAccessor<FT,DIM,COORD_T> accessor;
3646 Point<DIM,COORD_T> partial_step_point;
3648 int partial_step_dim;
3665 template<
typename T>
3669 size_t alignment = 16);
3672 inline T read(
void)
const;
3674 inline void write(T value)
const;
3676 inline T* ptr(
void)
const;
3678 inline T& ref(
void)
const;
3680 inline operator T(
void)
const;
3684 inline void finalize(Context ctx)
const;
3688 Realm::RegionInstance instance;
3689 Realm::AffineAccessor<T,1,coord_t> accessor;
3701 template<
typename REDOP,
bool EXCLUSIVE=false>
3707 inline void reduce(
typename REDOP::RHS val)
const;
3709 inline void operator<<=(
typename REDOP::RHS val)
const;
3720 const void *initial_value = NULL,
3721 size_t alignment = 16);
3723 Memory::Kind memory_kind = Memory::Z_COPY_MEM,
3724 const void *initial_value = NULL,
3725 size_t alignment = 16);
3726 template<
typename T>
3728 template<
typename REDOP,
bool EXCLUSIVE>
3731 template<
typename T>
3733 template<
typename REDOP,
bool EXCLUSIVE>
3736 void finalize(Context ctx)
const;
3737 Realm::RegionInstance get_instance()
const;
3739 template<PrivilegeMode,
typename,
int,
typename,
typename,
bool>
3741 template<
typename,
bool,
int,
typename,
typename,
bool>
3743 Realm::RegionInstance instance;
3764 template<
typename T,
int DIM,
typename COORD_T = coord_t,
3765 #ifdef LEGION_BOUNDS_CHECKS
3766 bool CHECK_BOUNDS =
true>
3768 bool CHECK_BOUNDS =
false>
3772 static_assert(DIM > 0,
"DIM must be positive");
3773 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3779 const T *initial_value = NULL,
3780 size_t alignment = 16,
3781 bool fortran_order_dims =
false);
3784 const T *initial_value = NULL,
3785 size_t alignment = 16,
3786 bool fortran_order_dims =
false);
3790 const T *initial_value = NULL,
3791 size_t alignment = 16,
3792 bool fortran_order_dims =
false);
3795 const T *initial_value = NULL,
3796 size_t alignment = 16,
3797 bool fortran_order_dims =
false);
3801 std::array<DimensionKind,DIM> ordering,
3802 const T *initial_value = NULL,
3803 size_t alignment = 16);
3806 std::array<DimensionKind,DIM> ordering,
3807 const T *initial_value = NULL,
3808 size_t alignment = 16);
3811 std::array<DimensionKind,DIM> ordering,
3812 const T *initial_value = NULL,
3813 size_t alignment = 16);
3816 std::array<DimensionKind,DIM> ordering,
3817 const T *initial_value = NULL,
3818 size_t alignment = 16);
3820 Memory get_memory_from_kind(Memory::Kind kind);
3821 void initialize_layout(
size_t alignment,
bool fortran_order_dims);
3822 void initialize(Memory memory,
3823 DomainT<DIM,COORD_T> bounds,
3824 const T *initial_value);
3827 inline T read(
const Point<DIM,COORD_T> &p)
const;
3829 inline void write(
const Point<DIM,COORD_T> &p, T value)
const;
3831 inline T* ptr(
const Point<DIM,COORD_T> &p)
const;
3833 inline T* ptr(
const Rect<DIM,COORD_T> &r)
const;
3835 inline T* ptr(
const Rect<DIM,COORD_T> &r,
size_t strides[DIM])
const;
3837 inline T& operator[](
const Point<DIM,COORD_T> &p)
const;
3840 Realm::RegionInstance get_instance()
const;
3844 Realm::RegionInstance instance;
3845 Realm::AffineAccessor<T,DIM,COORD_T> accessor;
3846 std::array<DimensionKind,DIM> ordering;
3848 #ifdef LEGION_BOUNDS_CHECKS
3849 DomainT<DIM,COORD_T> bounds;
3859 template<
typename COORD_T = coord_t>
3862 static_assert(std::is_integral<COORD_T>::value,
"must be integral type");
3869 const void *initial_value = NULL,
3870 size_t alignment = 16,
3871 bool fortran_order_dims =
false);
3875 const void *initial_value = NULL,
3876 size_t alignment = 16,
3877 bool fortran_order_dims =
false);
3882 const void *initial_value = NULL,
3883 size_t alignment = 16,
3884 bool fortran_order_dims =
false);
3888 const void *initial_value = NULL,
3889 size_t alignment = 16,
3890 bool fortran_order_dims =
false);
3892 template<
typename T,
int DIM>
3895 template<
typename T,
int DIM,
bool BC>
3898 inline void destroy(
void);
3899 inline Realm::RegionInstance get_instance(
void)
const {
return instance; }
3901 template<PrivilegeMode,
typename,
int,
typename,
typename,
bool>
3903 template<
typename,
bool,
int,
typename,
typename,
bool>
3905 Realm::RegionInstance instance;
3922 Internal::OutputRegionImpl *impl;
3924 FRIEND_ALL_RUNTIME_CLASSES
3925 explicit OutputRegion(Internal::OutputRegionImpl *impl);
3929 Memory target_memory(
void)
const;
3934 bool is_valid_output_region(
void)
const;
3941 template<
typename T,
3943 typename COORD_T = coord_t,
3944 #ifdef LEGION_BOUNDS_CHECKS
3945 bool CHECK_BOUNDS =
true>
3947 bool CHECK_BOUNDS =
false>
3950 create_buffer(
const Point<DIM, COORD_T> &extents,
3952 const T *initial_value = NULL,
3953 bool return_buffer =
false);
3955 void check_type_tag(TypeTag type_tag)
const;
3956 void check_field_size(FieldID field_id,
size_t field_size)
const;
3957 void get_layout(FieldID field_id,
3958 std::vector<DimensionKind> &ordering,
3959 size_t &alignment)
const;
3961 template<
typename T,
3963 typename COORD_T = coord_t,
3964 #ifdef LEGION_BOUNDS_CHECKS
3965 bool CHECK_BOUNDS =
true>
3967 bool CHECK_BOUNDS =
false>
3969 void return_data(
const Point<DIM,COORD_T> &extents,
3974 Realm::RegionInstance instance,
3975 bool check_constraints =
true);
3979 Realm::RegionInstance instance,
3980 const LayoutConstraintSet *constraints,
3981 bool check_constraints);
4005 MapperID
id = 0, MappingTagID tag = 0,
4007 const char *provenance =
"");
4009 inline void add_field(FieldID f);
4010 inline void add_grant(
Grant g);
4018 std::set<FieldID> fields;
4023 std::vector<Grant> grants;
4024 std::vector<PhaseBarrier> wait_barriers;
4025 std::vector<PhaseBarrier> arrive_barriers;
4032 std::string provenance;
4036 const std::vector<StaticDependence> *static_dependences;
4038 bool silence_warnings;
4053 MapperID
id = 0, MappingTagID tag = 0,
4055 const char *provenance =
"");
4057 inline void add_field(FieldID f);
4058 inline void add_grant(
Grant g);
4066 std::set<FieldID> fields;
4071 std::vector<Grant> grants;
4072 std::vector<PhaseBarrier> wait_barriers;
4073 std::vector<PhaseBarrier> arrive_barriers;
4080 std::string provenance;
4084 const std::vector<StaticDependence> *static_dependences;
4086 bool silence_warnings;
4110 inline void add_single_task(
const DomainPoint &point,
4115 MappingTagID mapping_tag;
4116 std::vector<TaskLauncher> single_tasks;
4117 std::vector<IndexTaskLauncher> index_tasks;
4126 std::string provenance;
4128 bool silence_warnings;
4151 Internal::LegionHandshakeImpl *impl;
4154 FRIEND_ALL_RUNTIME_CLASSES
4158 {
return impl == h.impl; }
4160 {
return impl < h.impl; }
4217 FRIEND_ALL_RUNTIME_CLASSES
4221 {
return impl == h.impl; }
4223 {
return impl < h.impl; }
4264 virtual UniqueID get_unique_id(
void)
const = 0;
4268 virtual uint64_t get_context_index(
void)
const = 0;
4270 virtual int get_depth(
void)
const = 0;
4272 virtual const Task* get_parent_task(
void)
const = 0;
4276 virtual const std::string& get_provenance_string(
4277 bool human =
true)
const = 0;
4279 virtual MappableType get_mappable_type(
void)
const = 0;
4280 virtual const Task* as_task(
void)
const {
return NULL; }
4281 virtual const Copy* as_copy(
void)
const {
return NULL; }
4282 virtual const InlineMapping* as_inline(
void)
const {
return NULL; }
4283 virtual const Acquire* as_acquire(
void)
const {
return NULL; }
4284 virtual const Release* as_release(
void)
const {
return NULL; }
4285 virtual const Close* as_close(
void)
const {
return NULL; }
4286 virtual const Fill* as_fill(
void)
const {
return NULL; }
4287 virtual const Partition* as_partition(
void)
const {
return NULL; }
4288 virtual const MustEpoch* as_must_epoch(
void)
const {
return NULL; }
4296 mutable const Task* parent_task;
4300 size_t mapper_data_size;
4307 typedef Legion::MappableType MappableType;
4309 static const MappableType TASK_MAPPABLE = ::LEGION_TASK_MAPPABLE;
4310 static const MappableType COPY_MAPPABLE = ::LEGION_COPY_MAPPABLE;
4311 static const MappableType INLINE_MAPPABLE = ::LEGION_INLINE_MAPPABLE;
4312 static const MappableType ACQUIRE_MAPPABLE = ::LEGION_ACQUIRE_MAPPABLE;
4313 static const MappableType RELEASE_MAPPABLE = ::LEGION_RELEASE_MAPPABLE;
4314 static const MappableType CLOSE_MAPPABLE = ::LEGION_CLOSE_MAPPABLE;
4315 static const MappableType FILL_MAPPABLE = ::LEGION_FILL_MAPPABLE;
4316 static const MappableType PARTITION_MAPPABLE =
4317 ::LEGION_PARTITION_MAPPABLE;
4318 static const MappableType MUST_EPOCH_MAPPABLE =
4319 ::LEGION_MUST_EPOCH_MAPPABLE;
4335 virtual bool has_parent_task(
void)
const = 0;
4337 virtual const char* get_task_name(
void)
const = 0;
4341 virtual Domain get_slice_domain(
void)
const = 0;
4355 virtual ShardID get_shard_id(
void)
const = 0;
4356 virtual size_t get_total_shards(
void)
const = 0;
4357 virtual DomainPoint get_shard_point(
void)
const = 0;
4358 virtual Domain get_shard_domain(
void)
const = 0;
4360 virtual MappableType get_mappable_type(
void)
const
4361 {
return LEGION_TASK_MAPPABLE; }
4362 virtual const Task* as_task(
void)
const {
return this; }
4366 std::vector<IndexSpaceRequirement> indexes;
4367 std::vector<RegionRequirement> regions;
4368 std::vector<OutputRequirement> output_regions;
4369 std::vector<Future> futures;
4370 std::vector<Grant> grants;
4371 std::vector<PhaseBarrier> wait_barriers;
4372 std::vector<PhaseBarrier> arrive_barriers;
4377 bool is_index_space;
4378 bool concurrent_task;
4379 bool must_epoch_task;
4384 size_t local_arglen;
4387 Processor orig_proc;
4388 Processor current_proc;
4389 Processor target_proc;
4390 unsigned steal_count;
4393 bool local_function;
4405 virtual MappableType get_mappable_type(
void)
const
4406 {
return LEGION_COPY_MAPPABLE; }
4407 virtual const Copy* as_copy(
void)
const {
return this; }
4410 std::vector<RegionRequirement> src_requirements;
4411 std::vector<RegionRequirement> dst_requirements;
4412 std::vector<RegionRequirement> src_indirect_requirements;
4413 std::vector<RegionRequirement> dst_indirect_requirements;
4414 std::vector<Grant> grants;
4415 std::vector<PhaseBarrier> wait_barriers;
4416 std::vector<PhaseBarrier> arrive_barriers;
4419 bool is_index_space;
4434 virtual MappableType get_mappable_type(
void)
const
4435 {
return LEGION_INLINE_MAPPABLE; }
4436 virtual const InlineMapping* as_inline(
void)
const {
return this; }
4437 virtual ShardID get_parent_shard(
void)
const {
return 0; }
4441 std::vector<Grant> grants;
4442 std::vector<PhaseBarrier> wait_barriers;
4443 std::vector<PhaseBarrier> arrive_barriers;
4444 LayoutConstraintID layout_constraint_id;
4456 virtual MappableType get_mappable_type(
void)
const
4457 {
return LEGION_ACQUIRE_MAPPABLE; }
4458 virtual const Acquire* as_acquire(
void)
const {
return this; }
4463 std::set<FieldID> fields;
4464 std::vector<Grant> grants;
4465 std::vector<PhaseBarrier> wait_barriers;
4466 std::vector<PhaseBarrier> arrive_barriers;
4478 virtual MappableType get_mappable_type(
void)
const
4479 {
return LEGION_RELEASE_MAPPABLE; }
4480 virtual const Release* as_release(
void)
const {
return this; }
4485 std::set<FieldID> fields;
4486 std::vector<Grant> grants;
4487 std::vector<PhaseBarrier> wait_barriers;
4488 std::vector<PhaseBarrier> arrive_barriers;
4504 virtual MappableType get_mappable_type(
void)
const
4505 {
return LEGION_CLOSE_MAPPABLE; }
4506 virtual const Close* as_close(
void)
const {
return this; }
4522 virtual MappableType get_mappable_type(
void)
const
4523 {
return LEGION_FILL_MAPPABLE; }
4524 virtual const Fill* as_fill(
void)
const {
return this; }
4528 std::vector<Grant> grants;
4529 std::vector<PhaseBarrier> wait_barriers;
4530 std::vector<PhaseBarrier> arrive_barriers;
4533 bool is_index_space;
4550 virtual MappableType get_mappable_type(
void)
const
4551 {
return LEGION_PARTITION_MAPPABLE; }
4552 virtual const Partition* as_partition(
void)
const {
return this; }
4554 enum PartitionKind {
4562 virtual PartitionKind get_partition_kind(
void)
const = 0;
4568 bool is_index_space;
4583 virtual MappableType get_mappable_type(
void)
const
4584 {
return LEGION_MUST_EPOCH_MAPPABLE; }
4585 virtual const MustEpoch* as_must_epoch(
void)
const {
return this; }
4587 std::vector<const Task*> individual_tasks;
4588 std::vector<const Task*> index_space_tasks;
4617 std::set<Processor> local_procs;
4637 bool idempotent =
false);
4710 const Domain &launch_domain);
4724 const Domain &launch_domain);
4740 const Domain &launch_domain,
4741 const void *args,
size_t size);
4757 const Domain &launch_domain,
4758 const void *args,
size_t size);
4771 LEGION_DEPRECATED(
"The interface for projection functors has been "
4772 "updated. Please use the new 'project' methods.")
4788 LEGION_DEPRECATED("The interface for projection functors has been "
4789 "updated. Please use the new 'project' methods.")
4804 const
Domain &launch_domain,
4807 const
Domain &launch_domain,
4833 const
Domain &launch_domain);
4835 const
Domain &launch_domain);
4836 virtual
bool is_complete(
Mappable *mappable,
unsigned index,
4838 virtual
bool is_complete(
Mappable *mappable,
unsigned index,
4848 virtual
bool is_exclusive(
void)
const {
return false; }
4856 virtual bool is_functional(
void)
const {
return false; }
4878 friend class Internal::Runtime;
4881 inline void set_runtime(
Runtime *rt) { runtime = rt; }
4906 virtual bool use_points(
void)
const {
return false; }
4909 virtual ShardID shard(
const DomainPoint &index_point,
4910 const Domain &index_domain,
4911 const size_t total_shards);
4914 const Domain &index_domain,
4915 const std::vector<DomainPoint> &shard_points,
4916 const Domain &shard_domain);
4918 virtual bool is_invertible(
void)
const {
return false; }
4920 virtual void invert(ShardID shard,
4921 const Domain &sharding_domain,
4922 const Domain &index_domain,
4923 const size_t total_shards,
4924 std::vector<DomainPoint> &points);
4926 virtual void invert_points(
const DomainPoint &shard_point,
4927 const std::vector<DomainPoint> &shard_points,
4928 const Domain &shard_domain,
4929 const Domain &index_domain,
4930 const Domain &sharding_domain,
4931 std::vector<DomainPoint> &index_points);
4953 virtual const void* callback_get_future(
size_t &size,
bool &owned,
4954 const Realm::ExternalInstanceResource *&resource,
4955 void (*&freefunc)(
const Realm::ExternalInstanceResource&),
4956 const void *&metadata,
size_t &metasize) = 0;
4957 virtual void callback_release_future(
void) = 0;
4972 virtual bool is_invertible(
void)
const {
return false; }
4976 const Domain &range) = 0;
5012 friend class Internal::Runtime;
5014 Runtime(Internal::Runtime *rt);
5032 TypeTag type_tag = 0,
5033 const char *provenance = NULL);
5035 template<
int DIM,
typename COORD_T>
5037 const Rect<DIM,COORD_T> &bounds,
5038 const char *provenance = NULL);
5039 template<
int DIM,
typename COORD_T>
5041 const DomainT<DIM,COORD_T> &bounds,
5042 const char *provenance = NULL);
5059 const Future &f, TypeTag type_tag = 0,
5060 const char *provenance = NULL);
5061 template<
int DIM,
typename COORD_T>
5063 const char *provenance = NULL);
5075 const std::vector<DomainPoint> &points,
5076 const char *provenance = NULL);
5078 template<
int DIM,
typename COORD_T>
5080 const std::vector<Point<DIM,COORD_T> > &points,
5081 const char *provenance = NULL);
5093 const std::vector<Domain> &rects,
5094 const char *provenance = NULL);
5096 template<
int DIM,
typename COORD_T>
5098 const std::vector<Rect<DIM,COORD_T> > &rects,
5099 const char *provenance = NULL);
5112 const std::vector<IndexSpace> &spaces,
5113 const char *provenance = NULL);
5115 template<
int DIM,
typename COORD_T>
5118 const char *provenance = NULL);
5131 const std::vector<IndexSpace> &spaces,
5132 const char *provenance = NULL);
5134 template<
int DIM,
typename COORD_T>
5137 const char *provenance = NULL);
5148 const char *provenance = NULL);
5150 template<
int DIM,
typename COORD_T>
5153 const char *provenance = NULL);
5162 LEGION_DEPRECATED(
"Use the new index space creation routines with a "
5163 "single domain or rectangle.")
5164 IndexSpace create_index_space(Context ctx,
size_t max_num_elmts);
5172 LEGION_DEPRECATED("Use the new index space creation routines with a "
5173 "single domain or rectangle.")
5175 const std::set<
Domain> &domains);
5198 const
bool unordered = false,
5199 const
bool recurse = true,
5200 const
char *provenance = NULL);
5224 const
bool unordered = false,
5225 const
bool recurse = true,
5226 const
char *provenance = NULL);
5254 size_t granularity = 1,
5256 LEGION_AUTO_GENERATE_ID,
5257 const
char *provenance = NULL);
5258 template<
int DIM, typename COORD_T,
5259 int COLOR_DIM, typename COLOR_COORD_T>
5263 size_t granularity = 1,
5264 Color color = LEGION_AUTO_GENERATE_ID,
5265 const
char *provenance = NULL);
5288 size_t granularity = 1,
5289 Color color = LEGION_AUTO_GENERATE_ID,
5290 const
char *provenance = NULL);
5291 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5294 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,
int> &weights,
5296 size_t granularity = 1,
5297 Color color = LEGION_AUTO_GENERATE_ID,
5298 const
char *provenance = NULL);
5303 size_t granularity = 1,
5304 Color color = LEGION_AUTO_GENERATE_ID,
5305 const
char *provenance = NULL);
5306 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5309 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,
size_t> &weights,
5311 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
5312 const
char *provenance = NULL);
5319 size_t granularity = 1,
5321 LEGION_AUTO_GENERATE_ID,
5322 const
char *provenance = NULL);
5323 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5328 size_t granularity = 1,
5329 Color color = LEGION_AUTO_GENERATE_ID,
5330 const
char *provenance = NULL);
5362 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5363 Color color = LEGION_AUTO_GENERATE_ID,
5364 const
char *provenance = NULL);
5365 template<
int DIM, typename COORD_T,
5366 int COLOR_DIM, typename COLOR_COORD_T>
5372 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5373 Color color = LEGION_AUTO_GENERATE_ID,
5374 const
char *provenance = NULL);
5407 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5408 Color color = LEGION_AUTO_GENERATE_ID,
5409 const
char *provenance = NULL);
5410 template<
int DIM, typename COORD_T,
5411 int COLOR_DIM, typename COLOR_COORD_T>
5418 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5419 Color color = LEGION_AUTO_GENERATE_ID,
5420 const
char *provenance = NULL);
5446 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5447 Color color = LEGION_AUTO_GENERATE_ID,
5448 bool dominates = false,
5449 const
char *provenance = NULL);
5450 template<
int DIM, typename COORD_T>
5451 IndexPartitionT<DIM,COORD_T> create_partition_by_intersection(Context ctx,
5454 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5455 Color color = LEGION_AUTO_GENERATE_ID,
5456 bool dominates = false,
5457 const
char *provenance = NULL);
5490 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5491 Color color = LEGION_AUTO_GENERATE_ID,
5492 const
char *provenance = NULL);
5493 template<
int DIM, typename COORD_T,
5494 int COLOR_DIM, typename COLOR_COORD_T>
5495 IndexPartitionT<DIM,COORD_T> create_partition_by_difference(Context ctx,
5500 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5501 Color color = LEGION_AUTO_GENERATE_ID,
5502 const
char *provenance = NULL);
5530 Color create_cross_product_partitions(Context ctx,
5534 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5535 Color color = LEGION_AUTO_GENERATE_ID,
5536 const
char *provenance = NULL);
5537 template<
int DIM, typename COORD_T,
5538 int COLOR_DIM, typename COLOR_COORD_T>
5539 Color create_cross_product_partitions(Context ctx,
5545 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5546 Color color = LEGION_AUTO_GENERATE_ID,
5547 const
char *provenance = NULL);
5574 void create_association(Context ctx,
5580 MappingTagID tag = 0,
5582 const
char *provenance = NULL);
5583 void create_bidirectional_association(Context ctx,
5591 MappingTagID tag = 0,
5594 const
char *provenance = NULL);
5596 template<
int DIM1, typename COORD_T1,
int DIM2, typename COORD_T2>
5597 void create_association(Context ctx,
5603 MappingTagID tag = 0,
5605 const
char *provenance = NULL);
5606 template<
int DIM1, typename COORD_T1,
int DIM2, typename COORD_T2>
5607 void create_bidirectional_association(Context ctx,
5615 MappingTagID tag = 0,
5617 const
char *provenance = NULL);
5650 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5651 Color color = LEGION_AUTO_GENERATE_ID,
5652 const
char *provenance = NULL);
5654 template<
int DIM,
int COLOR_DIM, typename COORD_T>
5655 IndexPartitionT<DIM,COORD_T> create_partition_by_restriction(Context ctx,
5658 Transform<DIM,COLOR_DIM,COORD_T> transform,
5659 Rect<DIM,COORD_T> extent,
5660 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5661 Color color = LEGION_AUTO_GENERATE_ID,
5662 const
char *provenance = NULL);
5683 Color color = LEGION_AUTO_GENERATE_ID,
5684 const
char *provenance = NULL);
5686 template<
int DIM, typename COORD_T>
5687 IndexPartitionT<DIM,COORD_T> create_partition_by_blockify(Context ctx,
5689 Point<DIM,COORD_T> blocking_factor,
5690 Color color = LEGION_AUTO_GENERATE_ID,
5691 const
char *provenance = NULL);
5708 Color color = LEGION_AUTO_GENERATE_ID,
5709 const
char *provenance = NULL);
5711 template<
int DIM, typename COORD_T>
5712 IndexPartitionT<DIM,COORD_T> create_partition_by_blockify(Context ctx,
5714 Point<DIM,COORD_T> blocking_factor,
5715 Point<DIM,COORD_T> origin,
5716 Color color = LEGION_AUTO_GENERATE_ID,
5717 const
char *provenance = NULL);
5744 bool perform_intersections = true,
5745 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5746 Color color = LEGION_AUTO_GENERATE_ID,
5747 const
char *provenance = NULL);
5748 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5752 Point<COLOR_DIM,COLOR_COORD_T>,
5753 DomainT<DIM,COORD_T> > &domains,
5755 COLOR_COORD_T> color_space,
5756 bool perform_intersections = true,
5757 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5758 Color color = LEGION_AUTO_GENERATE_ID,
5759 const
char *provenance = NULL);
5781 bool perform_intersections = true,
5782 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5783 Color color = LEGION_AUTO_GENERATE_ID,
5784 const
char *provenance = NULL);
5785 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5790 COLOR_COORD_T> color_space,
5791 bool perform_intersections = true,
5792 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5793 Color color = LEGION_AUTO_GENERATE_ID,
5794 const
char *provenance = NULL);
5814 template<
int DIM, typename COORD_T,
int COLOR_DIM, typename COLOR_COORD_T>
5817 const std::map<Point<COLOR_DIM,COLOR_COORD_T>,
5818 std::vector<Rect<DIM,COORD_T> > > &rectangles,
5820 COLOR_COORD_T> color_space,
5821 bool perform_intersections = true,
5822 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5823 Color color = LEGION_AUTO_GENERATE_ID,
5824 const
char *provenance = NULL,
5825 bool collective = false);
5862 LEGION_AUTO_GENERATE_ID,
5864 MappingTagID tag = 0,
5865 PartitionKind part_kind =
5866 LEGION_DISJOINT_KIND,
5869 const
char *provenance = NULL);
5870 template<
int DIM, typename COORD_T,
5871 int COLOR_DIM, typename COLOR_COORD_T>
5877 Color color = LEGION_AUTO_GENERATE_ID,
5878 MapperID
id = 0, MappingTagID tag = 0,
5879 PartitionKind part_kind = LEGION_DISJOINT_KIND,
5881 const
char *provenance = NULL);
5923 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5924 Color color = LEGION_AUTO_GENERATE_ID,
5925 MapperID
id = 0, MappingTagID tag = 0,
5927 const
char *provenance = NULL);
5928 template<
int DIM1, typename COORD_T1,
5929 int DIM2, typename COORD_T2,
5930 int COLOR_DIM, typename COLOR_COORD_T>
5937 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5938 Color color = LEGION_AUTO_GENERATE_ID,
5939 MapperID
id = 0, MappingTagID tag = 0,
5941 const
char *provenance = NULL);
5949 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5950 Color color = LEGION_AUTO_GENERATE_ID,
5951 MapperID
id = 0, MappingTagID tag = 0,
5953 const
char *provenance = NULL);
5954 template<
int DIM1, typename COORD_T1,
5955 int DIM2, typename COORD_T2,
5956 int COLOR_DIM, typename COLOR_COORD_T>
5964 PartitionKind part_kind = LEGION_COMPUTE_KIND,
5965 Color color = LEGION_AUTO_GENERATE_ID,
5966 MapperID
id = 0, MappingTagID tag = 0,
5968 const
char *provenance = NULL);
6007 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6008 Color color = LEGION_AUTO_GENERATE_ID,
6009 MapperID
id = 0, MappingTagID tag = 0,
6011 const
char *provenance = NULL);
6012 template<
int DIM1, typename COORD_T1,
6013 int DIM2, typename COORD_T2,
6014 int COLOR_DIM, typename COLOR_COORD_T>
6015 IndexPartitionT<DIM1,COORD_T1> create_partition_by_preimage(Context ctx,
6021 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6022 Color color = LEGION_AUTO_GENERATE_ID,
6023 MapperID
id = 0, MappingTagID tag = 0,
6025 const
char *provenance = NULL);
6033 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6034 Color color = LEGION_AUTO_GENERATE_ID,
6035 MapperID
id = 0, MappingTagID tag = 0,
6037 const
char *provenance = NULL);
6038 template<
int DIM1, typename COORD_T1,
6039 int DIM2, typename COORD_T2,
6040 int COLOR_DIM, typename COLOR_COORD_T>
6048 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6049 Color color = LEGION_AUTO_GENERATE_ID,
6050 MapperID
id = 0, MappingTagID tag = 0,
6052 const
char *provenance = NULL);
6088 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6089 Color color = LEGION_AUTO_GENERATE_ID,
6090 const
char *provenance = NULL);
6091 template<
int DIM, typename COORD_T,
6092 int COLOR_DIM, typename COLOR_COORD_T>
6096 PartitionKind part_kind = LEGION_COMPUTE_KIND,
6097 Color color = LEGION_AUTO_GENERATE_ID,
6098 const
char *provenance = NULL);
6120 const
char *provenance = NULL);
6121 template<
int DIM, typename COORD_T,
6122 int COLOR_DIM, typename COLOR_COORD_T>
6123 IndexSpaceT<DIM,COORD_T> create_index_space_union(Context ctx,
6125 Point<COLOR_DIM,COLOR_COORD_T> color,
6126 const typename std::vector<
6128 const
char *provenance = NULL);
6147 const
char *provenance = NULL);
6148 template<
int DIM, typename COORD_T,
6149 int COLOR_DIM, typename COLOR_COORD_T>
6150 IndexSpaceT<DIM,COORD_T> create_index_space_union(Context ctx,
6152 Point<COLOR_DIM,COLOR_COORD_T> color,
6154 const
char *provenance = NULL);
6177 const
char *provenance = NULL);
6178 template<
int DIM, typename COORD_T,
6179 int COLOR_DIM, typename COLOR_COORD_T>
6180 IndexSpaceT<DIM,COORD_T> create_index_space_intersection(Context ctx,
6182 Point<COLOR_DIM,COLOR_COORD_T> color,
6183 const typename std::vector<
6185 const
char *provenance = NULL);
6205 const
char *provenannce=NULL);
6206 template<
int DIM, typename COORD_T,
6207 int COLOR_DIM, typename COLOR_COORD_T>
6208 IndexSpaceT<DIM,COORD_T> create_index_space_intersection(Context ctx,
6210 Point<COLOR_DIM,COLOR_COORD_T> color,
6212 const
char *provenance = NULL);
6241 const
char *provenancne = NULL);
6242 template<
int DIM, typename COORD_T,
6243 int COLOR_DIM, typename COLOR_COORD_T>
6244 IndexSpaceT<DIM,COORD_T> create_index_space_difference(Context ctx,
6246 Point<COLOR_DIM,COLOR_COORD_T> color,
6248 const typename std::vector<
6250 const
char *provenance = NULL);
6274 template<
int DIM, typename COORD_T>
6289 bool has_index_partition(Context ctx,
IndexSpace parent, Color color);
6290 bool has_index_partition(Context ctx,
IndexSpace parent,
6293 bool has_index_partition(
IndexSpace parent, Color color);
6297 template<
int DIM, typename COORD_T>
6298 bool has_index_partition(
IndexSpaceT<DIM,COORD_T> parent, Color color);
6319 template<
int DIM, typename COORD_T,
6320 int COLOR_DIM, typename COLOR_COORD_T>
6323 Point<COLOR_DIM,COLOR_COORD_T> color);
6341 template<
int DIM, typename COORD_T,
6342 int COLOR_DIM, typename COLOR_COORD_T>
6344 Point<COLOR_DIM,COLOR_COORD_T> color);
6358 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6361 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6362 bool has_multiple_domains(
IndexSpace handle);
6377 template<
int DIM, typename COORD_T>
6378 DomainT<DIM,COORD_T> get_index_space_domain(
6393 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6395 std::vector<
Domain> &domains);
6397 LEGION_DEPRECATED("Multiple domains are no longer supported.")
6398 void get_index_space_domains(
IndexSpace handle,
6399 std::vector<
Domain> &domains);
6414 template<
int DIM, typename COORD_T,
6415 int COLOR_DIM, typename COLOR_COORD_T>
6416 DomainT<COLOR_DIM,COLOR_COORD_T>
6432 template<
int DIM, typename COORD_T,
6433 int COLOR_DIM, typename COLOR_COORD_T>
6448 void get_index_space_partition_colors(Context ctx,
IndexSpace sp,
6449 std::set<Color> &colors);
6450 void get_index_space_partition_colors(Context ctx,
IndexSpace sp,
6453 void get_index_space_partition_colors(
IndexSpace sp,
6454 std::set<Color> &colors);
6455 void get_index_space_partition_colors(
IndexSpace sp,
6495 Color get_index_space_color(
IndexSpace handle);
6498 template<
int DIM, typename COORD_T,
6499 int COLOR_DIM, typename COLOR_COORD_T>
6500 Point<COLOR_DIM,COLOR_COORD_T>
6501 get_index_space_color(
IndexSpaceT<DIM,COORD_T> handle);
6513 DomainPoint get_index_partition_color_point(Context ctx,
6531 template<
int DIM, typename COORD_T>
6545 bool has_parent_index_partition(
IndexSpace handle);
6560 template<
int DIM, typename COORD_T>
6574 unsigned get_index_space_depth(
IndexSpace handle);
6612 template<
int DIM, typename COORD_T>
6613 bool safe_cast(Context ctx,
6614 Point<DIM,COORD_T> point,
6627 FieldSpace create_field_space(Context ctx, const
char *provenance = NULL);
6640 const std::vector<
size_t> &field_sizes,
6641 std::vector<FieldID> &resulting_fields,
6642 CustomSerdezID serdez_id = 0,
6643 const
char *provenance = NULL);
6656 const std::vector<
Future> &field_sizes,
6657 std::vector<FieldID> &resulting_fields,
6658 CustomSerdezID serdez_id = 0,
6659 const
char *provenance = NULL);
6681 const
bool unordered = false,
6682 const
char *provenance = NULL);
6692 size_t get_field_size(Context ctx,
FieldSpace handle, FieldID fid);
6694 size_t get_field_size(
FieldSpace handle, FieldID fid);
6705 std::vector<FieldID> &fields);
6707 void get_field_space_fields(
FieldSpace handle,
6708 std::vector<FieldID> &fields);
6719 std::set<FieldID> &fields);
6721 void get_field_space_fields(
FieldSpace handle,
6722 std::set<FieldID> &fields);
6743 bool task_local = false,
6744 const
char *provenance = NULL);
6746 template<
int DIM, typename COORD_T>
6750 bool task_local = false,
6751 const
char *provenance = NULL);
6773 const
bool unordered = false,
6774 const
char *provenance = NULL);
6783 LEGION_DEPRECATED("Destruction of logical partitions are no-ops now."
6784 "Logical partitions are automatically destroyed when their root "
6785 "logical region or their index spartition are destroyed.")
6787 const
bool unordered = false);
6809 const std::set<FieldID> &fields);
6830 template<
int DIM, typename COORD_T>
6857 template<
int DIM, typename COORD_T>
6872 bool has_logical_partition_by_color(Context ctx,
6899 template<
int DIM, typename COORD_T>
6921 template<
int DIM, typename COORD_T>
6948 template<
int DIM, typename COORD_T,
6949 int COLOR_DIM, typename COLOR_COORD_T>
6952 Point<COLOR_DIM,COLOR_COORD_T> color);
6964 bool has_logical_subregion_by_color(Context ctx,
6971 template<
int DIM, typename COORD_T,
6972 int COLOR_DIM, typename COLOR_COORD_T>
6974 Point<COLOR_DIM,COLOR_COORD_T> color);
6996 template<
int DIM, typename COORD_T>
7012 DomainPoint get_logical_region_color_point(Context ctx,
7018 template<
int DIM, typename COORD_T,
7019 int COLOR_DIM, typename COLOR_COORD_T>
7020 Point<COLOR_DIM,COLOR_COORD_T>
7021 get_logical_region_color_point(
LogicalRegionT<DIM,COORD_T> handle);
7033 DomainPoint get_logical_partition_color_point(Context ctx,
7052 template<
int DIM, typename COORD_T>
7081 template<
int DIM, typename COORD_T>
7105 LEGION_DEPRECATED("
ArgumentMap can be constructed directly.")
7162 ReductionOpID redop,
bool ordered = true,
7189 ReductionOpID redop,
bool ordered = true,
7190 MapperID map_id = 0, MappingTagID tag = 0,
7191 const
char *provenance = NULL,
7223 bool collective = false, ShardingID sid = 0,
7224 bool implicit_sharding = false,
7225 const
char *provenance = NULL);
7226 LEGION_DEPRECATED("Use the version that takes an
IndexSpace instead")
7229 bool collective = false, ShardingID sid = 0,
7230 bool implicit_sharding = false);
7257 bool collective = false, ShardingID sid = 0,
7258 bool implicit_sharding = false,
7259 const
char *provenance = NULL);
7260 LEGION_DEPRECATED("Use the version that takes an
IndexSpace instead")
7263 bool collective = false, ShardingID sid = 0,
7264 bool implicit_sharding = false);
7288 PointTransformFnptr fnptr,
7289 const
char *provenance = NULL);
7310 bool take_ownership = false,
7311 const
char *provenance = NULL);
7328 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7329 "launcher interface.")
7330 Future execute_task(Context ctx, TaskID task_id,
7337 MappingTagID tag = 0);
7357 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7358 "launcher interface.")
7367 bool must_paralleism = false,
7369 MappingTagID tag = 0);
7392 LEGION_DEPRECATED("Launching tasks should be done with the new task "
7393 "launcher interface.")
7394 Future execute_index_space(Context ctx, TaskID task_id,
7401 ReductionOpID reduction,
7404 bool must_parallelism = false,
7406 MappingTagID tag = 0);
7436 MapperID
id = 0, MappingTagID tag = 0,
7437 const
char *provenance = NULL);
7451 MapperID
id = 0, MappingTagID tag = 0,
7452 const
char *provenance = NULL);
7464 const
char *provenance = NULL);
7482 void unmap_all_regions(Context ctx);
7518 template<typename T>
7520 FieldID fid, const T &value,
7537 FieldID fid, const
void *value,
size_t value_size,
7566 template<typename T>
7568 const std::set<FieldID> &fields, const T &value,
7584 const std::set<FieldID> &fields,
7585 const
void *value,
size_t value_size,
7599 const std::set<FieldID> &fields,
7650 const
bool flush = true,
7651 const
bool unordered = false,
7652 const
char *provenance = NULL);
7687 const
bool flush = true,
7688 const
bool unordered = false,
7689 const
char *provenance = NULL);
7697 void progress_unordered_operations(Context ctx);
7729 LEGION_DEPRECATED("Attaching specific HDF5 file type is deprecated "
7730 "in favor of generic attach launcher interface.")
7733 const std::map<FieldID,const
char*> &field_map,
7734 LegionFileMode mode);
7752 LEGION_DEPRECATED("Detaching specific HDF5 file type is deprecated "
7753 "in favor of generic detach interface.")
7762 LEGION_DEPRECATED("Attaching generic file type is deprecated "
7763 "in favor of generic attach launcher interface.")
7766 const std::vector<FieldID> &field_vec,
7767 LegionFileMode mode);
7774 LEGION_DEPRECATED("Detaching generic file type is deprecated "
7775 "in favor of generic detach interface.")
7812 const
char *provenance = NULL);
7824 const
char *provenance = NULL);
7838 const
char *provenance = NULL);
7852 const
char *provenance = NULL);
7871 const
char *provenance = NULL);
7893 void destroy_lock(Context ctx,
Lock l);
7919 void release_grant(Context ctx,
Grant grant);
7983 ReductionOpID redop,
7984 const
void *init_value,
8004 void arrive_dynamic_collective(Context ctx,
8007 size_t size,
unsigned count = 1);
8018 void defer_dynamic_collective_arrival(Context ctx,
8021 unsigned count = 1);
8034 const
char *provenance = NULL);
8077 Future issue_mapping_fence(Context ctx, const
char *provenance = NULL);
8088 Future issue_execution_fence(Context ctx, const
char *provenance = NULL);
8122 void begin_trace(Context ctx, TraceID tid,
bool logical_only = false,
8123 bool static_trace = false, const std::set<RegionTreeID> *managed = NULL,
8124 const
char *provenance = NULL);
8128 void end_trace(Context ctx, TraceID tid, const
char *provenance = NULL);
8143 LEGION_DEPRECATED("Use begin_trace with static_trace=true")
8144 void begin_static_trace(Context ctx,
8145 const std::set<RegionTreeID> *managed = NULL);
8150 LEGION_DEPRECATED("Use end_trace")
8151 void end_static_trace(Context ctx);
8157 TraceID generate_dynamic_trace_id(
void);
8169 TraceID generate_library_trace_ids(const
char *name,
size_t count);
8178 static TraceID generate_static_trace_id(
void);
8196 void complete_frame(Context ctx, const
char *provenance = NULL);
8228 Future select_tunable_value(Context ctx, TunableID tid,
8229 MapperID mapper = 0, MappingTagID tag = 0,
8230 const
void *args = NULL,
size_t argsize = 0);
8239 LEGION_DEPRECATED("Tunable values should now be obtained via the "
8240 "generic interface that returns a future result.")
8241 int get_tunable_value(Context ctx, TunableID tid,
8242 MapperID mapper = 0, MappingTagID tag = 0);
8252 const
Task* get_local_task(Context ctx);
8261 void* get_local_task_variable_untyped(Context ctx, LocalVariableID
id);
8262 template<typename T>
8263 T* get_local_task_variable(Context ctx, LocalVariableID
id);
8275 void set_local_task_variable_untyped(Context ctx, LocalVariableID
id,
8276 const
void *value,
void (*destructor)(
void*) = NULL);
8277 template<typename T>
8278 void set_local_task_variable(Context ctx, LocalVariableID
id,
8279 const T* value,
void (*destructor)(
void*) = NULL);
8302 Future get_current_time_in_microseconds(Context ctx,
8313 Future get_current_time_in_nanoseconds(Context ctx,
8331 static
long long get_zero_time(
void);
8350 Mapping::Mapper* get_mapper(Context ctx, MapperID
id,
8351 Processor target = Processor::NO_PROC);
8366 Mapping::MapperContext begin_mapper_call(Context ctx, MapperID
id,
8367 Processor target = Processor::NO_PROC);
8374 void end_mapper_call(Mapping::MapperContext ctx);
8382 Processor get_executing_processor(Context ctx);
8390 const
Task* get_current_task(Context ctx);
8403 size_t query_available_memory(Context ctx, Memory target);
8434 void yield(Context ctx);
8473 void concurrent_task_barrier(Context ctx);
8481 bool is_MPI_interop_configured(
void);
8490 const std::map<
int,AddressSpace>& find_forward_MPI_mapping(
void);
8499 const std::map<AddressSpace,
int>& find_reverse_MPI_mapping(
void);
8504 int find_local_MPI_rank(
void);
8518 void attach_semantic_information(TaskID task_id, SemanticTag tag,
8519 const
void *buffer,
size_t size,
8520 bool is_mutable = false,
bool local_only = false);
8530 void attach_semantic_information(
IndexSpace handle, SemanticTag tag,
8531 const
void *buffer,
size_t size,
bool is_mutable = false);
8542 const
void *buffer,
size_t size,
bool is_mutable = false);
8552 void attach_semantic_information(
FieldSpace handle, SemanticTag tag,
8553 const
void *buffer,
size_t size,
bool is_mutable = false);
8565 SemanticTag tag, const
void *buffer,
8566 size_t size,
bool is_mutable = false);
8577 const
void *buffer,
size_t size,
bool is_mutable = false);
8588 SemanticTag tag, const
void *buffer,
8589 size_t size,
bool is_mutable = false);
8598 void attach_name(TaskID task_id, const
char *name,
8599 bool is_mutable = false,
8600 bool local_only = false);
8609 bool is_mutable = false);
8618 bool is_mutable = false);
8627 bool is_mutable = false);
8637 const
char *name,
bool is_mutable = false);
8646 bool is_mutable = false);
8655 bool is_mutable = false);
8667 bool retrieve_semantic_information(TaskID task_id, SemanticTag tag,
8668 const
void *&result,
size_t &size,
8669 bool can_fail = false,
8670 bool wait_until_ready = false);
8682 bool retrieve_semantic_information(
IndexSpace handle, SemanticTag tag,
8683 const
void *&result,
size_t &size,
8684 bool can_fail = false,
8685 bool wait_until_ready = false);
8698 const
void *&result,
size_t &size,
8699 bool can_fail = false,
8700 bool wait_until_ready = false);
8712 bool retrieve_semantic_information(
FieldSpace handle, SemanticTag tag,
8713 const
void *&result,
size_t &size,
8714 bool can_fail = false,
8715 bool wait_until_ready = false);
8728 bool retrieve_semantic_information(
FieldSpace handle, FieldID fid,
8730 const
void *&result,
size_t &size,
8731 bool can_fail = false,
8732 bool wait_until_ready = false);
8745 const
void *&result,
size_t &size,
8746 bool can_fail = false,
8747 bool wait_until_ready = false);
8761 const
void *&result,
size_t &size,
8762 bool can_fail = false,
8763 bool wait_until_ready = false);
8770 void retrieve_name(TaskID task_id, const
char *&result);
8799 void retrieve_name(
FieldSpace handle, FieldID fid, const
char *&result);
8828 void print_once(Context ctx, FILE *f, const
char *message);
8836 void log_once(Context ctx, Realm::LoggerMessage &message);
8849 Mapping::MapperRuntime* get_mapper_runtime(
void);
8855 MapperID generate_dynamic_mapper_id(
void);
8867 MapperID generate_library_mapper_ids(const
char *name,
size_t count);
8876 static MapperID generate_static_mapper_id(
void);
8889 void add_mapper(MapperID map_id, Mapping::Mapper *mapper,
8890 Processor proc = Processor::NO_PROC);
8903 void replace_default_mapper(Mapping::Mapper *mapper,
8904 Processor proc = Processor::NO_PROC);
8911 ProjectionID generate_dynamic_projection_id(
void);
8923 ProjectionID generate_library_projection_ids(const
char *name,
8933 static ProjectionID generate_static_projection_id(
void);
8948 void register_projection_functor(ProjectionID pid,
8950 bool silence_warnings = false,
8951 const
char *warning_string = NULL);
8962 static
void preregister_projection_functor(ProjectionID pid,
8977 ShardingID generate_dynamic_sharding_id(
void);
8989 ShardingID generate_library_sharding_ids(const
char *name,
size_t count);
8998 static ShardingID generate_static_sharding_id(
void);
9012 void register_sharding_functor(ShardingID sid,
9014 bool silence_warnings = false,
9015 const
char *warning_string = NULL);
9027 static
void preregister_sharding_functor(ShardingID sid,
9042 ReductionOpID generate_dynamic_reduction_id(
void);
9054 ReductionOpID generate_library_reduction_ids(const
char *name,
9064 static ReductionOpID generate_static_reduction_id(
void);
9080 template<typename REDOP>
9081 static
void register_reduction_op(ReductionOpID redop_id,
9082 bool permit_duplicates = false);
9104 static
void register_reduction_op(ReductionOpID redop_id,
9106 SerdezInitFnptr init_fnptr = NULL,
9107 SerdezFoldFnptr fold_fnptr = NULL,
9108 bool permit_duplicates = false);
9115 static const ReductionOp* get_reduction_op(ReductionOpID redop_id);
9117 #ifdef LEGION_GPU_REDUCTIONS
9118 template<
typename REDOP>
9119 LEGION_DEPRECATED(
"Use register_reduction_op instead")
9120 static
void preregister_gpu_reduction_op(ReductionOpID redop_id);
9164 template<
typename SERDEZ>
9166 bool permit_duplicates =
false);
9181 SerdezOp *serdez_op,
9182 bool permit_duplicates =
false);
9381 static int start(
int argc,
char **argv,
bool background =
false,
9382 bool supply_default_mapper =
true,
bool filter =
false);
9400 bool filter =
false,
bool parse =
true);
9463 Processor::Kind proc_kind,
9464 const char *task_name = NULL,
9465 bool control_replicable =
false,
9466 unsigned shard_per_address_space = 1,
9498 Realm::Event effects = Realm::Event::NO_EVENT);
9532 int ext_participants = 1,
9533 int legion_participants = 1);
9547 int mpi_participants = 1,
9548 int legion_participants = 1);
9562 LEGION_DEPRECATED(
"Projection functions should now be specified "
9563 "using projection functor objects")
9577 LEGION_DEPRECATED(
"Projection functions should now be specified "
9578 "using projection functor objects")
9598 bool dedup =
true,
size_t dedup_tag = 0);
9599 static void add_registration_callback(
9600 RegistrationWithArgsCallbackFnptr callback,
const UntypedBuffer &buffer,
9601 bool dedup =
true,
size_t dedup_tag = 0);
9628 RegistrationCallbackFnptr callback,
bool global,
9629 bool deduplicate =
true,
size_t dedup_tag = 0);
9630 static void perform_registration_callback(
9631 RegistrationWithArgsCallbackFnptr callback,
9633 bool deduplicate =
true ,
size_t dedup_tag = 0);
9646 LEGION_DEPRECATED(
"Legion now supports multiple registration callbacks "
9647 "added via the add_registration_callback method.")
9648 static
void set_registration_callback(RegistrationCallbackFnptr callback);
9660 static
void enable_profiling(
void);
9664 static
void disable_profiling(
void);
9668 static
void dump_profiling(
void);
9681 LayoutConstraintID register_layout(
9689 void release_layout(LayoutConstraintID layout_id);
9702 static LayoutConstraintID preregister_layout(
9704 LayoutConstraintID layout_id =
9705 LEGION_AUTO_GENERATE_ID);
9713 LayoutConstraintID layout_id);
9720 void get_layout_constraints(LayoutConstraintID layout_id,
9721 LayoutConstraintSet &layout_constraints);
9728 const
char* get_layout_constraints_name(LayoutConstraintID layout_id);
9738 TaskID generate_dynamic_task_id(
void);
9750 TaskID generate_library_task_ids(const
char *name,
size_t count);
9759 static TaskID generate_static_task_id(
void);
9768 template<typename T,
9772 VariantID vid = LEGION_AUTO_GENERATE_ID);
9782 template<typename T, typename UDT,
9784 Context,
Runtime*, const UDT&)>
9786 const UDT &user_data,
9787 VariantID vid = LEGION_AUTO_GENERATE_ID);
9800 VariantID vid = LEGION_AUTO_GENERATE_ID);
9810 template<typename UDT,
9812 Context,
Runtime*, const UDT&)>
9814 const UDT &user_data,
9815 VariantID vid = LEGION_AUTO_GENERATE_ID);
9837 const CodeDescriptor &codedesc,
9838 const
void *user_data = NULL,
9839 size_t user_len = 0,
9840 size_t return_type_size =
9841 LEGION_MAX_RETURN_SIZE,
9842 VariantID vid = LEGION_AUTO_GENERATE_ID,
9843 bool has_return_type_size = true);
9855 template<typename T,
9858 static VariantID preregister_task_variant(
9860 const
char *task_name = NULL,
9861 VariantID vid = LEGION_AUTO_GENERATE_ID);
9874 template<typename T, typename UDT,
9876 Context,
Runtime*, const UDT&)>
9877 static VariantID preregister_task_variant(
9879 const UDT &user_data,
9880 const
char *task_name = NULL,
9881 VariantID vid = LEGION_AUTO_GENERATE_ID);
9896 static VariantID preregister_task_variant(
9898 const
char *task_name = NULL,
9899 VariantID vid = LEGION_AUTO_GENERATE_ID);
9912 template<typename UDT,
9914 Context,
Runtime*, const UDT&)>
9915 static VariantID preregister_task_variant(
9917 const
char *task_name = NULL,
9918 VariantID vid = LEGION_AUTO_GENERATE_ID);
9941 static VariantID preregister_task_variant(
9943 const CodeDescriptor &codedesc,
9944 const
void *user_data = NULL,
9945 size_t user_len = 0,
9946 const
char *task_name = NULL,
9947 VariantID vid = LEGION_AUTO_GENERATE_ID,
9948 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
9949 bool has_return_type_size = true,
9950 bool check_task_id = true);
9966 Processor p, const
Task *& task,
9968 Context& ctx,
Runtime *& runtime);
9988 const
void *retvalptr = NULL,
9989 size_t retvalsize = 0,
9991 Realm::RegionInstance inst =
9992 Realm::RegionInstance::NO_INST,
9993 const
void *metadataptr = NULL,
9994 size_t metadatasize = 0);
10015 const
void *retvalptr,
size_t retvalsize,
bool owned,
10016 const Realm::ExternalInstanceResource &allocation,
10017 void (*freefunc)(const Realm::ExternalInstanceResource&) = NULL,
10018 const
void *metadataptr = NULL,
size_t metadatasize = 0);
10031 bool owned = false);
10047 template<typename T,
10050 LEGION_DEPRECATED("
Task registration should be done with "
10052 static TaskID register_legion_task(TaskID
id, Processor::Kind proc_kind,
10053 bool single,
bool index,
10054 VariantID vid =LEGION_AUTO_GENERATE_ID,
10056 const
char *task_name = NULL);
10073 LEGION_DEPRECATED("
Task registration should be done with "
10075 static TaskID register_legion_task(TaskID
id, Processor::Kind proc_kind,
10076 bool single,
bool index,
10077 VariantID vid =LEGION_AUTO_GENERATE_ID,
10079 const
char *task_name = NULL);
10095 template<typename T, typename UDT,
10097 Context,
Runtime*, const UDT&)>
10098 LEGION_DEPRECATED("
Task registration should be done with "
10100 static TaskID register_legion_task(TaskID
id, Processor::Kind proc_kind,
10101 bool single,
bool index,
10102 const UDT &user_data,
10103 VariantID vid =LEGION_AUTO_GENERATE_ID,
10105 const
char *task_name = NULL);
10121 template<typename UDT,
10123 Context,
Runtime*, const UDT&)>
10124 LEGION_DEPRECATED("
Task registration should be done with "
10126 static TaskID register_legion_task(TaskID
id, Processor::Kind proc_kind,
10127 bool single,
bool index,
10128 const UDT &user_data,
10129 VariantID vid =LEGION_AUTO_GENERATE_ID,
10131 const
char *task_name = NULL);
10139 static
bool has_runtime(
void);
10148 static
Runtime* get_runtime(Processor p = Processor::NO_PROC);
10156 static
bool has_context(
void);
10164 static Context get_context(
void);
10171 static const
Task* get_context_task(Context ctx);
10176 const
void *transform,
10177 size_t transform_size,
10178 const
void *extent,
10179 size_t extent_size,
10180 PartitionKind part_kind, Color color,
10181 const
char *provenance);
10182 IndexSpace create_index_space_union_internal(Context ctx,
10184 const
void *realm_color,
size_t color_size,
10185 TypeTag type_tag, const
char *provenance,
10187 IndexSpace create_index_space_union_internal(Context ctx,
10189 const
void *realm_color,
size_t color_size,
10190 TypeTag type_tag, const
char *provenance,
10192 IndexSpace create_index_space_intersection_internal(Context ctx,
10194 const
void *realm_color,
size_t color_size,
10195 TypeTag type_tag, const
char *provenance,
10197 IndexSpace create_index_space_intersection_internal(Context ctx,
10199 const
void *realm_color,
size_t color_size,
10200 TypeTag type_tag, const
char *provenance,
10202 IndexSpace create_index_space_difference_internal(Context ctx,
10204 const
void *realm_color,
size_t color_size,
10205 TypeTag type_tag, const
char *provenance,
10209 const
void *realm_color,TypeTag type_tag);
10211 const
void *realm_color,TypeTag type_tag);
10212 void get_index_partition_color_space_internal(
IndexPartition handle,
10213 void *realm_is, TypeTag type_tag);
10214 void get_index_space_domain_internal(
IndexSpace handle,
10215 void *realm_is, TypeTag type_tag);
10216 void get_index_space_color_internal(
IndexSpace handle,
10217 void *realm_color, TypeTag type_tag);
10219 const
void *realm_point,TypeTag type_tag);
10222 const
void *realm_color,TypeTag type_tag);
10223 bool has_logical_subregion_by_color_internal(
10225 const
void *realm_color,TypeTag type_tag);
10228 friend class LegionTaskWrapper;
10229 friend class LegionSerialization;
10231 template<typename T>
10233 template<typename T,
int DIM, typename COORD_T,
bool CHECK_BOUNDS>
10238 Realm::RegionInstance create_task_local_instance(Memory memory,
10239 Realm::InstanceLayoutGeneric *layout);
10240 void destroy_task_local_instance(Realm::RegionInstance instance);
10246 ShardID get_shard_id(Context ctx,
bool I_know_what_I_am_doing = false);
10249 size_t get_num_shards(Context ctx,
bool I_know_what_I_am_doing = false);
10268 Future consensus_match(Context ctx, const
void *input,
void *output,
10269 size_t num_elements,
size_t element_size, const
char *provenance = NULL);
10271 friend class Mapper;
10277 #include "legion/legion.inl"
10281 #include "legion/legion_mapping.h"
Definition: legion.h:4452
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:204
Definition: legion_types.h:205
Definition: legion.h:4500
Definition: legion.h:4401
Definition: legion.h:3770
Definition: legion.h:3702
Definition: legion.h:3666
Definition: legion_domain.h:253
Definition: legion_domain.h:132
Definition: legion_domain.h:614
Definition: legion.h:2683
Definition: legion.h:2751
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)
static const FieldSpace NO_SPACE
Definition: legion.h:200
Definition: legion.h:4518
Definition: legion.h:4949
Definition: legion.h:1172
static Future from_untyped_pointer(Runtime *rt, const void *buffer, size_t bytes, bool take_ownership=false)
size_t get_untyped_size(void) const
void get_void_result(bool silence_warnings=false, const char *warning_string=NULL) const
static Future from_value(Runtime *rt, const T &value)
T get_result(bool silence_warnings=false, const char *warning_string=NULL) const
const T & get_reference(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
const void * get_untyped_pointer(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
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
const void * get_metadata(size_t *size=NULL) const
bool is_ready(bool subscribe=false) const
Definition: legion.h:1374
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
static const IndexSpace NO_SPACE
Definition: legion.h:87
Definition: legion.h:4430
Definition: legion_types.h:2961
Definition: legion.h:4145
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
static const LogicalPartition NO_PART
Definition: legion.h:302
static const LogicalRegion NO_REGION
Definition: legion.h:235
Definition: legion.h:4210
void legion_handoff_to_mpi(void) const
Definition: legion.h:4241
void mpi_handoff_to_legion(void) const
Definition: legion.h:4230
void legion_wait_on_mpi(void) const
Definition: legion.h:4246
void mpi_wait_on_legion(void) const
Definition: legion.h:4235
Definition: legion.h:4259
Definition: legion.h:4579
Definition: legion.h:3916
Definition: legion.h:3316
Definition: legion.h:4546
Definition: legion.h:2537
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:3538
Definition: legion.h:3578
Definition: legion.h:4661
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:4863
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:3048
Definition: legion.h:4474
Definition: legion.h:5008
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 const SerdezOp * get_serdez_op(CustomSerdezID serdez_id)
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)
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 const char * get_legion_version(void)
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:4899
Definition: legion_domain.h:738
Definition: legion.h:3613
Definition: legion.h:4330
Definition: legion_types.h:202
Definition: legion_types.h:3407
Definition: legion.h:3860
Definition: legion.h:3716
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:3999
Definition: legion.h:2188
Definition: legion.h:1811
Definition: legion.h:2147
Definition: legion.h:1135
Definition: legion.h:1980
Definition: legion.h:2280
Definition: legion.h:1892
Definition: legion.h:2040
Definition: legion.h:1107
Definition: legion.h:1626
Definition: legion.h:1751
Definition: legion.h:2436
Definition: legion.h:4106
Definition: legion.h:1067
IndexSpace color_space
Definition: legion.h:1097
FieldSpace field_space
Definition: legion.h:1094
bool global_indexing
Definition: legion.h:1095
bool valid_requirement
Definition: legion.h:1096
Definition: legion.h:2370
ProjectionType handle_type
Definition: legion.h:992
std::set< FieldID > privilege_fields
Definition: legion.h:983
RegionRequirement & add_field(FieldID fid, bool instance=true)
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:993
LogicalRegion parent
Definition: legion.h:987
void * projection_args
Definition: legion.h:995
std::vector< FieldID > instance_fields
Definition: legion.h:984
LogicalPartition partition
Definition: legion.h:982
MappingTagID tag
Definition: legion.h:989
CoherenceProperty prop
Definition: legion.h:986
ReductionOpID redop
Definition: legion.h:988
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:985
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:996
RegionFlags flags
Definition: legion.h:990
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:981
Definition: legion.h:4614
Definition: legion.h:4047
Definition: legion.h:1485
Definition: legion.h:4633
Definition: legion.h:1523
Definition: legion.h:2476
Definition: legion.h:2386
Definition: legion.h:2404