16 #ifndef __LEGION_TYPES_H__
17 #define __LEGION_TYPES_H__
36 #include <type_traits>
39 #include "legion/legion_template_help.h"
43 #include "realm/dynamic_templates.h"
47 #ifndef LEGION_DEPRECATED
48 #if __cplusplus >= 201402L
49 #define LEGION_DEPRECATED(x) [[deprecated(x)]]
51 #define LEGION_DEPRECATED(x)
57 #ifndef LEGION_DISABLE_EVENT_PRUNING
58 #define LEGION_DISABLE_EVENT_PRUNING
63 template<
typename T,
unsigned int MAX,
64 unsigned SHIFT,
unsigned MASK>
class BitMask;
65 template<
typename T,
unsigned int MAX,
68 template<
unsigned int MAX>
class SSEBitMask;
69 template<
unsigned int MAX>
class SSETLBitMask;
72 template<
unsigned int MAX>
class AVXBitMask;
73 template<
unsigned int MAX>
class AVXTLBitMask;
76 template<
unsigned int MAX>
class PPCBitMask;
77 template<
unsigned int MAX>
class PPCTLBitMask;
80 template<
unsigned int MAX>
class NeonBitMask;
81 template<
unsigned int MAX>
class NeonTLBitMask;
85 namespace BindingLib {
class Utility; }
89 typedef ::legion_error_t LegionErrorType;
90 typedef ::legion_privilege_mode_t PrivilegeMode;
91 typedef ::legion_allocate_mode_t AllocateMode;
92 typedef ::legion_coherence_property_t CoherenceProperty;
93 typedef ::legion_region_flags_t RegionFlags;
94 typedef ::legion_projection_type_t ProjectionType;
95 typedef ::legion_partition_kind_t PartitionKind;
96 typedef ::legion_external_resource_t ExternalResource;
97 typedef ::legion_timing_measurement_t TimingMeasurement;
98 typedef ::legion_dependence_type_t DependenceType;
99 typedef ::legion_mappable_type_id_t MappableType;
100 typedef ::legion_file_mode_t LegionFileMode;
101 typedef ::legion_execution_constraint_t ExecutionConstraintKind;
102 typedef ::legion_layout_constraint_t LayoutConstraintKind;
103 typedef ::legion_equality_kind_t EqualityKind;
104 typedef ::legion_dimension_kind_t DimensionKind;
105 typedef ::legion_isa_kind_t ISAKind;
106 typedef ::legion_resource_constraint_t ResourceKind;
107 typedef ::legion_launch_constraint_t LaunchKind;
108 typedef ::legion_specialized_constraint_t SpecializedKind;
113 template<
int DIM,
typename T>
class IndexSpaceT;
114 class IndexPartition;
115 template<
int DIM,
typename T>
class IndexPartitionT;
118 template<
int DIM,
typename T>
class LogicalRegionT;
119 class LogicalPartition;
120 template<
int DIM,
typename T>
class LogicalPartitionT;
121 class IndexAllocator;
122 class FieldAllocator;
129 struct RegionRequirement;
130 struct IndexSpaceRequirement;
131 struct FieldSpaceRequirement;
133 struct IndexTaskLauncher;
134 typedef IndexTaskLauncher IndexLauncher;
135 struct InlineLauncher;
137 struct AcquireLauncher;
138 struct ReleaseLauncher;
140 struct LayoutConstraintRegistrar;
141 struct TaskVariantRegistrar;
145 class PhysicalRegion;
146 class ExternalResources;
147 class UntypedDeferredValue;
150 template<
typename,
bool>
151 class DeferredReduction;
152 template<
typename,
int,
typename,
bool>
153 class DeferredBuffer;
154 template<
typename COORD_T>
155 class UntypedDeferredBuffer;
156 template<PrivilegeMode,
typename,
int,
typename,
typename,
bool>
158 template<
typename,
bool,
int,
typename,
typename,
bool>
159 class ReductionAccessor;
160 #ifdef LEGION_MULTI_REGION_ACCESSOR
161 template<
typename,
int,
typename,
typename,
bool,
bool,
int>
162 class MultiRegionAccessor;
164 template<
typename,
int,
typename,
typename>
166 namespace ArraySyntax {
171 template<
int,
typename>
173 template<PrivilegeMode,
typename,
int,
typename>
195 struct SerdezRedopFns;
197 template<
typename FT,
int N,
typename T = ::legion_coord_t>
198 using GenericAccessor = Realm::GenericAccessor<FT,N,T>;
199 template<
typename FT,
int N,
typename T = ::legion_coord_t>
200 using AffineAccessor = Realm::AffineAccessor<FT,N,T>;
201 template<
typename FT,
int N,
typename T = ::legion_coord_t>
202 using MultiAffineAccessor = Realm::MultiAffineAccessor<FT,N,T>;
211 class LegionTaskWrapper;
212 class LegionSerialization;
222 class IndexSpaceAllocator;
230 class ProcessorConstraint;
231 class ResourceConstraint;
232 class LaunchConstraint;
233 class ColocationConstraint;
234 class ExecutionConstraintSet;
236 class SpecializedConstraint;
237 class MemoryConstraint;
238 class FieldConstraint;
239 class OrderingConstraint;
240 class SplittingConstraint;
241 class DimensionConstraint;
242 class AlignmentConstraint;
243 class OffsetConstraint;
244 class PointerConstraint;
245 class LayoutConstraintSet;
246 class TaskLayoutConstraintSet;
249 class PhysicalInstance;
251 class ProfilingRequestSet;
262 enum ProfilingMeasurementID {
263 PMID_LEGION_FIRST = Realm::PMID_REALM_LAST,
264 PMID_RUNTIME_OVERHEAD,
274 OPEN_SINGLE_REDUCE = 3,
275 OPEN_MULTI_REDUCE = 4,
277 OPEN_READ_ONLY_PROJ = 5,
278 OPEN_READ_WRITE_PROJ = 6,
279 OPEN_READ_WRITE_PROJ_DISJOINT_SHALLOW = 7,
280 OPEN_REDUCE_PROJ = 8,
281 OPEN_REDUCE_PROJ_DIRTY = 9,
286 REDOP_ID_AVAILABLE = 1,
293 DEP_PART_UNION_REDUCTION = 2,
294 DEP_PART_INTERSECTION = 3,
295 DEP_PART_INTERSECTIONS = 4,
296 DEP_PART_INTERSECTION_REDUCTION = 5,
297 DEP_PART_DIFFERENCE = 6,
298 DEP_PART_DIFFERENCES = 7,
300 DEP_PART_BY_FIELD = 9,
301 DEP_PART_BY_IMAGE = 10,
302 DEP_PART_BY_IMAGE_RANGE = 11,
303 DEP_PART_BY_PREIMAGE = 12,
304 DEP_PART_BY_PREIMAGE_RANGE = 13,
305 DEP_PART_ASSOCIATION = 14,
306 DEP_PART_WEIGHTS = 15,
314 LG_TRIGGER_EXECUTION_ID,
315 LG_TRIGGER_RESOLUTION_ID,
316 LG_TRIGGER_COMMIT_ID,
317 LG_DEFERRED_EXECUTION_ID,
318 LG_DEFERRED_COMPLETION_ID,
319 LG_DEFERRED_COMMIT_ID,
320 LG_DEFERRED_COLLECT_ID,
322 LG_TRIGGER_DEPENDENCE_ID,
323 LG_TRIGGER_COMPLETION_ID,
326 LG_DEFER_MAPPER_SCHEDULER_TASK_ID,
332 LG_DEFERRED_FUTURE_SET_ID,
333 LG_DEFERRED_FUTURE_MAP_SET_ID,
334 LG_RESOLVE_FUTURE_PRED_ID,
335 LG_CONTRIBUTE_COLLECTIVE_ID,
336 LG_FUTURE_CALLBACK_TASK_ID,
337 LG_TOP_FINISH_TASK_ID,
339 LG_DISJOINTNESS_TASK_ID,
340 LG_DEFER_PHYSICAL_REGISTRATION_TASK_ID,
341 LG_PART_INDEPENDENCE_TASK_ID,
342 LG_SPACE_INDEPENDENCE_TASK_ID,
343 LG_PENDING_CHILD_TASK_ID,
344 LG_ISSUE_FRAME_TASK_ID,
345 LG_MAPPER_CONTINUATION_TASK_ID,
346 LG_TASK_IMPL_SEMANTIC_INFO_REQ_TASK_ID,
347 LG_INDEX_SPACE_SEMANTIC_INFO_REQ_TASK_ID,
348 LG_INDEX_PART_SEMANTIC_INFO_REQ_TASK_ID,
349 LG_FIELD_SPACE_SEMANTIC_INFO_REQ_TASK_ID,
350 LG_FIELD_SEMANTIC_INFO_REQ_TASK_ID,
351 LG_DEFER_FIELD_INFOS_TASK_ID,
352 LG_REGION_SEMANTIC_INFO_REQ_TASK_ID,
353 LG_PARTITION_SEMANTIC_INFO_REQ_TASK_ID,
354 LG_INDEX_SPACE_DEFER_CHILD_TASK_ID,
355 LG_INDEX_PART_DEFER_CHILD_TASK_ID,
356 LG_DEFERRED_ENQUEUE_TASK_ID,
357 LG_DEFER_MAPPER_MESSAGE_TASK_ID,
358 LG_REMOTE_VIEW_CREATION_TASK_ID,
359 LG_DEFERRED_DISTRIBUTE_TASK_ID,
360 LG_DEFER_PERFORM_MAPPING_TASK_ID,
361 LG_DEFERRED_LAUNCH_TASK_ID,
362 LG_MISSPECULATE_TASK_ID,
363 LG_DEFER_FIND_COPY_PRE_TASK_ID,
364 LG_DEFER_MATERIALIZED_VIEW_TASK_ID,
365 LG_DEFER_REDUCTION_VIEW_TASK_ID,
366 LG_DEFER_PHI_VIEW_REF_TASK_ID,
367 LG_DEFER_PHI_VIEW_REGISTRATION_TASK_ID,
368 LG_TIGHTEN_INDEX_SPACE_TASK_ID,
369 LG_REMOTE_PHYSICAL_REQUEST_TASK_ID,
370 LG_REMOTE_PHYSICAL_RESPONSE_TASK_ID,
371 LG_REPLAY_SLICE_TASK_ID,
372 LG_TRANSITIVE_REDUCTION_TASK_ID,
373 LG_DELETE_TEMPLATE_TASK_ID,
374 LG_REFINEMENT_TASK_ID,
375 LG_REMOTE_REF_TASK_ID,
376 LG_DEFER_RAY_TRACE_TASK_ID,
377 LG_DEFER_RAY_TRACE_FINISH_TASK_ID,
378 LG_DEFER_SUBSET_REQUEST_TASK_ID,
379 LG_DEFER_MAKE_OWNER_TASK_ID,
380 LG_DEFER_MERGE_OR_FORWARD_TASK_ID,
381 LG_DEFER_EQ_RESPONSE_TASK_ID,
382 LG_DEFER_REMOVE_EQ_REF_TASK_ID,
383 LG_DEFER_REMOTE_REF_UPDATE_TASK_ID,
384 LG_DEFER_REMOTE_UNREGISTER_TASK_ID,
385 LG_COPY_FILL_AGGREGATION_TASK_ID,
386 LG_COPY_FILL_DELETION_TASK_ID,
387 LG_FINALIZE_EQ_SETS_TASK_ID,
388 LG_DEFERRED_COPY_ACROSS_TASK_ID,
389 LG_DEFER_REMOTE_OP_DELETION_TASK_ID,
390 LG_DEFER_REMOTE_INSTANCE_TASK_ID,
391 LG_DEFER_REMOTE_REDUCTION_TASK_ID,
392 LG_DEFER_REMOTE_UPDATE_TASK_ID,
393 LG_DEFER_REMOTE_ACQUIRE_TASK_ID,
394 LG_DEFER_REMOTE_RELEASE_TASK_ID,
395 LG_DEFER_REMOTE_COPIES_ACROSS_TASK_ID,
396 LG_DEFER_REMOTE_OVERWRITE_TASK_ID,
397 LG_DEFER_REMOTE_FILTER_TASK_ID,
398 LG_DEFER_PERFORM_TRAVERSAL_TASK_ID,
399 LG_DEFER_PERFORM_REMOTE_TASK_ID,
400 LG_DEFER_PERFORM_UPDATE_TASK_ID,
401 LG_DEFER_PERFORM_OUTPUT_TASK_ID,
402 LG_DEFER_INDIVIDUAL_MANAGER_TASK_ID,
403 LG_DEFER_COLLECTIVE_MANAGER_TASK_ID,
404 LG_DEFER_VERIFY_PARTITION_TASK_ID,
405 LG_DEFER_RELEASE_ACQUIRED_TASK_ID,
406 LG_DEFER_COPY_ACROSS_TASK_ID,
407 LG_MALLOC_INSTANCE_TASK_ID,
408 LG_FREE_INSTANCE_TASK_ID,
411 LG_BEGIN_SHUTDOWN_TASK_IDS,
412 LG_RETRY_SHUTDOWN_TASK_ID = LG_BEGIN_SHUTDOWN_TASK_IDS,
421 #define LG_TASK_DESCRIPTIONS(name) \
422 const char *name[LG_LAST_TASK_ID] = { \
424 "Post-Task Execution", \
426 "Trigger Execution", \
427 "Trigger Resolution", \
429 "Deferred Execution", \
430 "Deferred Completion", \
432 "Garbage Collection", \
433 "Prepipeline Stage", \
434 "Logical Dependence Analysis", \
435 "Trigger Completion", \
436 "Trigger Operation Mapping", \
437 "Trigger Task Mapping", \
438 "Defer Mapper Scheduler", \
439 "Must Individual Task Dependence Analysis", \
440 "Must Index Task Dependence Analysis", \
441 "Must Task Physical Dependence Analysis", \
442 "Must Task Distribution", \
443 "Must Task Launch", \
444 "Deferred Future Set", \
445 "Deferred Future Map Set", \
446 "Resolve Future Predicate", \
447 "Contribute Collective", \
451 "Disjointness Test", \
452 "Defer Physical Registration", \
453 "Partition Independence Test", \
454 "Index Space Independence Test", \
455 "Remove Pending Child", \
457 "Mapper Continuation", \
458 "Task Impl Semantic Request", \
459 "Index Space Semantic Request", \
460 "Index Partition Semantic Request", \
461 "Field Space Semantic Request", \
462 "Field Semantic Request", \
463 "Defer Field Infos Request", \
464 "Region Semantic Request", \
465 "Partition Semantic Request", \
466 "Defer Index Space Child Request", \
467 "Defer Index Partition Child Request", \
468 "Deferred Enqueue Task", \
469 "Deferred Mapper Message", \
470 "Remote View Creation", \
471 "Deferred Distribute Task", \
472 "Defer Task Perform Mapping", \
473 "Deferred Task Launch", \
474 "Handle Mapping Misspeculation", \
475 "Defer Find Copy Preconditions", \
476 "Defer Materialized View Registration", \
477 "Defer Reduction View Registration", \
478 "Defer Phi View Reference", \
479 "Defer Phi View Registration", \
480 "Tighten Index Space", \
481 "Remote Physical Context Request", \
482 "Remote Physical Context Response", \
483 "Replay Physical Trace", \
484 "Template Transitive Reduction", \
485 "Delete Physical Template", \
487 "Remove Remote References", \
489 "Defer Ray Trace Finish", \
490 "Defer Subset Request", \
491 "Defer Make Owner", \
492 "Defer Merge or Forward", \
493 "Defer Equivalence Set Response", \
494 "Defer Remove Equivalence Set Expression References", \
495 "Defer Remote Reference Update", \
496 "Defer Remote Unregister", \
497 "Copy Fill Aggregation", \
498 "Copy Fill Deletion", \
499 "Finalize Equivalence Sets", \
500 "Deferred Copy Across", \
501 "Defer Remote Op Deletion", \
502 "Defer Remote Instance Request", \
503 "Defer Remote Reduction Request", \
504 "Defer Remote Update Equivalence Set", \
505 "Defer Remote Acquire", \
506 "Defer Remote Release", \
507 "Defer Remote Copy Across", \
508 "Defer Remote Overwrite Equivalence Set", \
509 "Defer Remote Filter Equivalence Set", \
510 "Defer Physical Analysis Traversal Stage", \
511 "Defer Physical Analysis Remote Stage", \
512 "Defer Physical Analysis Update Stage", \
513 "Defer Physical Analysis Output Stage", \
514 "Defer Instance Manager Registration", \
515 "Defer Reduction Manager Registration", \
516 "Defer Verify Partition", \
517 "Defer Release Acquired Instances", \
518 "Defer Copy-Across Execution for Preimages", \
526 enum MappingCallKind {
527 GET_MAPPER_NAME_CALL,
528 GET_MAPER_SYNC_MODEL_CALL,
529 SELECT_TASK_OPTIONS_CALL,
535 TASK_SELECT_SOURCES_CALL,
537 TASK_REPORT_PROFILING_CALL,
539 INLINE_SELECT_SOURCES_CALL,
540 INLINE_REPORT_PROFILING_CALL,
542 COPY_SELECT_SOURCES_CALL,
544 COPY_REPORT_PROFILING_CALL,
545 CLOSE_SELECT_SOURCES_CALL,
546 CLOSE_REPORT_PROFILING_CALL,
548 ACQUIRE_SPECULATE_CALL,
549 ACQUIRE_REPORT_PROFILING_CALL,
551 RELEASE_SELECT_SOURCES_CALL,
552 RELEASE_SPECULATE_CALL,
553 RELEASE_REPORT_PROFILING_CALL,
554 SELECT_PARTITION_PROJECTION_CALL,
556 PARTITION_SELECT_SOURCES_CALL,
557 PARTITION_REPORT_PROFILING_CALL,
558 CONFIGURE_CONTEXT_CALL,
559 SELECT_TUNABLE_VALUE_CALL,
561 MAP_DATAFLOW_GRAPH_CALL,
562 MEMOIZE_OPERATION_CALL,
563 SELECT_TASKS_TO_MAP_CALL,
564 SELECT_STEAL_TARGETS_CALL,
565 PERMIT_STEAL_REQUEST_CALL,
567 HANDLE_TASK_RESULT_CALL,
568 APPLICATION_MAPPER_CALL,
572 #define MAPPER_CALL_NAMES(name) \
573 const char *name[LAST_MAPPER_CALL] = { \
575 "get_mapper_sync_model", \
576 "select_task_options", \
580 "select_task_variant", \
582 "select_task_sources", \
583 "speculate (for task)", \
584 "report profiling (for task)", \
586 "select_inline_sources", \
587 "report profiling (for inline)", \
589 "select_copy_sources", \
590 "speculate (for copy)", \
591 "report_profiling (for copy)", \
592 "select_close_sources", \
593 "report_profiling (for close)", \
595 "speculate (for acquire)", \
596 "report_profiling (for acquire)", \
598 "select_release_sources", \
599 "speculate (for release)", \
600 "report_profiling (for release)", \
601 "select partition projection", \
603 "select_partition_sources", \
604 "report_profiling (for partition)", \
605 "configure_context", \
606 "select_tunable_value", \
608 "map_dataflow_graph", \
609 "memoize_operation", \
610 "select_tasks_to_map", \
611 "select_steal_targets", \
612 "permit_steal_request", \
614 "handle_task_result", \
615 "application mapper call", \
641 LG_MIN_PRIORITY = INT_MIN,
642 LG_LOW_PRIORITY = -1,
644 LG_THROUGHPUT_WORK_PRIORITY = 0,
645 LG_THROUGHPUT_DEFERRED_PRIORITY = 1,
646 LG_THROUGHPUT_MESSAGE_PRIORITY = 2,
647 LG_THROUGHPUT_RESPONSE_PRIORITY = 3,
649 LG_LATENCY_WORK_PRIORITY = 4,
650 LG_LATENCY_DEFERRED_PRIORITY = 5,
651 LG_LATENCY_MESSAGE_PRIORITY = 6,
652 LG_LATENCY_RESPONSE_PRIORITY = 7,
654 LG_RESOURCE_PRIORITY = 8,
656 LG_RUNNING_PRIORITY = 9,
659 enum VirtualChannelKind {
661 DEFAULT_VIRTUAL_CHANNEL = 0,
662 THROUGHPUT_VIRTUAL_CHANNEL = 1,
663 LAST_UNORDERED_VIRTUAL_CHANNEL = THROUGHPUT_VIRTUAL_CHANNEL,
665 MAPPER_VIRTUAL_CHANNEL = 1,
666 TASK_VIRTUAL_CHANNEL = 2,
667 FIELD_SPACE_VIRTUAL_CHANNEL = 4,
668 REFERENCE_VIRTUAL_CHANNEL = 6,
669 UPDATE_VIRTUAL_CHANNEL = 7,
670 SUBSET_VIRTUAL_CHANNEL = 8,
671 CONTEXT_VIRTUAL_CHANNEL = 9,
672 LAYOUT_CONSTRAINT_VIRTUAL_CHANNEL = 10,
673 EXPRESSION_VIRTUAL_CHANNEL = 11,
674 MIGRATION_VIRTUAL_CHANNEL = 12,
675 TRACING_VIRTUAL_CHANNEL = 13,
676 MAX_NUM_VIRTUAL_CHANNELS = 14,
682 ADVERTISEMENT_MESSAGE,
683 SEND_REGISTRATION_CALLBACK,
684 SEND_REMOTE_TASK_REPLAY,
685 SEND_REMOTE_TASK_PROFILING_RESPONSE,
686 SEND_SHARED_OWNERSHIP,
687 SEND_INDEX_SPACE_REQUEST,
688 SEND_INDEX_SPACE_RETURN,
689 SEND_INDEX_SPACE_SET,
690 SEND_INDEX_SPACE_CHILD_REQUEST,
691 SEND_INDEX_SPACE_CHILD_RESPONSE,
692 SEND_INDEX_SPACE_COLORS_REQUEST,
693 SEND_INDEX_SPACE_COLORS_RESPONSE,
694 SEND_INDEX_SPACE_REMOTE_EXPRESSION_REQUEST,
695 SEND_INDEX_SPACE_REMOTE_EXPRESSION_RESPONSE,
696 SEND_INDEX_SPACE_GENERATE_COLOR_REQUEST,
697 SEND_INDEX_SPACE_GENERATE_COLOR_RESPONSE,
698 SEND_INDEX_SPACE_RELEASE_COLOR,
699 SEND_INDEX_PARTITION_NOTIFICATION,
700 SEND_INDEX_PARTITION_REQUEST,
701 SEND_INDEX_PARTITION_RETURN,
702 SEND_INDEX_PARTITION_CHILD_REQUEST,
703 SEND_INDEX_PARTITION_CHILD_RESPONSE,
704 SEND_INDEX_PARTITION_DISJOINT_UPDATE,
705 SEND_FIELD_SPACE_NODE,
706 SEND_FIELD_SPACE_REQUEST,
707 SEND_FIELD_SPACE_RETURN,
708 SEND_FIELD_SPACE_ALLOCATOR_REQUEST,
709 SEND_FIELD_SPACE_ALLOCATOR_RESPONSE,
710 SEND_FIELD_SPACE_ALLOCATOR_INVALIDATION,
711 SEND_FIELD_SPACE_ALLOCATOR_FLUSH,
712 SEND_FIELD_SPACE_ALLOCATOR_FREE,
713 SEND_FIELD_SPACE_INFOS_REQUEST,
714 SEND_FIELD_SPACE_INFOS_RESPONSE,
715 SEND_FIELD_ALLOC_REQUEST,
716 SEND_FIELD_SIZE_UPDATE,
718 SEND_FIELD_FREE_INDEXES,
719 SEND_FIELD_SPACE_LAYOUT_INVALIDATION,
720 SEND_LOCAL_FIELD_ALLOC_REQUEST,
721 SEND_LOCAL_FIELD_ALLOC_RESPONSE,
722 SEND_LOCAL_FIELD_FREE,
723 SEND_LOCAL_FIELD_UPDATE,
724 SEND_TOP_LEVEL_REGION_REQUEST,
725 SEND_TOP_LEVEL_REGION_RETURN,
726 INDEX_SPACE_DESTRUCTION_MESSAGE,
727 INDEX_PARTITION_DESTRUCTION_MESSAGE,
728 FIELD_SPACE_DESTRUCTION_MESSAGE,
729 LOGICAL_REGION_DESTRUCTION_MESSAGE,
730 INDIVIDUAL_REMOTE_COMPLETE,
731 INDIVIDUAL_REMOTE_COMMIT,
733 SLICE_REMOTE_COMPLETE,
735 SLICE_FIND_INTRA_DEP,
736 SLICE_RECORD_INTRA_DEP,
737 SLICE_COLLECTIVE_REQUEST,
738 SLICE_COLLECTIVE_RESPONSE,
739 DISTRIBUTED_REMOTE_REGISTRATION,
740 DISTRIBUTED_VALID_UPDATE,
741 DISTRIBUTED_GC_UPDATE,
742 DISTRIBUTED_RESOURCE_UPDATE,
743 DISTRIBUTED_CREATE_ADD,
744 DISTRIBUTED_CREATE_REMOVE,
745 DISTRIBUTED_UNREGISTER,
746 SEND_ATOMIC_RESERVATION_REQUEST,
747 SEND_ATOMIC_RESERVATION_RESPONSE,
748 SEND_BACK_LOGICAL_STATE,
749 SEND_MATERIALIZED_VIEW,
753 SEND_INSTANCE_MANAGER,
754 SEND_COLLECTIVE_MANAGER,
755 SEND_COLLECTIVE_MESSAGE,
756 SEND_CREATE_TOP_VIEW_REQUEST,
757 SEND_CREATE_TOP_VIEW_RESPONSE,
759 SEND_VIEW_REGISTER_USER,
760 SEND_VIEW_FIND_COPY_PRE_REQUEST,
761 SEND_VIEW_FIND_COPY_PRE_RESPONSE,
762 SEND_VIEW_ADD_COPY_USER,
763 SEND_VIEW_REPLICATION_REQUEST,
764 SEND_VIEW_REPLICATION_RESPONSE,
765 SEND_VIEW_REPLICATION_REMOVAL,
766 SEND_MANAGER_REQUEST,
768 SEND_FUTURE_SUBSCRIPTION,
769 SEND_FUTURE_NOTIFICATION,
770 SEND_FUTURE_BROADCAST,
771 SEND_FUTURE_MAP_REQUEST,
772 SEND_FUTURE_MAP_RESPONSE,
774 SEND_MAPPER_BROADCAST,
775 SEND_TASK_IMPL_SEMANTIC_REQ,
776 SEND_INDEX_SPACE_SEMANTIC_REQ,
777 SEND_INDEX_PARTITION_SEMANTIC_REQ,
778 SEND_FIELD_SPACE_SEMANTIC_REQ,
779 SEND_FIELD_SEMANTIC_REQ,
780 SEND_LOGICAL_REGION_SEMANTIC_REQ,
781 SEND_LOGICAL_PARTITION_SEMANTIC_REQ,
782 SEND_TASK_IMPL_SEMANTIC_INFO,
783 SEND_INDEX_SPACE_SEMANTIC_INFO,
784 SEND_INDEX_PARTITION_SEMANTIC_INFO,
785 SEND_FIELD_SPACE_SEMANTIC_INFO,
786 SEND_FIELD_SEMANTIC_INFO,
787 SEND_LOGICAL_REGION_SEMANTIC_INFO,
788 SEND_LOGICAL_PARTITION_SEMANTIC_INFO,
789 SEND_REMOTE_CONTEXT_REQUEST,
790 SEND_REMOTE_CONTEXT_RESPONSE,
791 SEND_REMOTE_CONTEXT_RELEASE,
792 SEND_REMOTE_CONTEXT_FREE,
793 SEND_REMOTE_CONTEXT_PHYSICAL_REQUEST,
794 SEND_REMOTE_CONTEXT_PHYSICAL_RESPONSE,
795 SEND_COMPUTE_EQUIVALENCE_SETS_REQUEST,
796 SEND_EQUIVALENCE_SET_REQUEST,
797 SEND_EQUIVALENCE_SET_RESPONSE,
798 SEND_EQUIVALENCE_SET_SUBSET_REQUEST,
799 SEND_EQUIVALENCE_SET_SUBSET_RESPONSE,
800 SEND_EQUIVALENCE_SET_SUBSET_UPDATE,
801 SEND_EQUIVALENCE_SET_RAY_TRACE_REQUEST,
802 SEND_EQUIVALENCE_SET_RAY_TRACE_RESPONSE,
803 SEND_EQUIVALENCE_SET_MIGRATION,
804 SEND_EQUIVALENCE_SET_OWNER_UPDATE,
805 SEND_EQUIVALENCE_SET_REMOTE_REFINEMENT,
806 SEND_EQUIVALENCE_SET_REMOTE_REQUEST_INSTANCES,
807 SEND_EQUIVALENCE_SET_REMOTE_REQUEST_INVALID,
808 SEND_EQUIVALENCE_SET_REMOTE_UPDATES,
809 SEND_EQUIVALENCE_SET_REMOTE_ACQUIRES,
810 SEND_EQUIVALENCE_SET_REMOTE_RELEASES,
811 SEND_EQUIVALENCE_SET_REMOTE_COPIES_ACROSS,
812 SEND_EQUIVALENCE_SET_REMOTE_OVERWRITES,
813 SEND_EQUIVALENCE_SET_REMOTE_FILTERS,
814 SEND_EQUIVALENCE_SET_REMOTE_INSTANCES,
815 SEND_EQUIVALENCE_SET_STALE_UPDATE,
816 SEND_INSTANCE_REQUEST,
817 SEND_INSTANCE_RESPONSE,
818 SEND_EXTERNAL_CREATE_REQUEST,
819 SEND_EXTERNAL_CREATE_RESPONSE,
820 SEND_EXTERNAL_ATTACH,
821 SEND_EXTERNAL_DETACH,
822 SEND_GC_PRIORITY_UPDATE,
827 SEND_GC_DEBUG_REQUEST,
828 SEND_GC_DEBUG_RESPONSE,
829 SEND_ACQUIRE_REQUEST,
830 SEND_ACQUIRE_RESPONSE,
831 SEND_VARIANT_BROADCAST,
832 SEND_CONSTRAINT_REQUEST,
833 SEND_CONSTRAINT_RESPONSE,
834 SEND_CONSTRAINT_RELEASE,
835 SEND_TOP_LEVEL_TASK_REQUEST,
836 SEND_TOP_LEVEL_TASK_COMPLETE,
837 SEND_MPI_RANK_EXCHANGE,
838 SEND_LIBRARY_MAPPER_REQUEST,
839 SEND_LIBRARY_MAPPER_RESPONSE,
840 SEND_LIBRARY_TRACE_REQUEST,
841 SEND_LIBRARY_TRACE_RESPONSE,
842 SEND_LIBRARY_PROJECTION_REQUEST,
843 SEND_LIBRARY_PROJECTION_RESPONSE,
844 SEND_LIBRARY_TASK_REQUEST,
845 SEND_LIBRARY_TASK_RESPONSE,
846 SEND_LIBRARY_REDOP_REQUEST,
847 SEND_LIBRARY_REDOP_RESPONSE,
848 SEND_LIBRARY_SERDEZ_REQUEST,
849 SEND_LIBRARY_SERDEZ_RESPONSE,
850 SEND_REMOTE_OP_REPORT_UNINIT,
851 SEND_REMOTE_OP_PROFILING_COUNT_UPDATE,
852 SEND_REMOTE_TRACE_UPDATE,
853 SEND_REMOTE_TRACE_RESPONSE,
854 SEND_REMOTE_TRACE_EQ_REQUEST,
855 SEND_REMOTE_TRACE_EQ_RESPONSE,
856 SEND_SHUTDOWN_NOTIFICATION,
857 SEND_SHUTDOWN_RESPONSE,
861 #define LG_MESSAGE_DESCRIPTIONS(name) \
862 const char *name[LAST_SEND_KIND] = { \
865 "Advertisement Message", \
866 "Send Registration Callback", \
867 "Send Remote Task Replay", \
868 "Send Remote Task Profiling Response", \
869 "Send Shared Ownership", \
870 "Send Index Space Request", \
871 "Send Index Space Return", \
872 "Send Index Space Set", \
873 "Send Index Space Child Request", \
874 "Send Index Space Child Response", \
875 "Send Index Space Colors Request", \
876 "Send Index Space Colors Response", \
877 "Send Index Space Remote Expression Request", \
878 "Send Index Space Remote Expression Response", \
879 "Send Index Space Generate Color Request", \
880 "Send Index Space Generate Color Response", \
881 "Send Index Space Release Color", \
882 "Send Index Partition Notification", \
883 "Send Index Partition Request", \
884 "Send Index Partition Return", \
885 "Send Index Partition Child Request", \
886 "Send Index Partition Child Response", \
887 "Send Index Partition Disjoint Update", \
888 "Send Field Space Node", \
889 "Send Field Space Request", \
890 "Send Field Space Return", \
891 "Send Field Space Allocator Request", \
892 "Send Field Space Allocator Response", \
893 "Send Field Space Allocator Invalidation", \
894 "Send Field Space Allocator Flush", \
895 "Send Field Space Allocator Free", \
896 "Send Field Space Infos Request", \
897 "Send Field Space Infos Response", \
898 "Send Field Alloc Request", \
899 "Send Field Size Update", \
901 "Send Field Free Indexes", \
902 "Send Field Space Layout Invalidation", \
903 "Send Local Field Alloc Request", \
904 "Send Local Field Alloc Response", \
905 "Send Local Field Free", \
906 "Send Local Field Update", \
907 "Send Top Level Region Request", \
908 "Send Top Level Region Return", \
909 "Index Space Destruction", \
910 "Index Partition Destruction", \
911 "Field Space Destruction", \
912 "Logical Region Destruction", \
913 "Individual Remote Complete", \
914 "Individual Remote Commit", \
915 "Slice Remote Mapped", \
916 "Slice Remote Complete", \
917 "Slice Remote Commit", \
918 "Slice Find Intra-Space Dependence", \
919 "Slice Record Intra-Space Dependence", \
920 "Slice Collective Instance Request", \
921 "Slice Collective Instance Response", \
922 "Distributed Remote Registration", \
923 "Distributed Valid Update", \
924 "Distributed GC Update", \
925 "Distributed Resource Update", \
926 "Distributed Create Add", \
927 "Distributed Create Remove", \
928 "Distributed Unregister", \
929 "Send Atomic Reservation Request", \
930 "Send Atomic Reservation Response", \
931 "Send Back Logical State", \
932 "Send Materialized View", \
935 "Send Reduction View", \
936 "Send Instance Manager", \
937 "Send Collective Instance Manager", \
938 "Send Collective Instance Message", \
939 "Send Create Top View Request", \
940 "Send Create Top View Response", \
941 "Send View Request", \
942 "Send View Register User", \
943 "Send View Find Copy Preconditions Request", \
944 "Send View Find Copy Preconditions Response", \
945 "Send View Add Copy User", \
946 "Send View Replication Request", \
947 "Send View Replication Response", \
948 "Send View Replication Removal", \
949 "Send Manager Request", \
950 "Send Future Result", \
951 "Send Future Subscription", \
952 "Send Future Notification", \
953 "Send Future Broadcast", \
954 "Send Future Map Future Request", \
955 "Send Future Map Future Response", \
956 "Send Mapper Message", \
957 "Send Mapper Broadcast", \
958 "Send Task Impl Semantic Req", \
959 "Send Index Space Semantic Req", \
960 "Send Index Partition Semantic Req", \
961 "Send Field Space Semantic Req", \
962 "Send Field Semantic Req", \
963 "Send Logical Region Semantic Req", \
964 "Send Logical Partition Semantic Req", \
965 "Send Task Impl Semantic Info", \
966 "Send Index Space Semantic Info", \
967 "Send Index Partition Semantic Info", \
968 "Send Field Space Semantic Info", \
969 "Send Field Semantic Info", \
970 "Send Logical Region Semantic Info", \
971 "Send Logical Partition Semantic Info", \
972 "Send Remote Context Request", \
973 "Send Remote Context Response", \
974 "Send Remote Context Release", \
975 "Send Remote Context Free", \
976 "Send Remote Context Physical Request", \
977 "Send Remote Context Physical Response", \
978 "Compute Equivalence Sets Request", \
979 "Send Equivalence Set Request", \
980 "Send Equivalence Set Response", \
981 "Send Equivalence Set Subset Request", \
982 "Send Equivalence Set Subset Response", \
983 "Send Equivalence Set Subset Update", \
984 "Send Equivalence Set Ray Trace Request", \
985 "Send Equivalence Set Ray Trace Response", \
986 "Send Equivalence Set Migration", \
987 "Send Equivalence Set Owner Update", \
988 "Send Equivalence Set Remote Refinement", \
989 "Send Equivalence Set Remote Request Instances", \
990 "Send Equivalence Set Remote Request Invalid", \
991 "Send Equivalence Set Remote Updates", \
992 "Send Equivalence Set Remote Acquires", \
993 "Send Equivalence Set Remote Releases", \
994 "Send Equivalence Set Remote Copies Across", \
995 "Send Equivalence Set Remote Overwrites", \
996 "Send Equivalence Set Remote Filters", \
997 "Send Equivalence Set Remote Instances", \
998 "Send Equivalence Set Stale Update", \
999 "Send Instance Request", \
1000 "Send Instance Response", \
1001 "Send External Create Request", \
1002 "Send External Create Response", \
1003 "Send External Attach", \
1004 "Send External Detach", \
1005 "Send GC Priority Update", \
1006 "Send GC Request", \
1007 "Send GC Response", \
1008 "Send GC Acquire Request", \
1009 "Send GC Acquire Response", \
1010 "Send GC Debug Request", \
1011 "Send GC Debug Response", \
1012 "Send Acquire Request", \
1013 "Send Acquire Response", \
1014 "Send Task Variant Broadcast", \
1015 "Send Constraint Request", \
1016 "Send Constraint Response", \
1017 "Send Constraint Release", \
1018 "Top Level Task Request", \
1019 "Top Level Task Complete", \
1020 "Send MPI Rank Exchange", \
1021 "Send Library Mapper Request", \
1022 "Send Library Mapper Response", \
1023 "Send Library Trace Request", \
1024 "Send Library Trace Response", \
1025 "Send Library Projection Request", \
1026 "Send Library Projection Response", \
1027 "Send Library Task Request", \
1028 "Send Library Task Response", \
1029 "Send Library Redop Request", \
1030 "Send Library Redop Response", \
1031 "Send Library Serdez Request", \
1032 "Send Library Serdez Response", \
1033 "Remote Op Report Uninitialized", \
1034 "Remote Op Profiling Count Update", \
1035 "Send Remote Trace Update", \
1036 "Send Remote Trace Response", \
1037 "Send Remote Trace Equivalence Sets Request", \
1038 "Send Remote Trace Equivalence Sets Response", \
1039 "Send Shutdown Notification", \
1040 "Send Shutdown Response", \
1045 LG_INITIALIZE_TASK_ID = Realm::Processor::TASK_ID_PROCESSOR_INIT,
1046 LG_SHUTDOWN_TASK_ID = Realm::Processor::TASK_ID_PROCESSOR_SHUTDOWN,
1047 LG_TASK_ID = Realm::Processor::TASK_ID_FIRST_AVAILABLE,
1048 #ifdef LEGION_SEPARATE_META_TASKS
1049 LG_LEGION_PROFILING_ID = LG_TASK_ID+LG_LAST_TASK_ID+LAST_SEND_KIND,
1050 LG_STARTUP_TASK_ID = LG_TASK_ID+LG_LAST_TASK_ID+LAST_SEND_KIND+1,
1051 LG_ENDPOINT_TASK_ID = LG_TASK_ID+LG_LAST_TASK_ID+LAST_SEND_KIND+2,
1052 LG_APP_PROC_TASK_ID = LG_TASK_ID+LG_LAST_TASK_ID+LAST_SEND_KIND+3,
1053 LG_TASK_ID_AVAILABLE = LG_APP_PROC_TASK_ID+LG_LAST_TASK_ID,
1055 LG_LEGION_PROFILING_ID = LG_TASK_ID+1,
1056 LG_STARTUP_TASK_ID = LG_TASK_ID+2,
1057 LG_ENDPOINT_TASK_ID = LG_TASK_ID+3,
1058 LG_APP_PROC_TASK_ID = LG_TASK_ID+4,
1059 LG_TASK_ID_AVAILABLE = LG_TASK_ID+5,
1063 enum RuntimeCallKind {
1064 PACK_BASE_TASK_CALL,
1065 UNPACK_BASE_TASK_CALL,
1066 TASK_PRIVILEGE_CHECK_CALL,
1068 COMPUTE_POINT_REQUIREMENTS_CALL,
1069 EARLY_MAP_REGIONS_CALL,
1070 INTRA_TASK_ALIASING_CALL,
1071 ACTIVATE_SINGLE_CALL,
1072 DEACTIVATE_SINGLE_CALL,
1073 SELECT_INLINE_VARIANT_CALL,
1074 INLINE_CHILD_TASK_CALL,
1075 PACK_SINGLE_TASK_CALL,
1076 UNPACK_SINGLE_TASK_CALL,
1077 PACK_REMOTE_CONTEXT_CALL,
1078 HAS_CONFLICTING_INTERNAL_CALL,
1079 FIND_CONFLICTING_CALL,
1080 FIND_CONFLICTING_INTERNAL_CALL,
1081 CHECK_REGION_DEPENDENCE_CALL,
1082 FIND_PARENT_REGION_REQ_CALL,
1083 FIND_PARENT_REGION_CALL,
1084 CHECK_PRIVILEGE_CALL,
1085 TRIGGER_SINGLE_CALL,
1086 INITIALIZE_MAP_TASK_CALL,
1087 FINALIZE_MAP_TASK_CALL,
1088 VALIDATE_VARIANT_SELECTION_CALL,
1089 MAP_ALL_REGIONS_CALL,
1090 INITIALIZE_REGION_TREE_CONTEXTS_CALL,
1091 INVALIDATE_REGION_TREE_CONTEXTS_CALL,
1092 CREATE_INSTANCE_TOP_VIEW_CALL,
1094 ACTIVATE_MULTI_CALL,
1095 DEACTIVATE_MULTI_CALL,
1096 SLICE_INDEX_SPACE_CALL,
1098 MULTI_TRIGGER_EXECUTION_CALL,
1101 ACTIVATE_INDIVIDUAL_CALL,
1102 DEACTIVATE_INDIVIDUAL_CALL,
1103 INDIVIDUAL_PERFORM_MAPPING_CALL,
1104 INDIVIDUAL_RETURN_VIRTUAL_CALL,
1105 INDIVIDUAL_TRIGGER_COMPLETE_CALL,
1106 INDIVIDUAL_TRIGGER_COMMIT_CALL,
1107 INDIVIDUAL_POST_MAPPED_CALL,
1108 INDIVIDUAL_PACK_TASK_CALL,
1109 INDIVIDUAL_UNPACK_TASK_CALL,
1110 INDIVIDUAL_PACK_REMOTE_COMPLETE_CALL,
1111 INDIVIDUAL_UNPACK_REMOTE_COMPLETE_CALL,
1112 POINT_ACTIVATE_CALL,
1113 POINT_DEACTIVATE_CALL,
1114 POINT_TASK_COMPLETE_CALL,
1115 POINT_TASK_COMMIT_CALL,
1116 POINT_PACK_TASK_CALL,
1117 POINT_UNPACK_TASK_CALL,
1118 POINT_TASK_POST_MAPPED_CALL,
1119 REMOTE_TASK_ACTIVATE_CALL,
1120 REMOTE_TASK_DEACTIVATE_CALL,
1121 REMOTE_UNPACK_CONTEXT_CALL,
1122 INDEX_ACTIVATE_CALL,
1123 INDEX_DEACTIVATE_CALL,
1124 INDEX_COMPUTE_FAT_PATH_CALL,
1125 INDEX_EARLY_MAP_TASK_CALL,
1126 INDEX_DISTRIBUTE_CALL,
1127 INDEX_PERFORM_MAPPING_CALL,
1128 INDEX_COMPLETE_CALL,
1130 INDEX_PERFORM_INLINING_CALL,
1131 INDEX_CLONE_AS_SLICE_CALL,
1132 INDEX_HANDLE_FUTURE,
1133 INDEX_RETURN_SLICE_MAPPED_CALL,
1134 INDEX_RETURN_SLICE_COMPLETE_CALL,
1135 INDEX_RETURN_SLICE_COMMIT_CALL,
1136 SLICE_ACTIVATE_CALL,
1137 SLICE_DEACTIVATE_CALL,
1138 SLICE_APPLY_VERSION_INFO_CALL,
1139 SLICE_DISTRIBUTE_CALL,
1140 SLICE_PERFORM_MAPPING_CALL,
1142 SLICE_MAP_AND_LAUNCH_CALL,
1143 SLICE_PACK_TASK_CALL,
1144 SLICE_UNPACK_TASK_CALL,
1145 SLICE_CLONE_AS_SLICE_CALL,
1146 SLICE_HANDLE_FUTURE_CALL,
1147 SLICE_CLONE_AS_POINT_CALL,
1148 SLICE_ENUMERATE_POINTS_CALL,
1150 SLICE_COMPLETE_CALL,
1152 REALM_SPAWN_META_CALL,
1153 REALM_SPAWN_TASK_CALL,
1154 REALM_CREATE_INSTANCE_CALL,
1155 REALM_ISSUE_COPY_CALL,
1156 REALM_ISSUE_FILL_CALL,
1157 REGION_TREE_LOGICAL_ANALYSIS_CALL,
1158 REGION_TREE_LOGICAL_FENCE_CALL,
1159 REGION_TREE_VERSIONING_ANALYSIS_CALL,
1160 REGION_TREE_ADVANCE_VERSION_NUMBERS_CALL,
1161 REGION_TREE_INITIALIZE_CONTEXT_CALL,
1162 REGION_TREE_INVALIDATE_CONTEXT_CALL,
1163 REGION_TREE_PREMAP_ONLY_CALL,
1164 REGION_TREE_PHYSICAL_REGISTER_ONLY_CALL,
1165 REGION_TREE_PHYSICAL_REGISTER_USERS_CALL,
1166 REGION_TREE_PHYSICAL_PERFORM_CLOSE_CALL,
1167 REGION_TREE_PHYSICAL_CLOSE_CONTEXT_CALL,
1168 REGION_TREE_PHYSICAL_COPY_ACROSS_CALL,
1169 REGION_TREE_PHYSICAL_REDUCE_ACROSS_CALL,
1170 REGION_TREE_PHYSICAL_CONVERT_MAPPING_CALL,
1171 REGION_TREE_PHYSICAL_FILL_FIELDS_CALL,
1172 REGION_TREE_PHYSICAL_ATTACH_EXTERNAL_CALL,
1173 REGION_TREE_PHYSICAL_DETACH_EXTERNAL_CALL,
1174 REGION_NODE_REGISTER_LOGICAL_USER_CALL,
1175 REGION_NODE_CLOSE_LOGICAL_NODE_CALL,
1176 REGION_NODE_SIPHON_LOGICAL_CHILDREN_CALL,
1177 REGION_NODE_SIPHON_LOGICAL_PROJECTION_CALL,
1178 REGION_NODE_PERFORM_LOGICAL_CLOSES_CALL,
1179 REGION_NODE_FIND_VALID_INSTANCE_VIEWS_CALL,
1180 REGION_NODE_FIND_VALID_REDUCTION_VIEWS_CALL,
1181 REGION_NODE_ISSUE_UPDATE_COPIES_CALL,
1182 REGION_NODE_SORT_COPY_INSTANCES_CALL,
1183 REGION_NODE_ISSUE_GROUPED_COPIES_CALL,
1184 REGION_NODE_ISSUE_UPDATE_REDUCTIONS_CALL,
1185 REGION_NODE_PREMAP_REGION_CALL,
1186 REGION_NODE_REGISTER_REGION_CALL,
1187 REGION_NODE_CLOSE_STATE_CALL,
1188 CURRENT_STATE_RECORD_VERSION_NUMBERS_CALL,
1189 CURRENT_STATE_ADVANCE_VERSION_NUMBERS_CALL,
1190 PHYSICAL_STATE_CAPTURE_STATE_CALL,
1191 PHYSICAL_STATE_APPLY_PATH_ONLY_CALL,
1192 PHYSICAL_STATE_APPLY_STATE_CALL,
1193 PHYSICAL_STATE_MAKE_LOCAL_CALL,
1194 MATERIALIZED_VIEW_FIND_LOCAL_PRECONDITIONS_CALL,
1195 MATERIALIZED_VIEW_FIND_LOCAL_COPY_PRECONDITIONS_CALL,
1196 MATERIALIZED_VIEW_FILTER_PREVIOUS_USERS_CALL,
1197 MATERIALIZED_VIEW_FILTER_CURRENT_USERS_CALL,
1198 MATERIALIZED_VIEW_FILTER_LOCAL_USERS_CALL,
1199 REDUCTION_VIEW_PERFORM_REDUCTION_CALL,
1200 REDUCTION_VIEW_PERFORM_DEFERRED_REDUCTION_CALL,
1201 REDUCTION_VIEW_PERFORM_DEFERRED_REDUCTION_ACROSS_CALL,
1202 REDUCTION_VIEW_FIND_COPY_PRECONDITIONS_CALL,
1203 REDUCTION_VIEW_FIND_USER_PRECONDITIONS_CALL,
1204 REDUCTION_VIEW_FILTER_LOCAL_USERS_CALL,
1205 PHYSICAL_TRACE_EXECUTE_CALL,
1206 PHYSICAL_TRACE_PRECONDITION_CHECK_CALL,
1207 PHYSICAL_TRACE_OPTIMIZE_CALL,
1208 LAST_RUNTIME_CALL_KIND,
1211 #define RUNTIME_CALL_DESCRIPTIONS(name) \
1212 const char *name[LAST_RUNTIME_CALL_KIND] = { \
1214 "Unpack Base Task", \
1215 "Task Privilege Check", \
1216 "Clone Base Task", \
1217 "Compute Point Requirements", \
1218 "Early Map Regions", \
1219 "Intra-Task Aliasing", \
1220 "Activate Single", \
1221 "Deactivate Single", \
1222 "Select Inline Variant", \
1223 "Inline Child Task", \
1224 "Pack Single Task", \
1225 "Unpack Single Task", \
1226 "Pack Remote Context", \
1227 "Has Conflicting Internal", \
1228 "Find Conflicting", \
1229 "Find Conflicting Internal", \
1230 "Check Region Dependence", \
1231 "Find Parent Region Requirement", \
1232 "Find Parent Region", \
1233 "Check Privilege", \
1235 "Initialize Map Task", \
1236 "Finalized Map Task", \
1237 "Validate Variant Selection", \
1238 "Map All Regions", \
1239 "Initialize Region Tree Contexts", \
1240 "Invalidate Region Tree Contexts", \
1241 "Create Instance Top View", \
1244 "Deactivate Multi", \
1245 "Slice Index Space", \
1246 "Clone Multi Call", \
1247 "Multi Trigger Execution", \
1250 "Activate Individual", \
1251 "Deactivate Individual", \
1252 "Individual Perform Mapping", \
1253 "Individual Return Virtual", \
1254 "Individual Trigger Complete", \
1255 "Individual Trigger Commit", \
1256 "Individual Post Mapped", \
1257 "Individual Pack Task", \
1258 "Individual Unpack Task", \
1259 "Individual Pack Remote Complete", \
1260 "Individual Unpack Remote Complete", \
1262 "Deactivate Point", \
1263 "Point Task Complete", \
1264 "Point Task Commit", \
1265 "Point Task Pack", \
1266 "Point Task Unpack", \
1267 "Point Task Post Mapped", \
1268 "Remote Task Activate", \
1269 "Remote Task Deactivate", \
1270 "Remote Unpack Context", \
1272 "Index Deactivate", \
1273 "Index Compute Fat Path", \
1274 "Index Early Map Task", \
1275 "Index Distribute", \
1276 "Index Perform Mapping", \
1279 "Index Perform Inlining", \
1280 "Index Clone As Slice", \
1281 "Index Handle Future", \
1282 "Index Return Slice Mapped", \
1283 "Index Return Slice Complete", \
1284 "Index Return Slice Commit", \
1286 "Slice Deactivate", \
1287 "Slice Apply Version Info", \
1288 "Slice Distribute", \
1289 "Slice Perform Mapping", \
1291 "Slice Map and Launch", \
1292 "Slice Pack Task", \
1293 "Slice Unpack Task", \
1294 "Slice Clone As Slice", \
1295 "Slice Handle Future", \
1296 "Slice Cone as Point", \
1297 "Slice Enumerate Points", \
1301 "Realm Spawn Meta", \
1302 "Realm Spawn Task", \
1303 "Realm Create Instance", \
1304 "Realm Issue Copy", \
1305 "Realm Issue Fill", \
1306 "Region Tree Logical Analysis", \
1307 "Region Tree Logical Fence", \
1308 "Region Tree Versioning Analysis", \
1309 "Region Tree Advance Version Numbers", \
1310 "Region Tree Initialize Context", \
1311 "Region Tree Invalidate Context", \
1312 "Region Tree Premap Only", \
1313 "Region Tree Physical Register Only", \
1314 "Region Tree Physical Register Users", \
1315 "Region Tree Physical Perform Close", \
1316 "Region Tree Physical Close Context", \
1317 "Region Tree Physical Copy Across", \
1318 "Region Tree Physical Reduce Across", \
1319 "Region Tree Physical Convert Mapping", \
1320 "Region Tree Physical Fill Fields", \
1321 "Region Tree Physical Attach External", \
1322 "Region Tree Physical Detach External", \
1323 "Region Node Register Logical User", \
1324 "Region Node Close Logical Node", \
1325 "Region Node Siphon Logical Children", \
1326 "Region Node Siphon Logical Projection", \
1327 "Region Node Perform Logical Closes", \
1328 "Region Node Find Valid Instance Views", \
1329 "Region Node Find Valid Reduction Views", \
1330 "Region Node Issue Update Copies", \
1331 "Region Node Sort Copy Instances", \
1332 "Region Node Issue Grouped Copies", \
1333 "Region Node Issue Update Reductions", \
1334 "Region Node Premap Region", \
1335 "Region Node Register Region", \
1336 "Region Node Close State", \
1337 "Logical State Record Verison Numbers", \
1338 "Logical State Advance Version Numbers", \
1339 "Physical State Capture State", \
1340 "Physical State Apply Path Only", \
1341 "Physical State Apply State", \
1342 "Physical State Make Local", \
1343 "Materialized View Find Local Preconditions", \
1344 "Materialized View Find Local Copy Preconditions", \
1345 "Materialized View Filter Previous Users", \
1346 "Materialized View Filter Current Users", \
1347 "Materialized View Filter Local Users", \
1348 "Reduction View Perform Reduction", \
1349 "Reduction View Perform Deferred Reduction", \
1350 "Reduction View Perform Deferred Reduction Across", \
1351 "Reduction View Find Copy Preconditions", \
1352 "Reduction View Find User Preconditions", \
1353 "Reduction View Filter Local Users", \
1354 "Physical Trace Execute", \
1355 "Physical Trace Precondition Check", \
1356 "Physical Trace Optimize", \
1359 enum SemanticInfoKind {
1360 INDEX_SPACE_SEMANTIC,
1361 INDEX_PARTITION_SEMANTIC,
1362 FIELD_SPACE_SEMANTIC,
1364 LOGICAL_REGION_SEMANTIC,
1365 LOGICAL_PARTITION_SEMANTIC,
1389 class FieldAllocatorImpl;
1390 class ArgumentMapImpl;
1392 class FutureMapImpl;
1393 class PhysicalRegionImpl;
1394 class ExternalResourcesImpl;
1395 class PieceIteratorImpl;
1397 class PredicateImpl;
1398 class LegionHandshakeImpl;
1399 class ProcessorManager;
1400 class MemoryManager;
1401 class VirtualChannel;
1402 class MessageManager;
1403 class ShutdownManager;
1406 class LayoutConstraints;
1407 class ProjectionFunction;
1413 virtual void handle_profiling_response(
1415 const Realm::ProfilingResponse &response,
1416 const void *orig,
size_t orig_length) = 0;
1429 class SpeculativeOp;
1443 class VirtualCloseOp;
1446 class DynamicCollectiveOp;
1452 class PendingPartitionOp;
1453 class DependentPartitionOp;
1454 class PointDepPartOp;
1459 class IndexAttachOp;
1460 class PointAttachOp;
1462 class IndexDetachOp;
1463 class PointDetachOp;
1467 class ExternalMappable;
1471 class RemoteCloseOp;
1472 class RemoteAcquireOp;
1473 class RemoteReleaseOp;
1475 class RemotePartitionOp;
1476 class RemoteReplayOp;
1477 class RemoteSummaryOp;
1485 class IndividualTask;
1493 class InnerContext;;
1494 class TopLevelContext;
1495 class RemoteContext;
1502 class TraceCaptureOp;
1503 class TraceCompleteOp;
1504 class TraceReplayOp;
1506 class TraceSummaryOp;
1507 class PhysicalTrace;
1509 class TraceConditionSet;
1510 class PhysicalTemplate;
1513 class CreateApUserEvent;
1516 class AssignFenceCompletion;
1520 class GetOpTermEvent;
1521 class SetOpSyncEvent;
1523 class CompleteReplay;
1524 class AcquireReplay;
1525 class ReleaseReplay;
1528 class RegionTreeForest;
1529 class CopyAcrossExecutor;
1530 class CopyAcrossUnstructured;
1531 class IndexSpaceExpression;
1532 class IndexSpaceExprRef;
1533 class IndexSpaceOperation;
1538 class ExpressionTrieNode;
1539 class IndexTreeNode;
1540 class IndexSpaceNode;
1542 class IndexPartNode;
1544 class FieldSpaceNode;
1545 class RegionTreeNode;
1547 class PartitionNode;
1548 class ColorSpaceIterator;
1551 class RegionTreeContext;
1552 class RegionTreePath;
1553 class PathTraverser;
1554 class NodeTraverser;
1556 class ProjectionEpoch;
1558 class EquivalenceSet;
1559 class VersionManager;
1565 class ReferenceMutator;
1566 class LocalReferenceMutator;
1567 class ImplicitReferenceTracker;
1568 class DistributedCollectable;
1569 class LayoutDescription;
1570 class InstanceManager;
1571 class CopyAcrossHelper;
1575 class CollectableView;
1577 class MaterializedView;
1583 class InnerTaskView;
1584 class VirtualManager;
1585 class PhysicalManager;
1586 class IndividualManager;
1587 class CollectiveManager;
1588 class ReductionView;
1589 class InstanceBuilder;
1591 class RegionAnalyzer;
1596 struct PhysicalUser;
1597 struct LogicalTraceInfo;
1598 struct PhysicalTraceInfo;
1599 class LogicalCloser;
1600 class TreeCloseImpl;
1603 struct FieldDataDescriptor;
1604 struct PendingRemoteExpression;
1607 class TreeStateLogger;
1610 class LegionProfiler;
1611 class LegionProfInstance;
1614 class MappingCallInfo;
1615 class MapperManager;
1616 class SerializingManager;
1617 class ConcurrentManager;
1618 typedef Mapping::MapperEvent MapperEvent;
1619 typedef Mapping::ProfilingMeasurementID ProfilingMeasurementID;
1623 extern __thread TaskContext *implicit_context;
1625 extern __thread
Runtime *implicit_runtime;
1628 extern __thread
AutoLock *local_lock_list;
1632 extern __thread ::legion_unique_id_t implicit_provenance;
1635 enum RegistrationCallbackMode {
1636 NO_REGISTRATION_CALLBACK = 0,
1637 LOCAL_REGISTRATION_CALLBACK = 1,
1638 GLOBAL_REGISTRATION_CALLBACK = 2,
1640 extern __thread
unsigned inside_registration_callback;
1647 extern __thread ImplicitReferenceTracker *implicit_reference_tracker;
1653 template<
typename T>
1657 : provenance(uid), lg_task_id(T::TASK_ID) { }
1660 const ::legion_unique_id_t provenance;
1661 const LgTaskID lg_task_id;
1664 #define FRIEND_ALL_RUNTIME_CLASSES \
1665 friend class Legion::Runtime; \
1666 friend class Internal::Runtime; \
1667 friend class Internal::PhysicalRegionImpl; \
1668 friend class Internal::ExternalResourcesImpl; \
1669 friend class Internal::TaskImpl; \
1670 friend class Internal::ProcessorManager; \
1671 friend class Internal::MemoryManager; \
1672 friend class Internal::Operation; \
1673 friend class Internal::SpeculativeOp; \
1674 friend class Internal::MapOp; \
1675 friend class Internal::CopyOp; \
1676 friend class Internal::IndexCopyOp; \
1677 friend class Internal::PointCopyOp; \
1678 friend class Internal::FenceOp; \
1679 friend class Internal::DynamicCollectiveOp; \
1680 friend class Internal::FuturePredOp; \
1681 friend class Internal::CreationOp; \
1682 friend class Internal::DeletionOp; \
1683 friend class Internal::CloseOp; \
1684 friend class Internal::MergeCloseOp; \
1685 friend class Internal::PostCloseOp; \
1686 friend class Internal::VirtualCloseOp; \
1687 friend class Internal::AcquireOp; \
1688 friend class Internal::ReleaseOp; \
1689 friend class Internal::PredicateImpl; \
1690 friend class Internal::NotPredOp; \
1691 friend class Internal::AndPredOp; \
1692 friend class Internal::OrPredOp; \
1693 friend class Internal::MustEpochOp; \
1694 friend class Internal::PendingPartitionOp; \
1695 friend class Internal::DependentPartitionOp; \
1696 friend class Internal::PointDepPartOp; \
1697 friend class Internal::FillOp; \
1698 friend class Internal::IndexFillOp; \
1699 friend class Internal::PointFillOp; \
1700 friend class Internal::AttachOp; \
1701 friend class Internal::IndexAttachOp; \
1702 friend class Internal::PointAttachOp; \
1703 friend class Internal::DetachOp; \
1704 friend class Internal::IndexDetachOp; \
1705 friend class Internal::PointDetachOp; \
1706 friend class Internal::TimingOp; \
1707 friend class Internal::TunableOp; \
1708 friend class Internal::AllReduceOp; \
1709 friend class Internal::TraceSummaryOp; \
1710 friend class Internal::ExternalMappable; \
1711 friend class Internal::ExternalTask; \
1712 friend class Internal::TaskOp; \
1713 friend class Internal::SingleTask; \
1714 friend class Internal::MultiTask; \
1715 friend class Internal::IndividualTask; \
1716 friend class Internal::PointTask; \
1717 friend class Internal::IndexTask; \
1718 friend class Internal::SliceTask; \
1719 friend class Internal::RegionTreeForest; \
1720 friend class Internal::IndexSpaceNode; \
1721 friend class Internal::IndexPartNode; \
1722 friend class Internal::FieldSpaceNode; \
1723 friend class Internal::RegionTreeNode; \
1724 friend class Internal::RegionNode; \
1725 friend class Internal::PartitionNode; \
1726 friend class Internal::LogicalView; \
1727 friend class Internal::InstanceView; \
1728 friend class Internal::DeferredView; \
1729 friend class Internal::ReductionView; \
1730 friend class Internal::MaterializedView; \
1731 friend class Internal::FillView; \
1732 friend class Internal::LayoutDescription; \
1733 friend class Internal::InstanceManager; \
1734 friend class Internal::IndividualManager; \
1735 friend class Internal::CollectiveManager; \
1736 friend class Internal::TreeStateLogger; \
1737 friend class Internal::MapperManager; \
1738 friend class Internal::InstanceRef; \
1739 friend class Internal::LegionHandshakeImpl; \
1740 friend class Internal::ArgumentMapImpl; \
1741 friend class Internal::FutureMapImpl; \
1742 friend class Internal::TaskContext; \
1743 friend class Internal::InnerContext; \
1744 friend class Internal::TopLevelContext; \
1745 friend class Internal::RemoteContext; \
1746 friend class Internal::LeafContext; \
1747 friend class Internal::InstanceBuilder; \
1748 friend class BindingLib::Utility; \
1749 friend class CObjectWrapper;
1751 #define LEGION_EXTERN_LOGGER_DECLARATIONS \
1752 extern Realm::Logger log_run; \
1753 extern Realm::Logger log_task; \
1754 extern Realm::Logger log_index; \
1755 extern Realm::Logger log_field; \
1756 extern Realm::Logger log_region; \
1757 extern Realm::Logger log_inst; \
1758 extern Realm::Logger log_variant; \
1759 extern Realm::Logger log_allocation; \
1760 extern Realm::Logger log_migration; \
1761 extern Realm::Logger log_prof; \
1762 extern Realm::Logger log_garbage; \
1763 extern Realm::Logger log_spy; \
1764 extern Realm::Logger log_shutdown; \
1765 extern Realm::Logger log_tracing;
1770 typedef Realm::Runtime RealmRuntime;
1771 typedef Realm::Machine Machine;
1772 typedef Realm::Memory Memory;
1773 typedef Realm::Processor Processor;
1774 typedef Realm::ProcessorGroup ProcessorGroup;
1775 typedef Realm::CodeDescriptor CodeDescriptor;
1776 typedef Realm::Reservation Reservation;
1777 typedef Realm::CompletionQueue CompletionQueue;
1778 typedef ::legion_reduction_op_id_t ReductionOpID;
1779 typedef Realm::ReductionOpUntyped ReductionOp;
1780 typedef ::legion_custom_serdez_id_t CustomSerdezID;
1781 typedef Realm::CustomSerdezUntyped SerdezOp;
1782 typedef Realm::Machine::ProcessorMemoryAffinity ProcessorMemoryAffinity;
1783 typedef Realm::Machine::MemoryMemoryAffinity MemoryMemoryAffinity;
1784 typedef Realm::DynamicTemplates::TagType TypeTag;
1785 typedef Realm::Logger Logger;
1786 typedef ::legion_coord_t coord_t;
1787 typedef std::map<CustomSerdezID,
1788 const Realm::CustomSerdezUntyped *> SerdezOpTable;
1789 typedef std::map<Realm::ReductionOpID,
1790 const Realm::ReductionOpUntyped *> ReductionOpTable;
1791 typedef void (*SerdezInitFnptr)(
const ReductionOp*,
void *&,
size_t&);
1792 typedef void (*SerdezFoldFnptr)(
const ReductionOp*,
void *&,
1793 size_t&,
const void*);
1794 typedef std::map<Realm::ReductionOpID, SerdezRedopFns> SerdezRedopTable;
1795 typedef ::legion_projection_type_t HandleType;
1796 typedef ::legion_address_space_t AddressSpace;
1797 typedef ::legion_task_priority_t TaskPriority;
1798 typedef ::legion_task_priority_t RealmPriority;
1799 typedef ::legion_garbage_collection_priority_t GCPriority;
1800 typedef ::legion_color_t Color;
1801 typedef ::legion_field_id_t FieldID;
1802 typedef ::legion_trace_id_t TraceID;
1803 typedef ::legion_mapper_id_t MapperID;
1804 typedef ::legion_context_id_t ContextID;
1805 typedef ::legion_instance_id_t InstanceID;
1806 typedef ::legion_index_space_id_t IndexSpaceID;
1807 typedef ::legion_index_partition_id_t IndexPartitionID;
1808 typedef ::legion_index_tree_id_t IndexTreeID;
1809 typedef ::legion_field_space_id_t FieldSpaceID;
1810 typedef ::legion_generation_id_t GenerationID;
1811 typedef ::legion_type_handle TypeHandle;
1812 typedef ::legion_projection_id_t ProjectionID;
1813 typedef ::legion_sharding_id_t ShardingID;
1814 typedef ::legion_region_tree_id_t RegionTreeID;
1815 typedef ::legion_distributed_id_t DistributedID;
1816 typedef ::legion_address_space_t AddressSpaceID;
1817 typedef ::legion_tunable_id_t TunableID;
1818 typedef ::legion_local_variable_id_t LocalVariableID;
1819 typedef ::legion_mapping_tag_id_t MappingTagID;
1820 typedef ::legion_semantic_tag_t SemanticTag;
1821 typedef ::legion_variant_id_t VariantID;
1822 typedef ::legion_code_descriptor_id_t CodeDescriptorID;
1823 typedef ::legion_unique_id_t UniqueID;
1824 typedef ::legion_version_id_t VersionID;
1825 typedef ::legion_projection_epoch_id_t ProjectionEpochID;
1826 typedef ::legion_task_id_t TaskID;
1827 typedef ::legion_layout_constraint_id_t LayoutConstraintID;
1828 typedef ::legion_replication_id_t ReplicationID;
1829 typedef ::legion_shard_id_t ShardID;
1830 typedef ::legion_internal_color_t LegionColor;
1831 typedef void (*RegistrationCallbackFnptr)(Machine machine,
1832 Runtime *rt,
const std::set<Processor> &local_procs);
1833 typedef void (*RegistrationWithArgsCallbackFnptr)(
1839 typedef bool (*PredicateFnptr)(
const void*, size_t,
1840 const std::vector<Future> futures);
1841 typedef void (*RealmFnptr)(
const void*,size_t,
1842 const void*,size_t,Processor);
1845 typedef Internal::TaskContext* Context;
1848 typedef Internal::MappingCallInfo* MapperContext;
1849 typedef Internal::InstanceManager* PhysicalInstanceImpl;
1852 namespace Internal {
1854 const LegionColor INVALID_COLOR = LLONG_MAX;
1856 typedef Realm::RegionInstance PhysicalInstance;
1857 typedef Realm::CopySrcDstField CopySrcDstField;
1858 typedef unsigned long long IndexSpaceExprID;
1859 typedef std::pair<unsigned, DomainPoint> TraceLocalID;
1862 public Realm::DynamicTemplates::ListProduct2<Realm::DIMCOUNTS,
1864 typedef Realm::DynamicTemplates::ListProduct2<Realm::DIMCOUNTS,
1865 Realm::DIMTYPES> SUPER;
1867 template<
int N,
typename T> __CUDA_HD__
1868 static inline constexpr TypeTag encode_tag(
void) {
1869 #if __cplusplus >= 201402L
1870 constexpr TypeTag type =
1871 SUPER::template encode_tag<Realm::DynamicTemplates::Int<N>, T>();
1872 static_assert(type != 0,
"All types should be non-zero for Legion");
1875 return SUPER::template encode_tag<Realm::DynamicTemplates::Int<N>, T>();
1878 template<
int N,
typename T>
1879 static inline void check_type(
const TypeTag t) {
1882 const TypeTag t1 = encode_tag<N,T>();
1889 template<
typename N,
typename T>
1890 static inline void demux(
int *result) { *result = N::N; }
1892 static inline int get_dim(
const TypeTag t) {
1894 SUPER::demux<DimHelper>(t, &result);
1899 typedef Mapping::Mapper Mapper;
1900 typedef Mapping::PhysicalInstance MappingInstance;
1906 #define LEGION_FIELD_MASK_FIELD_TYPE uint64_t
1907 #define LEGION_FIELD_MASK_FIELD_SHIFT 6
1908 #define LEGION_FIELD_MASK_FIELD_MASK 0x3F
1909 #define LEGION_FIELD_MASK_FIELD_ALL_ONES 0xFFFFFFFFFFFFFFFF
1911 #if defined(__AVX__)
1912 #if (LEGION_MAX_FIELDS > 256)
1913 typedef AVXTLBitMask<LEGION_MAX_FIELDS> FieldMask;
1914 #elif (LEGION_MAX_FIELDS > 128)
1915 typedef AVXBitMask<LEGION_MAX_FIELDS> FieldMask;
1916 #elif (LEGION_MAX_FIELDS > 64)
1917 typedef SSEBitMask<LEGION_MAX_FIELDS> FieldMask;
1919 typedef BitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1920 LEGION_FIELD_MASK_FIELD_SHIFT,
1921 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1923 #elif defined(__SSE2__)
1924 #if (LEGION_MAX_FIELDS > 128)
1925 typedef SSETLBitMask<LEGION_MAX_FIELDS> FieldMask;
1926 #elif (LEGION_MAX_FIELDS > 64)
1927 typedef SSEBitMask<LEGION_MAX_FIELDS> FieldMask;
1929 typedef BitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1930 LEGION_FIELD_MASK_FIELD_SHIFT,
1931 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1933 #elif defined(__ALTIVEC__)
1934 #if (LEGION_MAX_FIELDS > 128)
1935 typedef PPCTLBitMask<LEGION_MAX_FIELDS> FieldMask;
1936 #elif (LEGION_MAX_FIELDS > 64)
1937 typedef PPCBitMask<LEGION_MAX_FIELDS> FieldMask;
1939 typedef BitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1940 LEGION_FIELD_MASK_FIELD_SHIFT,
1941 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1943 #elif defined(__ARM_NEON)
1944 #if (LEGION_MAX_FIELDS > 128)
1945 typedef NeonTLBitMask<LEGION_MAX_FIELDS> FieldMask;
1946 #elif (LEGION_MAX_FIELDS > 64)
1947 typedef NeonBitMask<LEGION_MAX_FIELDS> FieldMask;
1949 typedef BitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1950 LEGION_FIELD_MASK_FIELD_SHIFT,
1951 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1954 #if (LEGION_MAX_FIELDS > 64)
1955 typedef TLBitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1956 LEGION_FIELD_MASK_FIELD_SHIFT,
1957 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1959 typedef BitMask<LEGION_FIELD_MASK_FIELD_TYPE,LEGION_MAX_FIELDS,
1960 LEGION_FIELD_MASK_FIELD_SHIFT,
1961 LEGION_FIELD_MASK_FIELD_MASK> FieldMask;
1964 typedef BitPermutation<FieldMask,LEGION_FIELD_LOG2> FieldPermutation;
1965 typedef Fraction<unsigned long> InstFrac;
1966 #undef LEGION_FIELD_MASK_FIELD_SHIFT
1967 #undef LEGION_FIELD_MASK_FIELD_MASK
1973 #define LEGION_NODE_MASK_NODE_TYPE uint64_t
1974 #define LEGION_NODE_MASK_NODE_SHIFT 6
1975 #define LEGION_NODE_MASK_NODE_MASK 0x3F
1976 #define LEGION_NODE_MASK_NODE_ALL_ONES 0xFFFFFFFFFFFFFFFF
1978 #if defined(__AVX__)
1979 #if (LEGION_MAX_NUM_NODES > 256)
1980 typedef AVXTLBitMask<LEGION_MAX_NUM_NODES> NodeMask;
1981 #elif (LEGION_MAX_NUM_NODES > 128)
1982 typedef AVXBitMask<LEGION_MAX_NUM_NODES> NodeMask;
1983 #elif (LEGION_MAX_NUM_NODES > 64)
1984 typedef SSEBitMask<LEGION_MAX_NUM_NODES> NodeMask;
1986 typedef BitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
1987 LEGION_NODE_MASK_NODE_SHIFT,
1988 LEGION_NODE_MASK_NODE_MASK> NodeMask;
1990 #elif defined(__SSE2__)
1991 #if (LEGION_MAX_NUM_NODES > 128)
1992 typedef SSETLBitMask<LEGION_MAX_NUM_NODES> NodeMask;
1993 #elif (LEGION_MAX_NUM_NODES > 64)
1994 typedef SSEBitMask<LEGION_MAX_NUM_NODES> NodeMask;
1996 typedef BitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
1997 LEGION_NODE_MASK_NODE_SHIFT,
1998 LEGION_NODE_MASK_NODE_MASK> NodeMask;
2000 #elif defined(__ALTIVEC__)
2001 #if (LEGION_MAX_NUM_NODES > 128)
2002 typedef PPCTLBitMask<LEGION_MAX_NUM_NODES> NodeMask;
2003 #elif (LEGION_MAX_NUM_NODES > 64)
2004 typedef PPCBitMask<LEGION_MAX_NUM_NODES> NodeMask;
2006 typedef BitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
2007 LEGION_NODE_MASK_NODE_SHIFT,
2008 LEGION_NODE_MASK_NODE_MASK> NodeMask;
2010 #elif defined(__ARM_NEON)
2011 #if (LEGION_MAX_NUM_NODES > 128)
2012 typedef NeonTLBitMask<LEGION_MAX_NUM_NODES> NodeMask;
2013 #elif (LEGION_MAX_NUM_NODES > 64)
2014 typedef NeonBitMask<LEGION_MAX_NUM_NODES> NodeMask;
2016 typedef BitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
2017 LEGION_NODE_MASK_NODE_SHIFT,
2018 LEGION_NODE_MASK_NODE_MASK> NodeMask;
2021 #if (LEGION_MAX_NUM_NODES > 64)
2022 typedef TLBitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
2023 LEGION_NODE_MASK_NODE_SHIFT,
2024 LEGION_NODE_MASK_NODE_MASK> NodeMask;
2026 typedef BitMask<LEGION_NODE_MASK_NODE_TYPE,LEGION_MAX_NUM_NODES,
2027 LEGION_NODE_MASK_NODE_SHIFT,
2028 LEGION_NODE_MASK_NODE_MASK> NodeMask;
2033 #undef LEGION_NODE_MASK_NODE_SHIFT
2034 #undef LEGION_NODE_MASK_NODE_MASK
2038 #define LEGION_PROC_MASK_PROC_TYPE uint64_t
2039 #define LEGION_PROC_MASK_PROC_SHIFT 6
2040 #define LEGION_PROC_MASK_PROC_MASK 0x3F
2041 #define LEGION_PROC_MASK_PROC_ALL_ONES 0xFFFFFFFFFFFFFFFF
2043 #if defined(__AVX__)
2044 #if (LEGION_MAX_NUM_PROCS > 256)
2045 typedef AVXTLBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2046 #elif (LEGION_MAX_NUM_PROCS > 128)
2047 typedef AVXBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2048 #elif (LEGION_MAX_NUM_PROCS > 64)
2049 typedef SSEBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2051 typedef BitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2052 LEGION_PROC_MASK_PROC_SHIFT,
2053 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2055 #elif defined(__SSE2__)
2056 #if (LEGION_MAX_NUM_PROCS > 128)
2057 typedef SSETLBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2058 #elif (LEGION_MAX_NUM_PROCS > 64)
2059 typedef SSEBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2061 typedef BitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2062 LEGION_PROC_MASK_PROC_SHIFT,
2063 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2065 #elif defined(__ALTIVEC__)
2066 #if (LEGION_MAX_NUM_PROCS > 128)
2067 typedef PPCTLBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2068 #elif (LEGION_MAX_NUM_PROCS > 64)
2069 typedef PPCBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2071 typedef BitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2072 LEGION_PROC_MASK_PROC_SHIFT,
2073 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2075 #elif defined(__ARM_NEON)
2076 #if (LEGION_MAX_NUM_PROCS > 128)
2077 typedef NeonTLBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2078 #elif (LEGION_MAX_NUM_PROCS > 64)
2079 typedef NeonBitMask<LEGION_MAX_NUM_PROCS> ProcessorMask;
2081 typedef BitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2082 LEGION_PROC_MASK_PROC_SHIFT,
2083 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2086 #if (LEGION_MAX_NUM_PROCS > 64)
2087 typedef TLBitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2088 LEGION_PROC_MASK_PROC_SHIFT,
2089 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2091 typedef BitMask<LEGION_PROC_MASK_PROC_TYPE,LEGION_MAX_NUM_PROCS,
2092 LEGION_PROC_MASK_PROC_SHIFT,
2093 LEGION_PROC_MASK_PROC_MASK> ProcessorMask;
2103 static const LgEvent NO_LG_EVENT;
2105 LgEvent(
void) noexcept {
id = 0; }
2107 explicit LgEvent(
const Realm::Event e) {
id = e.id; }
2112 inline void wait(
void)
const;
2113 inline void wait_faultaware(
bool &poisoned)
const;
2125 inline operator Realm::UserEvent()
const
2126 { Realm::UserEvent e; e.id = id;
return e; }
2131 static const ApEvent NO_AP_EVENT;
2139 inline bool has_triggered_faultignorant(
void)
const
2140 {
bool poisoned =
false;
2141 return has_triggered_faultaware(poisoned); }
2142 inline void wait_faultignorant(
void)
const
2143 {
bool poisoned =
false; LgEvent::wait_faultaware(poisoned); }
2149 inline bool has_triggered(
void)
const {
return LgEvent::has_triggered(); }
2150 inline void wait(
void)
const { LgEvent::wait(); }
2163 inline operator Realm::UserEvent()
const
2164 { Realm::UserEvent e; e.id = id;
return e; }
2173 explicit ApBarrier(
const Realm::Barrier &b)
2174 :
ApEvent(b), timestamp(b.timestamp) { }
2177 inline operator Realm::Barrier()
const
2178 { Realm::Barrier b; b.id = id;
2179 b.timestamp = timestamp;
return b; }
2181 Realm::Barrier::timestamp_t timestamp;
2186 static const RtEvent NO_RT_EVENT;
2205 inline operator Realm::UserEvent()
const
2206 { Realm::UserEvent e; e.id = id;
return e; }
2215 explicit RtBarrier(
const Realm::Barrier &b)
2216 :
RtEvent(b), timestamp(b.timestamp) { }
2219 inline operator Realm::Barrier()
const
2220 { Realm::Barrier b; b.id = id;
2221 b.timestamp = timestamp;
return b; }
2223 Realm::Barrier::timestamp_t timestamp;
2249 inline RtEvent wrlock(
void) {
return RtEvent(reservation.wrlock()); }
2250 inline RtEvent rdlock(
void) {
return RtEvent(reservation.rdlock()); }
2251 inline bool trylock(
void) {
return reservation.trylock(); }
2252 inline bool trywrlock(
void) {
return reservation.trywrlock(); }
2253 inline bool tryrdlock(
void) {
return reservation.tryrdlock(); }
2254 inline void unlock(
void) { reservation.unlock(); }
2256 inline void advise_sleep_entry(Realm::UserEvent guard)
2257 { reservation.advise_sleep_entry(guard); }
2258 inline void advise_sleep_exit(
void)
2259 { reservation.advise_sleep_exit(); }
2261 Realm::FastReservation reservation;
2272 : local_lock(r), previous(Internal::local_lock_list),
2273 exclusive(excl), held(
true)
2275 #ifdef DEBUG_REENTRANT_LOCKS
2276 if (previous != NULL)
2277 previous->check_for_reentrant_locks(&local_lock);
2281 RtEvent ready = local_lock.wrlock();
2282 while (ready.exists())
2285 ready = local_lock.wrlock();
2290 RtEvent ready = local_lock.rdlock();
2291 while (ready.exists())
2294 ready = local_lock.rdlock();
2297 Internal::local_lock_list =
this;
2302 : local_lock(r), previous(Internal::local_lock_list),
2303 exclusive(excl), held(
false)
2305 #ifdef DEBUG_REENTRANT_LOCKS
2306 if (previous != NULL)
2307 previous->check_for_reentrant_locks(&local_lock);
2317 assert(Internal::local_lock_list ==
this);
2319 local_lock.unlock();
2320 Internal::local_lock_list = previous;
2323 assert(Internal::local_lock_list == previous);
2328 inline void release(
void)
2332 assert(Internal::local_lock_list ==
this);
2334 local_lock.unlock();
2335 Internal::local_lock_list = previous;
2338 inline void reacquire(
void)
2342 assert(Internal::local_lock_list == previous);
2344 #ifdef DEBUG_REENTRANT_LOCKS
2345 if (previous != NULL)
2346 previous->check_for_reentrant_locks(&local_lock);
2350 RtEvent ready = local_lock.wrlock();
2351 while (ready.exists())
2354 ready = local_lock.wrlock();
2359 RtEvent ready = local_lock.rdlock();
2360 while (ready.exists())
2363 ready = local_lock.rdlock();
2366 Internal::local_lock_list =
this;
2370 inline void advise_sleep_entry(Realm::UserEvent guard)
const
2373 local_lock.advise_sleep_entry(guard);
2374 if (previous != NULL)
2375 previous->advise_sleep_entry(guard);
2377 inline void advise_sleep_exit(
void)
const
2380 local_lock.advise_sleep_exit();
2381 if (previous != NULL)
2382 previous->advise_sleep_exit();
2384 #ifdef DEBUG_REENTRANT_LOCKS
2385 inline void check_for_reentrant_locks(
LocalLock *to_acquire)
const
2387 assert(to_acquire != &local_lock);
2388 if (previous != NULL)
2389 previous->check_for_reentrant_locks(to_acquire);
2395 const bool exclusive;
2406 ready = local_lock.wrlock();
2408 ready = local_lock.rdlock();
2409 held = !ready.exists();
2411 Internal::local_lock_list =
this;
2418 inline bool has_lock(
void)
const {
return held; }
2419 inline RtEvent try_next(
void)
const {
return ready; }
2427 inline void LgEvent::wait(
void) const
2431 Internal::TaskContext *local_ctx = Internal::implicit_context;
2433 UniqueID local_provenance = Internal::implicit_provenance;
2435 unsigned local_callback = Internal::inside_registration_callback;
2437 ImplicitReferenceTracker *local_tracker = implicit_reference_tracker;
2438 Internal::implicit_reference_tracker = NULL;
2440 if (Internal::local_lock_list != NULL)
2443 AutoLock *local_lock_list_copy = Internal::local_lock_list;
2445 Internal::local_lock_list = NULL;
2447 const Realm::UserEvent done = Realm::UserEvent::create_user_event();
2448 local_lock_list_copy->advise_sleep_entry(done);
2450 if (!Processor::get_executing_processor().exists())
2451 Realm::Event::external_wait();
2453 Realm::Event::wait();
2455 local_lock_list_copy->advise_sleep_exit();
2459 Internal::local_lock_list = local_lock_list_copy;
2463 if (!Processor::get_executing_processor().exists())
2464 Realm::Event::external_wait();
2466 Realm::Event::wait();
2469 Internal::implicit_context = local_ctx;
2471 Internal::implicit_provenance = local_provenance;
2473 Internal::inside_registration_callback = local_callback;
2475 assert(Internal::implicit_reference_tracker == NULL);
2478 Internal::implicit_reference_tracker = local_tracker;
2482 inline void LgEvent::wait_faultaware(
bool &poisoned)
const
2486 Internal::TaskContext *local_ctx = Internal::implicit_context;
2488 UniqueID local_provenance = Internal::implicit_provenance;
2490 unsigned local_callback = Internal::inside_registration_callback;
2492 ImplicitReferenceTracker *local_tracker = implicit_reference_tracker;
2493 Internal::implicit_reference_tracker = NULL;
2495 if (Internal::local_lock_list != NULL)
2498 AutoLock *local_lock_list_copy = Internal::local_lock_list;
2500 Internal::local_lock_list = NULL;
2502 const Realm::UserEvent done = Realm::UserEvent::create_user_event();
2503 local_lock_list_copy->advise_sleep_entry(done);
2505 if (!Processor::get_executing_processor().exists())
2506 Realm::Event::external_wait_faultaware(poisoned);
2508 Realm::Event::wait_faultaware(poisoned);
2510 local_lock_list_copy->advise_sleep_exit();
2514 Internal::local_lock_list = local_lock_list_copy;
2518 if (!Processor::get_executing_processor().exists())
2519 Realm::Event::external_wait_faultaware(poisoned);
2521 Realm::Event::wait_faultaware(poisoned);
2524 Internal::implicit_context = local_ctx;
2526 Internal::implicit_provenance = local_provenance;
2528 Internal::inside_registration_callback = local_callback;
2530 assert(Internal::implicit_reference_tracker == NULL);
2533 Internal::implicit_reference_tracker = local_tracker;
2540 template<
typename T>
2543 inline size_t legion_buffer_size(
void);
2544 inline size_t legion_serialize(
void *buffer);
2545 inline size_t legion_deserialize(
const void *buffer);
2552 #include "legion/accessor.h"
2555 typedef LegionRuntime::Accessor::ByteOffset ByteOffset;
2557 typedef std::map<Color,ColoredPoints<ptr_t> > Coloring;
2558 typedef std::map<Color,Domain> DomainColoring;
2559 typedef std::map<Color,std::set<Domain> > MultiDomainColoring;
2560 typedef std::map<DomainPoint,ColoredPoints<ptr_t> > PointColoring;
2561 typedef std::map<DomainPoint,Domain> DomainPointColoring;
2562 typedef std::map<DomainPoint,std::set<Domain> > MultiDomainPointColoring;
2565 #endif // __LEGION_TYPES_H__
Definition: legion_types.h:1535
Definition: legion_types.h:167
Definition: legion.h:3894
Definition: legion.h:3375
Definition: legion_types.h:1543
Definition: legion_domain.h:260
Definition: legion_types.h:2269
Definition: legion.h:9792
Definition: legion_types.h:1549
Definition: legion_types.h:1536
Definition: legion_types.h:1537
Definition: legion.h:4572
Definition: legion_types.h:1383
Definition: legion.h:4267
Definition: legion_types.h:2209
Definition: legion.h:3300
Definition: legion.h:4094
Definition: legion_types.h:1887
Definition: legion.h:3340
Definition: legion.h:4137
Definition: legion.h:3829
Definition: legion_types.h:2184
Definition: legion_types.h:1411
Definition: legion_types.h:168
Definition: legion_types.h:2101
Definition: legion.h:4208
Definition: legion.h:4163
Definition: legion_types.h:2541
Definition: legion.h:4181
Definition: legion_types.h:1541
Definition: legion_domain.h:132
Definition: legion_types.h:1534
Definition: legion_types.h:1418
Definition: legion.h:4241
Definition: legion_types.h:2154
Definition: legion_types.h:2116
Definition: legion_types.h:2400
Definition: legion_types.h:83
Definition: legion_types.h:2167
Definition: legion.h:4014
Definition: legion_c_util.h:39
Definition: legion_types.h:64
Definition: legion.h:4335
Definition: legion_types.h:2196
Definition: legion.h:9773
Definition: legion_types.h:1384
Definition: legion_types.h:2227
Definition: legion_types.h:2129
Definition: legion_types.h:66
Definition: legion_types.h:1654
Definition: legion_types.h:1861
Definition: legion_types.h:165
Definition: legion.h:4115
Definition: legion.h:4066
Definition: legion.h:4288