Legion Runtime
Loading...
Searching...
No Matches
launchers.h
Go to the documentation of this file.
1/* Copyright 2026 Stanford University, NVIDIA Corporation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __LEGION_LAUNCHERS_H__
17#define __LEGION_LAUNCHERS_H__
18
27#include "legion/api/interop.h"
30#include "legion/api/sync.h"
31
32namespace Legion {
33
43 public:
44 StaticDependence(void);
46 unsigned previous_offset, unsigned previous_req_index,
47 unsigned current_req_index, DependenceType dtype,
48 bool validates = false, bool shard_only = false);
49 public:
50 inline void add_field(FieldID fid);
51 public:
52 // The relative offset from this operation to
53 // previous operation in the stream of operations
54 // (e.g. 1 is the operation launched immediately before)
55 unsigned previous_offset;
56 // Region requirement of the previous operation for the dependence
57 unsigned previous_req_index;
58 // Region requirement of the current operation for the dependence
59 unsigned current_req_index;
60 // The type of the dependence
61 DependenceType dependence_type;
62 // Whether this requirement validates the previous writer
63 bool validates;
64 // Whether this dependence is a shard-only dependence for
65 // control replication or it depends on all other copies
66 bool shard_only;
67 // Fields that have the dependence
68 std::set<FieldID> dependent_fields;
69 };
70
78 struct TaskLauncher {
79 public:
80 TaskLauncher(void);
82 TaskID tid, UntypedBuffer arg = UntypedBuffer(),
83 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
84 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
85 const char* provenance = "");
86 public:
87 inline IndexSpaceRequirement& add_index_requirement(
88 const IndexSpaceRequirement& req);
89 inline RegionRequirement& add_region_requirement(
90 const RegionRequirement& req);
91 inline void add_field(unsigned idx, FieldID fid, bool inst = true);
92 public:
93 inline void add_future(Future f);
94 inline void add_grant(Grant g);
95 inline void add_wait_barrier(PhaseBarrier bar);
96 inline void add_arrival_barrier(PhaseBarrier bar);
97 inline void add_wait_handshake(LegionHandshake handshake);
98 inline void add_arrival_handshake(LegionHandshake handshake);
99 public:
100 inline void set_predicate_false_future(Future f);
101 inline void set_predicate_false_result(UntypedBuffer arg);
102 public:
103 inline void set_independent_requirements(bool independent);
104 public:
105 TaskID task_id;
106 std::vector<IndexSpaceRequirement> index_requirements;
107 std::vector<RegionRequirement> region_requirements;
108 std::vector<Future> futures;
109 std::vector<Grant> grants;
110 std::vector<PhaseBarrier> wait_barriers;
111 std::vector<PhaseBarrier> arrive_barriers;
112 UntypedBuffer argument;
113 Predicate predicate;
114 MapperID map_id;
115 MappingTagID tag;
116 UntypedBuffer map_arg;
117 DomainPoint point;
118 // Only used in control replication contexts for
119 // doing sharding. If left unspecified the runtime
120 // will use an index space of size 1 containing 'point'
121 IndexSpace sharding_space;
122 public:
123 // If the predicate is set to anything other than
124 // Predicate::TRUE_PRED, then the application must
125 // specify a value for the future in the case that
126 // the predicate resolves to false. UntypedBuffer(nullptr,0)
127 // can be used if the task's return type is void.
128 Future predicate_false_future;
129 UntypedBuffer predicate_false_result;
130 public:
131 // Provenance string for the runtime and tools to use
132 std::string provenance;
133 public:
134 // Inform the runtime about any static dependences
135 // These will be ignored outside of static traces
136 const std::vector<StaticDependence>* static_dependences;
137 public:
138 // Users can tell the runtime this task is eligible
139 // for inlining by the mapper. This will invoke the
140 // select_task_options call inline as part of the launch
141 // logic for this task to allow the mapper to decide
142 // whether to inline the task or not. Note that if the
143 // mapper pre-empts during execution then resuming it
144 // may take a long time if another long running task
145 // gets scheduled on the processor that launched this task.
146 bool enable_inlining;
147 public:
148 // In some cases users (most likely compilers) will want
149 // to run a light-weight function (e.g. a continuation)
150 // as a task that just depends on futures once those futures
151 // are ready on a local processor where the parent task
152 // is executing. We call this a local function task and it
153 // must not have any region requirements. It must als be a
154 // pure function with no side effects. This task will
155 // not have the option of being distributed to remote nodes.
156 bool local_function_task;
157 public:
158 // Users can inform the runtime that all region requirements
159 // are independent of each other in this task. Independent
160 // means that either field sets are independent or region
161 // requirements are disjoint based on the region tree.
162 bool independent_requirements;
163 public:
164 // Instruct the runtime that it does not need to produce
165 // a future or future map result for this index task
166 bool elide_future_return;
167 // Provide an optional future return size. In general you
168 // shouldn't need to use this and should prefer specifying
169 // the future return size when you register a task variant.
170 std::optional<size_t> future_return_size;
171 public:
172 bool silence_warnings;
173 };
174
184 public:
185 IndexTaskLauncher(void);
187 TaskID tid, Domain domain, UntypedBuffer global_arg = UntypedBuffer(),
188 ArgumentMap map = ArgumentMap(), Predicate pred = Predicate::TRUE_PRED,
189 bool must = false, MapperID id = 0, MappingTagID tag = 0,
190 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
192 TaskID tid, IndexSpace launch_space,
193 UntypedBuffer global_arg = UntypedBuffer(),
194 ArgumentMap map = ArgumentMap(), Predicate pred = Predicate::TRUE_PRED,
195 bool must = false, MapperID id = 0, MappingTagID tag = 0,
196 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
197 public:
198 inline IndexSpaceRequirement& add_index_requirement(
199 const IndexSpaceRequirement& req);
200 inline RegionRequirement& add_region_requirement(
201 const RegionRequirement& req);
202 inline void add_field(unsigned idx, FieldID fid, bool inst = true);
203 public:
204 inline void add_future(Future f);
205 inline void add_grant(Grant g);
206 inline void add_wait_barrier(PhaseBarrier bar);
207 inline void add_arrival_barrier(PhaseBarrier bar);
208 inline void add_wait_handshake(LegionHandshake handshake);
209 inline void add_arrival_handshake(LegionHandshake handshake);
210 public:
211 inline void set_predicate_false_future(Future f);
212 inline void set_predicate_false_result(UntypedBuffer arg);
213 public:
214 inline void set_independent_requirements(bool independent);
215 public:
216 TaskID task_id;
217 Domain launch_domain;
218 IndexSpace launch_space;
219 // Will only be used in control replication context. If left
220 // unset the runtime will use launch_domain/launch_space
221 IndexSpace sharding_space;
222 std::vector<IndexSpaceRequirement> index_requirements;
223 std::vector<RegionRequirement> region_requirements;
224 std::vector<Future> futures;
225 // These are appended to the futures for the point
226 // task after the futures sent to all points above
227 std::vector<ArgumentMap> point_futures;
228 std::vector<Grant> grants;
229 std::vector<PhaseBarrier> wait_barriers;
230 std::vector<PhaseBarrier> arrive_barriers;
231 UntypedBuffer global_arg;
232 ArgumentMap argument_map;
233 Predicate predicate;
234 // Specify that all the point tasks in this index launch be
235 // able to run concurrently, meaning they all must map to
236 // different processors and they cannot have interfering region
237 // requirements that might lead to dependences. Note that the
238 // runtime guarantees that concurrent index launches will not
239 // deadlock with other concurrent index launches which requires
240 // additional analysis. Currently concurrent index space launches
241 // will only be allowed to map to leaf task variants currently.
242 ConcurrentID concurrent_functor; // = 0
243 bool concurrent; // = false
244 // This will convert this index space launch into a must
245 // epoch launch which supports interfering region requirements
246 bool must_parallelism;
247 MapperID map_id;
248 MappingTagID tag;
249 UntypedBuffer map_arg;
250 public:
251 // If the predicate is set to anything other than
252 // Predicate::TRUE_PRED, then the application must
253 // specify a value for the future in the case that
254 // the predicate resolves to false. UntypedBuffer(nullptr,0)
255 // can be used if the task's return type is void.
256 Future predicate_false_future;
257 UntypedBuffer predicate_false_result;
258 public:
259 // Provenance string for the runtime and tools to use
260 std::string provenance;
261 public:
262 // Inform the runtime about any static dependences
263 // These will be ignored outside of static traces
264 const std::vector<StaticDependence>* static_dependences;
265 public:
266 // Users can tell the runtime this task is eligible
267 // for inlining by the mapper. This will invoke the
268 // select_task_options call inline as part of the launch
269 // logic for this task to allow the mapper to decide
270 // whether to inline the task or not. Note that if the
271 // mapper pre-empts during execution then resuming it
272 // may take a long time if another long running task
273 // gets scheduled on the processor that launched this task.
274 bool enable_inlining;
275 public:
276 // Users can inform the runtime that all region requirements
277 // are independent of each other in this task. Independent
278 // means that either field sets are independent or region
279 // requirements are disjoint based on the region tree.
280 bool independent_requirements;
281 public:
282 bool silence_warnings;
283 public:
284 // Instruct the runtime that it does not need to produce
285 // a future or future map result for this index task
286 bool elide_future_return;
287 // Provide an optional future return size. In general you
288 // shouldn't need to use this and should prefer specifying
289 // the future return size when you register a task variant.
290 std::optional<size_t> future_return_size;
291 public:
292 // Initial value for reduction
293 Future initial_value;
294 };
295
305 public:
306 InlineLauncher(void);
308 const RegionRequirement& req, MapperID id = 0, MappingTagID tag = 0,
309 LayoutConstraintID layout_id = 0,
310 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
311 public:
312 inline void add_field(FieldID fid, bool inst = true);
313 public:
314 inline void add_grant(Grant g);
315 inline void add_wait_barrier(PhaseBarrier bar);
316 inline void add_arrival_barrier(PhaseBarrier bar);
317 inline void add_wait_handshake(LegionHandshake handshake);
318 inline void add_arrival_handshake(LegionHandshake handshake);
319 public:
320 RegionRequirement requirement;
321 std::vector<Grant> grants;
322 std::vector<PhaseBarrier> wait_barriers;
323 std::vector<PhaseBarrier> arrive_barriers;
324 MapperID map_id;
325 MappingTagID tag;
326 UntypedBuffer map_arg;
327 public:
328 LayoutConstraintID layout_constraint_id;
329 public:
330 // Provenance string for the runtime and tools to use
331 std::string provenance;
332 public:
333 // Inform the runtime about any static dependences
334 // These will be ignored outside of static traces
335 const std::vector<StaticDependence>* static_dependences;
336 };
337
363 public:
365 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
366 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
367 const char* provenance = "");
368 public:
369 inline unsigned add_copy_requirements(
370 const RegionRequirement& src, const RegionRequirement& dst);
371 inline void add_src_field(unsigned idx, FieldID fid, bool inst = true);
372 inline void add_dst_field(unsigned idx, FieldID fid, bool inst = true);
373 public:
374 // Specify src/dst indirect requirements (must have exactly 1 field)
375 inline void add_src_indirect_field(
376 FieldID src_idx_fid, const RegionRequirement& src_idx_req,
377 bool is_range_indirection = false, bool inst = true);
378 inline void add_dst_indirect_field(
379 FieldID dst_idx_fid, const RegionRequirement& dst_idx_req,
380 bool is_range_indirection = false, bool inst = true);
381 inline RegionRequirement& add_src_indirect_field(
382 const RegionRequirement& src_idx_req,
383 bool is_range_indirection = false);
384 inline RegionRequirement& add_dst_indirect_field(
385 const RegionRequirement& dst_idx_req,
386 bool is_range_indirection = false);
387 public:
388 inline void add_grant(Grant g);
389 inline void add_wait_barrier(PhaseBarrier bar);
390 inline void add_arrival_barrier(PhaseBarrier bar);
391 inline void add_wait_handshake(LegionHandshake handshake);
392 inline void add_arrival_handshake(LegionHandshake handshake);
393 public:
394 std::vector<RegionRequirement> src_requirements;
395 std::vector<RegionRequirement> dst_requirements;
396 std::vector<RegionRequirement> src_indirect_requirements;
397 std::vector<RegionRequirement> dst_indirect_requirements;
398 std::vector<bool> src_indirect_is_range;
399 std::vector<bool> dst_indirect_is_range;
400 std::vector<Grant> grants;
401 std::vector<PhaseBarrier> wait_barriers;
402 std::vector<PhaseBarrier> arrive_barriers;
403 Predicate predicate;
404 MapperID map_id;
405 MappingTagID tag;
406 UntypedBuffer map_arg;
407 DomainPoint point;
408 // Only used in control replication contexts for
409 // doing sharding. If left unspecified the runtime
410 // will use an index space of size 1 containing 'point'
411 IndexSpace sharding_space;
412 public:
413 // Provenance string for the runtime and tools to use
414 std::string provenance;
415 public:
416 // Inform the runtime about any static dependences
417 // These will be ignored outside of static traces
418 const std::vector<StaticDependence>* static_dependences;
419 public:
420 // Whether the source and destination indirections can lead
421 // to out-of-range access into the instances to skip
422 bool possible_src_indirect_out_of_range;
423 bool possible_dst_indirect_out_of_range;
424 // Whether the destination indirection can lead to aliasing
425 // in the destination instances requiring synchronization
426 bool possible_dst_indirect_aliasing;
427 public:
428 bool silence_warnings;
429 };
430
442 public:
443 IndexCopyLauncher(void);
445 Domain domain, Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
446 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
447 const char* provenance = "");
449 IndexSpace space, Predicate pred = Predicate::TRUE_PRED,
450 MapperID id = 0, MappingTagID tag = 0,
451 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
452 public:
453 inline unsigned add_copy_requirements(
454 const RegionRequirement& src, const RegionRequirement& dst);
455 inline void add_src_field(unsigned idx, FieldID fid, bool inst = true);
456 inline void add_dst_field(unsigned idx, FieldID fid, bool inst = true);
457 public:
458 // Specify src/dst indirect requirements (must have exactly 1 field)
459 inline void add_src_indirect_field(
460 FieldID src_idx_fid, const RegionRequirement& src_idx_req,
461 bool is_range_indirection = false, bool inst = true);
462 inline void add_dst_indirect_field(
463 FieldID dst_idx_fid, const RegionRequirement& dst_idx_req,
464 bool is_range_indirection = false, bool inst = true);
465 inline RegionRequirement& add_src_indirect_field(
466 const RegionRequirement& src_idx_req,
467 bool is_range_indirection = false);
468 inline RegionRequirement& add_dst_indirect_field(
469 const RegionRequirement& dst_idx_req,
470 bool is_range_indirection = false);
471 public:
472 inline void add_grant(Grant g);
473 inline void add_wait_barrier(PhaseBarrier bar);
474 inline void add_arrival_barrier(PhaseBarrier bar);
475 inline void add_wait_handshake(LegionHandshake handshake);
476 inline void add_arrival_handshake(LegionHandshake handshake);
477 public:
478 std::vector<RegionRequirement> src_requirements;
479 std::vector<RegionRequirement> dst_requirements;
480 std::vector<RegionRequirement> src_indirect_requirements;
481 std::vector<RegionRequirement> dst_indirect_requirements;
482 std::vector<bool> src_indirect_is_range;
483 std::vector<bool> dst_indirect_is_range;
484 std::vector<Grant> grants;
485 std::vector<PhaseBarrier> wait_barriers;
486 std::vector<PhaseBarrier> arrive_barriers;
487 Domain launch_domain;
488 IndexSpace launch_space;
489 // Will only be used in control replication context. If left
490 // unset the runtime will use launch_domain/launch_space
491 IndexSpace sharding_space;
492 Predicate predicate;
493 MapperID map_id;
494 MappingTagID tag;
495 UntypedBuffer map_arg;
496 public:
497 // Provenance string for the runtime and tools to use
498 std::string provenance;
499 public:
500 // Inform the runtime about any static dependences
501 // These will be ignored outside of static traces
502 const std::vector<StaticDependence>* static_dependences;
503 public:
504 // Whether the source and destination indirections can lead
505 // to out-of-range access into the instances to skip
506 bool possible_src_indirect_out_of_range;
507 bool possible_dst_indirect_out_of_range;
508 // Whether the destination indirection can lead to aliasing
509 // in the destination instances requiring synchronization
510 bool possible_dst_indirect_aliasing;
511 // Whether the individual point copies should operate collectively
512 // together in the case of indirect copies (e.g. allow indirections
513 // to refer to instances from other points). These settings have
514 // no effect in the case of copies without indirections.
515 bool collective_src_indirect_points;
516 bool collective_dst_indirect_points;
517 public:
518 bool silence_warnings;
519 };
520
528 public:
529 FillLauncher(void);
531 LogicalRegion handle, LogicalRegion parent, UntypedBuffer arg,
532 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
533 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
534 const char* provenance = "");
536 LogicalRegion handle, LogicalRegion parent, Future f,
537 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
538 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
539 const char* provenance = "");
540 public:
541 inline void set_argument(UntypedBuffer arg);
542 inline void set_future(Future f);
543 inline void add_field(FieldID fid);
544 inline void add_grant(Grant g);
545 inline void add_wait_barrier(PhaseBarrier bar);
546 inline void add_arrival_barrier(PhaseBarrier bar);
547 inline void add_wait_handshake(LegionHandshake handshake);
548 inline void add_arrival_handshake(LegionHandshake handshake);
549 public:
550 LogicalRegion handle;
551 LogicalRegion parent;
552 UntypedBuffer argument;
553 Future future;
554 Predicate predicate;
555 std::set<FieldID> fields;
556 std::vector<Grant> grants;
557 std::vector<PhaseBarrier> wait_barriers;
558 std::vector<PhaseBarrier> arrive_barriers;
559 MapperID map_id;
560 MappingTagID tag;
561 UntypedBuffer map_arg;
562 DomainPoint point;
563 // Only used in control replication contexts for
564 // doing sharding. If left unspecified the runtime
565 // will use an index space of size 1 containing 'point'
566 IndexSpace sharding_space;
567 public:
568 // Provenance string for the runtime and tools to use
569 std::string provenance;
570 public:
571 // Inform the runtime about any static dependences
572 // These will be ignored outside of static traces
573 const std::vector<StaticDependence>* static_dependences;
574 public:
575 bool silence_warnings;
576 };
577
588 public:
589 IndexFillLauncher(void);
590 // Region projection
592 Domain domain, LogicalRegion handle, LogicalRegion parent,
593 UntypedBuffer arg, ProjectionID projection = 0,
594 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
595 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
596 const char* provenance = "");
598 Domain domain, LogicalRegion handle, LogicalRegion parent, Future f,
599 ProjectionID projection = 0, Predicate pred = Predicate::TRUE_PRED,
600 MapperID id = 0, MappingTagID tag = 0,
601 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
603 IndexSpace space, LogicalRegion handle, LogicalRegion parent,
604 UntypedBuffer arg, ProjectionID projection = 0,
605 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
606 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
607 const char* provenance = "");
609 IndexSpace space, LogicalRegion handle, LogicalRegion parent, Future f,
610 ProjectionID projection = 0, Predicate pred = Predicate::TRUE_PRED,
611 MapperID id = 0, MappingTagID tag = 0,
612 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
613 // Partition projection
615 Domain domain, LogicalPartition handle, LogicalRegion parent,
616 UntypedBuffer arg, ProjectionID projection = 0,
617 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
618 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
619 const char* provenance = "");
621 Domain domain, LogicalPartition handle, LogicalRegion parent, Future f,
622 ProjectionID projection = 0, Predicate pred = Predicate::TRUE_PRED,
623 MapperID id = 0, MappingTagID tag = 0,
624 UntypedBuffer map_arg = UntypedBuffer(), const char* provenance = "");
626 IndexSpace space, LogicalPartition handle, LogicalRegion parent,
627 UntypedBuffer arg, ProjectionID projection = 0,
628 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
629 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
630 const char* provenance = "");
632 IndexSpace space, LogicalPartition handle, LogicalRegion parent,
633 Future f, ProjectionID projection = 0,
634 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
635 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
636 const char* provenance = "");
637 public:
638 inline void set_argument(UntypedBuffer arg);
639 inline void set_future(Future f);
640 inline void add_field(FieldID fid);
641 inline void add_grant(Grant g);
642 inline void add_wait_barrier(PhaseBarrier bar);
643 inline void add_arrival_barrier(PhaseBarrier bar);
644 inline void add_wait_handshake(LegionHandshake handshake);
645 inline void add_arrival_handshake(LegionHandshake handshake);
646 public:
647 Domain launch_domain;
648 IndexSpace launch_space;
649 // Will only be used in control replication context. If left
650 // unset the runtime will use launch_domain/launch_space
651 IndexSpace sharding_space;
652 LogicalRegion region;
653 LogicalPartition partition;
654 LogicalRegion parent;
655 ProjectionID projection;
656 UntypedBuffer argument;
657 Future future;
658 Predicate predicate;
659 std::set<FieldID> fields;
660 std::vector<Grant> grants;
661 std::vector<PhaseBarrier> wait_barriers;
662 std::vector<PhaseBarrier> arrive_barriers;
663 MapperID map_id;
664 MappingTagID tag;
665 UntypedBuffer map_arg;
666 public:
667 // Provenance string for the runtime and tools to use
668 std::string provenance;
669 public:
670 // Inform the runtime about any static dependences
671 // These will be ignored outside of static traces
672 const std::vector<StaticDependence>* static_dependences;
673 public:
674 bool silence_warnings;
675 };
676
684 public:
686 public:
687 inline void add_field(FieldID fid);
688 public:
689 LogicalRegion handle;
690 LogicalRegion parent;
691 std::set<FieldID> fields;
692 public:
693 // Provenance string for the runtime and tools to use
694 std::string provenance;
695 public:
696 // Inform the runtime about any static dependences
697 // These will be ignored outside of static traces
698 const std::vector<StaticDependence>* static_dependences;
699 public:
700 bool silence_warnings;
701 };
702
727 public:
729 ExternalResource resource, LogicalRegion handle, LogicalRegion parent,
730 const bool restricted = true, const bool mapped = true);
731 // Declared here to avoid superfluous compiler warnings
732 // Can be remove after deprecated members are removed
733 ~AttachLauncher(void);
734 public:
735 inline void initialize_constraints(
736 bool column_major, bool soa, const std::vector<FieldID>& fields,
737 const std::map<FieldID, size_t>* alignments = nullptr);
738 LEGION_DEPRECATED("Use Realm::ExternalFileResource instead")
739 inline void attach_file(
740 const char* file_name, const std::vector<FieldID>& fields,
741 LegionFileMode mode);
742 LEGION_DEPRECATED("Use Realm::ExternalHDF5Resource instead")
743 inline void attach_hdf5(
744 const char* file_name, const std::map<FieldID, const char*>& field_map,
745 LegionFileMode mode);
746 // Helper methods for AOS and SOA arrays, but it is totally
747 // acceptable to fill in the layout constraint set manually
748 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
749 inline void attach_array_aos(
750 void* base, bool column_major, const std::vector<FieldID>& fields,
751 Memory memory = Memory::NO_MEMORY,
752 const std::map<FieldID, size_t>* alignments = nullptr);
753 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
754 inline void attach_array_soa(
755 void* base, bool column_major, const std::vector<FieldID>& fields,
756 Memory memory = Memory::NO_MEMORY,
757 const std::map<FieldID, size_t>* alignments = nullptr);
758 public:
759 ExternalResource resource;
760 LogicalRegion parent;
761 LogicalRegion handle;
762 std::set<FieldID> privilege_fields;
763 public:
764 // This will be cloned each time you perform an attach with this launcher
765 const Realm::ExternalInstanceResource* external_resource;
766 public:
767 LayoutConstraintSet constraints;
768 public:
769 // Whether this instance will be restricted when attached
770 bool restricted /*= true*/;
771 // Whether this region should be mapped by the calling task
772 bool mapped; /*= true*/
773 // Only matters for control replicated parent tasks
774 // Indicate whether all the shards are providing the same data
775 // or whether they are each providing different data
776 // Collective means that each shard provides its own copy of the
777 // data and non-collective means every shard provides the same data
778 // Defaults to 'true' for external instances and 'false' for files
779 bool collective;
780 // For collective cases, indicate whether the runtime should
781 // deduplicate data across shards in the same process
782 // This is useful for cases where there is one file or external
783 // instance per process but multiple shards per process
784 bool deduplicate_across_shards;
785 public:
786 // Provenance string for the runtime and tools to use
787 std::string provenance;
788 public:
789 // Data for files
790 LEGION_DEPRECATED("file_name is deprecated, use external_resource")
791 const char* file_name;
792 LEGION_DEPRECATED("mode is deprecated, use external_resource")
793 LegionFileMode mode;
794 LEGION_DEPRECATED("file_fields is deprecated, use external_resource")
795 std::vector<FieldID> file_fields; // normal files
796 // This member must still be populated if you're attaching to an HDF5 file
797 std::map<FieldID, /*file name*/ const char*> field_files; // hdf5 files
798 public:
799 // Optional footprint of the instance in memory in bytes
800 size_t footprint;
801 public:
802 // Inform the runtime about any static dependences
803 // These will be ignored outside of static traces
804 const std::vector<StaticDependence>* static_dependences;
805 };
806
818 public:
820 ExternalResource resource, LogicalRegion parent,
821 const bool restricted = true);
822 // Declared here to avoid superfluous compiler warnings
823 // Can be remove after deprecated members are removed
825 public:
826 inline void initialize_constraints(
827 bool column_major, bool soa, const std::vector<FieldID>& fields,
828 const std::map<FieldID, size_t>* alignments = nullptr);
829 inline void add_external_resource(
830 LogicalRegion handle, const Realm::ExternalInstanceResource* resource);
831 LEGION_DEPRECATED("Use Realm::ExternalFileResource instead")
832 inline void attach_file(
833 LogicalRegion handle, const char* file_name,
834 const std::vector<FieldID>& fields, LegionFileMode mode);
835 LEGION_DEPRECATED("Use Realm::ExternalHDF5Resource instead")
836 inline void attach_hdf5(
837 LogicalRegion handle, const char* file_name,
838 const std::map<FieldID, const char*>& field_map, LegionFileMode mode);
839 // Helper methods for AOS and SOA arrays, but it is totally
840 // acceptable to fill in the layout constraint set manually
841 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
842 inline void attach_array_aos(
843 LogicalRegion handle, void* base, bool column_major,
844 const std::vector<FieldID>& fields, Memory memory = Memory::NO_MEMORY,
845 const std::map<FieldID, size_t>* alignments = nullptr);
846 LEGION_DEPRECATED("Use Realm::ExternalMemoryResource instead")
847 inline void attach_array_soa(
848 LogicalRegion handle, void* base, bool column_major,
849 const std::vector<FieldID>& fields, Memory memory = Memory::NO_MEMORY,
850 const std::map<FieldID, size_t>* alignments = nullptr);
851 public:
852 ExternalResource resource;
853 LogicalRegion parent;
854 std::set<FieldID> privilege_fields;
855 std::vector<LogicalRegion> handles;
856 // This is the vector external resource objects that are going to
857 // attached to the vector of logical region handles
858 // These will be cloned each time you perform an attach with this launcher
859 std::vector<const Realm::ExternalInstanceResource*> external_resources;
860 public:
861 LayoutConstraintSet constraints;
862 public:
863 // Whether these instances will be restricted when attached
864 bool restricted /*= true*/;
865 // Whether the runtime should check for duplicate resources across
866 // the shards in a control replicated context, it is illegal to pass
867 // in the same resource to different shards if this is set to false
868 bool deduplicate_across_shards;
869 public:
870 // Provenance string for the runtime and tools to use
871 std::string provenance;
872 public:
873 // Data for files
874 LEGION_DEPRECATED("mode is deprecated, use external_resources")
875 LegionFileMode mode;
876 LEGION_DEPRECATED("file_names is deprecated, use external_resources")
877 std::vector<const char*> file_names;
878 LEGION_DEPRECATED("file_fields is deprecated, use external_resources")
879 std::vector<FieldID> file_fields; // normal files
880 // This data structure must still be filled in for using HDF5 files
881 std::map<FieldID, std::vector</*file name*/ const char*> >
882 field_files; // hdf5 files
883 public:
884 // Data for external instances
885 LEGION_DEPRECATED("pointers is deprecated, use external_resources")
886 std::vector<PointerConstraint> pointers;
887 public:
888 // Optional footprint of the instance in memory in bytes
889 // You only need to fill this in when using depcreated fields
890 std::vector<size_t> footprint;
891 public:
892 // Inform the runtime about any static dependences
893 // These will be ignored outside of static traces
894 const std::vector<StaticDependence>* static_dependences;
895 };
896
904 public:
905 explicit PredicateLauncher(bool and_op = true);
906 public:
907 inline void add_predicate(const Predicate& pred);
908 public:
909 bool and_op; // if not 'and' then 'or'
910 std::vector<Predicate> predicates;
911 std::string provenance;
912 };
913
920 public:
921 TimingLauncher(TimingMeasurement measurement);
922 public:
923 inline void add_precondition(const Future& f);
924 public:
925 TimingMeasurement measurement;
926 std::set<Future> preconditions;
927 public:
928 // Provenance string for the runtime and tools to use
929 std::string provenance;
930 };
931
938 public:
940 TunableID tid, MapperID mapper = 0, MappingTagID tag = 0,
941 size_t return_type_size = SIZE_MAX);
942 public:
943 TunableID tunable;
944 MapperID mapper;
945 MappingTagID tag;
946 UntypedBuffer arg;
947 std::vector<Future> futures;
948 size_t return_type_size;
949 public:
950 // Provenance string for the runtime and tools to use
951 std::string provenance;
952 };
953
966 public:
968 LogicalRegion logical_region, LogicalRegion parent_region,
969 PhysicalRegion physical_region = PhysicalRegion(),
970 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
971 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
972 const char* provenance = "");
973 public:
974 inline void add_field(FieldID f);
975 inline void add_grant(Grant g);
976 inline void add_wait_barrier(PhaseBarrier pb);
977 inline void add_arrival_barrier(PhaseBarrier pb);
978 inline void add_wait_handshake(LegionHandshake handshake);
979 inline void add_arrival_handshake(LegionHandshake handshake);
980 public:
981 LogicalRegion logical_region;
982 LogicalRegion parent_region;
983 std::set<FieldID> fields;
984 public:
985 // This field is now optional (but required with control replication)
986 PhysicalRegion physical_region;
987 public:
988 std::vector<Grant> grants;
989 std::vector<PhaseBarrier> wait_barriers;
990 std::vector<PhaseBarrier> arrive_barriers;
991 Predicate predicate;
992 MapperID map_id;
993 MappingTagID tag;
994 UntypedBuffer map_arg;
995 public:
996 // Provenance string for the runtime and tools to use
997 std::string provenance;
998 public:
999 // Inform the runtime about any static dependences
1000 // These will be ignored outside of static traces
1001 const std::vector<StaticDependence>* static_dependences;
1002 public:
1003 bool silence_warnings;
1004 };
1005
1013 public:
1015 LogicalRegion logical_region, LogicalRegion parent_region,
1016 PhysicalRegion physical_region = PhysicalRegion(),
1017 Predicate pred = Predicate::TRUE_PRED, MapperID id = 0,
1018 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1019 const char* provenance = "");
1020 public:
1021 inline void add_field(FieldID f);
1022 inline void add_grant(Grant g);
1023 inline void add_wait_barrier(PhaseBarrier pb);
1024 inline void add_arrival_barrier(PhaseBarrier pb);
1025 inline void add_wait_handshake(LegionHandshake handshake);
1026 inline void add_arrival_handshake(LegionHandshake handshake);
1027 public:
1028 LogicalRegion logical_region;
1029 LogicalRegion parent_region;
1030 std::set<FieldID> fields;
1031 public:
1032 // This field is now optional (but required with control replication)
1033 PhysicalRegion physical_region;
1034 public:
1035 std::vector<Grant> grants;
1036 std::vector<PhaseBarrier> wait_barriers;
1037 std::vector<PhaseBarrier> arrive_barriers;
1038 Predicate predicate;
1039 MapperID map_id;
1040 MappingTagID tag;
1041 UntypedBuffer map_arg;
1042 public:
1043 // Provenance string for the runtime and tools to use
1044 std::string provenance;
1045 public:
1046 // Inform the runtime about any static dependences
1047 // These will be ignored outside of static traces
1048 const std::vector<StaticDependence>* static_dependences;
1049 public:
1050 bool silence_warnings;
1051 };
1052
1067 public:
1068 MustEpochLauncher(MapperID id = 0, MappingTagID tag = 0);
1069 public:
1070 inline void add_single_task(
1071 const DomainPoint& point, const TaskLauncher& launcher);
1072 inline void add_index_task(const IndexTaskLauncher& launcher);
1073 public:
1074 MapperID map_id;
1075 MappingTagID mapping_tag;
1076 std::vector<TaskLauncher> single_tasks;
1077 std::vector<IndexTaskLauncher> index_tasks;
1078 public:
1079 Domain launch_domain;
1080 IndexSpace launch_space;
1081 // Will only be used in control replication context. If left
1082 // unset the runtime will use launch_space/launch_domain
1083 IndexSpace sharding_space;
1084 public:
1085 // Provenance string for the runtime and tools to use
1086 std::string provenance;
1087 public:
1088 bool silence_warnings;
1089 };
1090
1091} // namespace Legion
1092
1093#include "legion/api/launchers.inl"
1094
1095#endif // __LEGION_LAUNCHERS_H__
Definition argument_map.h:93
Definition geometry.h:159
Definition geometry.h:34
Definition future.h:50
Definition sync.h:102
Definition data.h:35
Definition constraints.h:881
Definition interop.h:38
Definition data.h:260
Definition data.h:189
Definition sync.h:147
Definition physical_region.h:38
Definition predicate.h:38
Definition types.h:343
Definition argument_map.h:40
Definition accessors.h:29
Definition launchers.h:965
Definition launchers.h:726
Definition launchers.h:362
Definition launchers.h:683
Definition launchers.h:527
Definition launchers.h:817
Definition launchers.h:441
Definition launchers.h:587
Definition requirements.h:289
Definition launchers.h:183
Definition launchers.h:304
Definition launchers.h:1066
Definition launchers.h:903
Definition requirements.h:42
Definition launchers.h:1012
Definition launchers.h:42
Definition launchers.h:78
Definition launchers.h:919
Definition launchers.h:937