Legion Runtime
Loading...
Searching...
No Matches
c_bindings.h
1/* Copyright 2026 Stanford University
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_C_H__
17#define __LEGION_C_H__
18
24// ******************** IMPORTANT **************************
25//
26// This file is PURE C, **NOT** C++.
27//
28// ******************** IMPORTANT **************************
29
30#include "legion/api/config.h"
31
32#include <stdbool.h>
33#ifndef LEGION_USE_PYTHON_CFFI
34#include <stddef.h>
35#include <stdint.h>
36#include <stdio.h>
37#endif // LEGION_USE_PYTHON_CFFI
38
39#ifdef __cplusplus
40extern "C"
41{
42#endif
43
44 // -----------------------------------------------------------------------
45 // Proxy Types
46 // -----------------------------------------------------------------------
47
48// #define NEW_OPAQUE_TYPE(T) typedef void * T
49#define NEW_OPAQUE_TYPE(T) \
50 typedef struct T { \
51 void* impl; \
52 } T
53 NEW_OPAQUE_TYPE(legion_runtime_t);
54 NEW_OPAQUE_TYPE(legion_context_t);
55 NEW_OPAQUE_TYPE(legion_domain_point_iterator_t);
56#define NEW_ITERATOR_TYPE(DIM) \
57 NEW_OPAQUE_TYPE(legion_rect_in_domain_iterator_##DIM##d_t);
58 LEGION_FOREACH_N(NEW_ITERATOR_TYPE);
59#undef NEW_ITERATOR_TYPE
60 NEW_OPAQUE_TYPE(legion_coloring_t);
61 NEW_OPAQUE_TYPE(legion_domain_coloring_t);
62 NEW_OPAQUE_TYPE(legion_point_coloring_t);
63 NEW_OPAQUE_TYPE(legion_domain_point_coloring_t);
64 NEW_OPAQUE_TYPE(legion_multi_domain_point_coloring_t);
65 NEW_OPAQUE_TYPE(legion_index_space_allocator_t);
66 NEW_OPAQUE_TYPE(legion_field_allocator_t);
67 NEW_OPAQUE_TYPE(legion_argument_map_t);
68 NEW_OPAQUE_TYPE(legion_predicate_t);
69 NEW_OPAQUE_TYPE(legion_future_t);
70 NEW_OPAQUE_TYPE(legion_future_map_t);
71#define NEW_DEFERRED_BUFFER_TYPE(DIM) \
72 NEW_OPAQUE_TYPE(legion_deferred_buffer_char_##DIM##d_t);
73 LEGION_FOREACH_N(NEW_DEFERRED_BUFFER_TYPE)
74#undef NEW_DEFERRED_BUFFER_TYPE
75 NEW_OPAQUE_TYPE(legion_task_launcher_t);
76 NEW_OPAQUE_TYPE(legion_index_launcher_t);
77 NEW_OPAQUE_TYPE(legion_inline_launcher_t);
78 NEW_OPAQUE_TYPE(legion_copy_launcher_t);
79 NEW_OPAQUE_TYPE(legion_index_copy_launcher_t);
80 NEW_OPAQUE_TYPE(legion_fill_launcher_t);
81 NEW_OPAQUE_TYPE(legion_index_fill_launcher_t);
82 NEW_OPAQUE_TYPE(legion_discard_launcher_t);
83 NEW_OPAQUE_TYPE(legion_acquire_launcher_t);
84 NEW_OPAQUE_TYPE(legion_release_launcher_t);
85 NEW_OPAQUE_TYPE(legion_attach_launcher_t);
86 NEW_OPAQUE_TYPE(legion_index_attach_launcher_t);
87 NEW_OPAQUE_TYPE(legion_must_epoch_launcher_t);
88 NEW_OPAQUE_TYPE(legion_physical_region_t);
89 NEW_OPAQUE_TYPE(legion_external_resources_t);
90#define NEW_ACCESSOR_ARRAY_TYPE(DIM) \
91 NEW_OPAQUE_TYPE(legion_accessor_array_##DIM##d_t);
92 LEGION_FOREACH_N(NEW_ACCESSOR_ARRAY_TYPE)
93#undef NEW_ACCESSOR_ARRAY_TYPE
94 NEW_OPAQUE_TYPE(legion_task_t);
95 NEW_OPAQUE_TYPE(legion_task_mut_t);
96 NEW_OPAQUE_TYPE(legion_copy_t);
97 NEW_OPAQUE_TYPE(legion_fill_t);
98 NEW_OPAQUE_TYPE(legion_inline_t);
99 NEW_OPAQUE_TYPE(legion_mappable_t);
100 NEW_OPAQUE_TYPE(legion_region_requirement_t);
101 NEW_OPAQUE_TYPE(legion_output_requirement_t);
102 NEW_OPAQUE_TYPE(legion_machine_t);
103 NEW_OPAQUE_TYPE(legion_logger_t);
104 NEW_OPAQUE_TYPE(legion_mapper_t);
105 NEW_OPAQUE_TYPE(legion_default_mapper_t);
106 NEW_OPAQUE_TYPE(legion_processor_query_t);
107 NEW_OPAQUE_TYPE(legion_memory_query_t);
108 NEW_OPAQUE_TYPE(legion_machine_query_interface_t);
109 NEW_OPAQUE_TYPE(legion_execution_constraint_set_t);
110 NEW_OPAQUE_TYPE(legion_layout_constraint_set_t);
111 NEW_OPAQUE_TYPE(legion_task_layout_constraint_set_t);
112 NEW_OPAQUE_TYPE(legion_slice_task_output_t);
113 NEW_OPAQUE_TYPE(legion_map_task_input_t);
114 NEW_OPAQUE_TYPE(legion_map_task_output_t);
115 NEW_OPAQUE_TYPE(legion_physical_instance_t);
116 NEW_OPAQUE_TYPE(legion_mapper_runtime_t);
117 NEW_OPAQUE_TYPE(legion_mapper_context_t);
118 NEW_OPAQUE_TYPE(legion_field_map_t);
119 NEW_OPAQUE_TYPE(legion_point_transform_functor_t);
120 NEW_OPAQUE_TYPE(legion_task_variant_registrar_t);
121#undef NEW_OPAQUE_TYPE
122
126 typedef struct legion_ptr_t {
127 long long int value;
128 } legion_ptr_t;
129
130 typedef legion_coord_t coord_t;
131
132#define NEW_POINT_TYPE(DIM) \
133 typedef struct legion_point_##DIM##d_t { \
134 coord_t x[DIM]; \
135 } legion_point_##DIM##d_t;
136 LEGION_FOREACH_N(NEW_POINT_TYPE)
137#undef NEW_POINT_TYPE
138
139#define NEW_RECT_TYPE(DIM) \
140 typedef struct legion_rect_##DIM##d_t { \
141 legion_point_##DIM##d_t lo, hi; \
142 } legion_rect_##DIM##d_t;
143 LEGION_FOREACH_N(NEW_RECT_TYPE)
144#undef NEW_RECT_TYPE
145
146#define NEW_BLOCKIFY_TYPE(DIM) \
147 typedef struct legion_blockify_##DIM##d_t { \
148 legion_point_##DIM##d_t block_size; \
149 legion_point_##DIM##d_t offset; \
150 } legion_blockify_##DIM##d_t;
151 LEGION_FOREACH_N(NEW_BLOCKIFY_TYPE)
152#undef NEW_BLOCKIFY_TYPE
153
154#define NEW_TRANSFORM_TYPE(D1, D2) \
155 typedef struct legion_transform_##D1##x##D2##_t { \
156 coord_t trans[D1][D2]; \
157 } legion_transform_##D1##x##D2##_t;
158 LEGION_FOREACH_NN(NEW_TRANSFORM_TYPE)
159#undef NEW_TRANSFORM_TYPE
160
161#define NEW_AFFINE_TRANSFORM_TYPE(D1, D2) \
162 typedef struct legion_affine_transform_##D1##x##D2##_t { \
163 legion_transform_##D1##x##D2##_t transform; \
164 legion_point_##D1##d_t offset; \
165 } legion_affine_transform_##D1##x##D2##_t;
166 LEGION_FOREACH_NN(NEW_AFFINE_TRANSFORM_TYPE)
167#undef NEW_AFFINE_TRANSFORM_TYPE
168
172 typedef struct legion_domain_t {
173 realm_id_t is_id;
174 legion_type_tag_t is_type;
175 int dim;
176// Hack: Python CFFI isn't smart enough to do constant folding so we
177// have to do this by hand here. To avoid this bitrotting, at least
178// make the preprocessor check that the value is equal to what we
179// expect.
180#if LEGION_MAX_DIM == 1
181#define MAX_DOMAIN_DIM 2 // 2 * LEGION_MAX_RECT_DIM
182#elif LEGION_MAX_DIM == 2
183#define MAX_DOMAIN_DIM 4 // 2 * LEGION_MAX_RECT_DIM
184#elif LEGION_MAX_DIM == 3
185#define MAX_DOMAIN_DIM 6 // 2 * LEGION_MAX_RECT_DIM
186#elif LEGION_MAX_DIM == 4
187#define MAX_DOMAIN_DIM 8 // 2 * LEGION_MAX_RECT_DIM
188#elif LEGION_MAX_DIM == 5
189#define MAX_DOMAIN_DIM 10 // 2 * LEGION_MAX_RECT_DIM
190#elif LEGION_MAX_DIM == 6
191#define MAX_DOMAIN_DIM 12 // 2 * LEGION_MAX_RECT_DIM
192#elif LEGION_MAX_DIM == 7
193#define MAX_DOMAIN_DIM 14 // 2 * LEGION_MAX_RECT_DIM
194#elif LEGION_MAX_DIM == 8
195#define MAX_DOMAIN_DIM 16 // 2 * LEGION_MAX_RECT_DIM
196#elif LEGION_MAX_DIM == 9
197#define MAX_DOMAIN_DIM 18 // 2 * LEGION_MAX_RECT_DIM
198#else
199#error "Illegal value of LEGION_MAX_DIM"
200#endif
201#if MAX_DOMAIN_DIM != 2 * LEGION_MAX_RECT_DIM // sanity check value
202#error Mismatch in MAX_DOMAIN_DIM
203#endif
204 coord_t rect_data[MAX_DOMAIN_DIM];
205#undef MAX_DOMAIN_DIM
207
211 typedef struct legion_domain_point_t {
212 int dim;
213 coord_t point_data[LEGION_MAX_DIM];
215
220 int m, n;
221// Hack: Python CFFI isn't smart enough to do constant folding so we
222// have to do this by hand here. To avoid this bitrotting, at least
223// make the preprocessor check that the value is equal to what we
224// expect.
225#if LEGION_MAX_DIM == 1
226#define MAX_MATRIX_DIM 1
227#elif LEGION_MAX_DIM == 2
228#define MAX_MATRIX_DIM 4
229#elif LEGION_MAX_DIM == 3
230#define MAX_MATRIX_DIM 9
231#elif LEGION_MAX_DIM == 4
232#define MAX_MATRIX_DIM 16
233#elif LEGION_MAX_DIM == 5
234#define MAX_MATRIX_DIM 25
235#elif LEGION_MAX_DIM == 6
236#define MAX_MATRIX_DIM 36
237#elif LEGION_MAX_DIM == 7
238#define MAX_MATRIX_DIM 49
239#elif LEGION_MAX_DIM == 8
240#define MAX_MATRIX_DIM 64
241#elif LEGION_MAX_DIM == 9
242#define MAX_MATRIX_DIM 81
243#else
244#error "Illegal value of LEGION_MAX_DIM"
245#endif
246#if MAX_MATRIX_DIM != \
247 LEGION_MAX_POINT_DIM * LEGION_MAX_POINT_DIM // sanity check
248#error Mismatch in MAX_MATRIX_DIM
249#endif
250 coord_t matrix[MAX_MATRIX_DIM];
251#undef MAX_MATRIX_DIM
253
261
265 typedef struct legion_index_space_t {
266 legion_distributed_id_t id;
267 legion_index_tree_id_t tid;
268 legion_type_tag_t type_tag;
270
275 legion_distributed_id_t id;
276 legion_index_tree_id_t tid;
277 legion_type_tag_t type_tag;
279
283 typedef struct legion_field_space_t {
284 legion_distributed_id_t id;
286
290 typedef struct legion_logical_region_t {
291 legion_distributed_id_t tree_id;
292 legion_index_space_t index_space;
293 legion_field_space_t field_space;
295
300 legion_distributed_id_t tree_id;
301 legion_index_partition_t index_partition;
302 legion_field_space_t field_space;
304
308 typedef struct legion_untyped_buffer_t {
309 void* args;
310 size_t arglen;
312 // This is for backwards compatibility when we used
313 // to call legion_untyped_buffer_t as legion_task_argument_t
315
316 typedef struct legion_byte_offset_t {
317 int offset;
319
323 typedef struct legion_input_args_t {
324 char** argv;
325 int argc;
327
332 bool leaf /* = false */;
333 bool inner /* = false */;
334 bool idempotent /* = false */;
335 bool replicable /* = false */;
337
341 typedef struct legion_processor_t {
342 realm_id_t id;
344
348 typedef struct legion_memory_t {
349 realm_id_t id;
351
355 typedef struct legion_task_slice_t {
356 legion_domain_t domain;
358 bool recurse;
359 bool stealable;
361
365 typedef struct legion_phase_barrier_t {
366 // From Realm::Event
367 realm_id_t id;
368 // From Realm::Barrier
369 realm_barrier_timestamp_t timestamp;
371
376 // From Legion::PhaseBarrier
377 // From Realm::Event
378 realm_id_t id;
379 // From Realm::Barrier
380 realm_barrier_timestamp_t timestamp;
381 // From Legion::DynamicCollective
382 legion_reduction_op_id_t redop;
384
388 typedef struct legion_task_options_t {
389 legion_processor_t initial_proc;
390 bool inline_task;
391 bool stealable;
392 bool map_locally;
393 bool valid_instances;
394 bool memoize;
395 bool replicate;
396 legion_task_priority_t parent_priority;
398
402
406 typedef void (*legion_registration_callback_pointer_t)(
407 legion_machine_t /* machine */, legion_runtime_t /* runtime */,
408 const legion_processor_t* /* local_procs */,
409 unsigned /* num_local_procs */);
410
415 typedef realm_task_pointer_t legion_task_pointer_wrapped_t;
416
421 typedef legion_logical_region_t (*legion_projection_functor_logical_region_t)(
422 legion_runtime_t /* runtime */, legion_logical_region_t /* upper_bound */,
423 legion_domain_point_t /* point */, legion_domain_t /* launch domain */);
424
430 *legion_projection_functor_logical_partition_t)(
431 legion_runtime_t /* runtime */,
432 legion_logical_partition_t /* upper_bound */,
433 legion_domain_point_t /* point */, legion_domain_t /* launch domain */);
434
440 *legion_projection_functor_logical_region_args_t)(
441 legion_runtime_t /* runtime */, legion_logical_region_t /* upper_bound */,
442 legion_domain_point_t /* point */, legion_domain_t /* launch domain */,
443 const void* /* args */, size_t /* size */);
444
450 *legion_projection_functor_logical_partition_args_t)(
451 legion_runtime_t /* runtime */,
452 legion_logical_partition_t /* upper_bound */,
453 legion_domain_point_t /* point */, legion_domain_t /* launch domain */,
454 const void* /* args */, size_t /* size */);
455
461 *legion_projection_functor_logical_region_mappable_t)(
462 legion_runtime_t /* runtime */, legion_mappable_t /* mappable */,
463 unsigned /* index */, legion_logical_region_t /* upper_bound */,
464 legion_domain_point_t /* point */);
465
471 *legion_projection_functor_logical_partition_mappable_t)(
472 legion_runtime_t /* runtime */, legion_mappable_t /* mappable */,
473 unsigned /* index */, legion_logical_partition_t /* upper_bound */,
474 legion_domain_point_t /* point */);
475
476 // -----------------------------------------------------------------------
477 // Pointer Operations
478 // -----------------------------------------------------------------------
479
483 legion_ptr_t legion_ptr_nil(void);
484
488 bool legion_ptr_is_null(legion_ptr_t ptr);
489
494 legion_ptr_t legion_ptr_safe_cast(
495 legion_runtime_t runtime, legion_context_t ctx, legion_ptr_t pointer,
497
498 // -----------------------------------------------------------------------
499 // Domain Operations
500 // -----------------------------------------------------------------------
501
505 legion_domain_t legion_domain_empty(unsigned dim);
506
510#define FROM_RECT(DIM) \
511 legion_domain_t legion_domain_from_rect_##DIM##d(legion_rect_##DIM##d_t r);
512 LEGION_FOREACH_N(FROM_RECT)
513#undef FROM_RECT
514
518 legion_domain_t legion_domain_from_index_space(
519 legion_runtime_t runtime, legion_index_space_t is);
520
524#define GET_RECT(DIM) \
525 legion_rect_##DIM##d_t legion_domain_get_rect_##DIM##d(legion_domain_t d);
526 LEGION_FOREACH_N(GET_RECT)
527#undef GET_RECT
528
529 bool legion_domain_is_dense(legion_domain_t d);
530
531 // These are the same as above but will ignore
532 // the existence of any sparsity map, whereas the
533 // ones above will fail if a sparsity map exists
534#define GET_BOUNDS(DIM) \
535 legion_rect_##DIM##d_t legion_domain_get_bounds_##DIM##d(legion_domain_t d);
536 LEGION_FOREACH_N(GET_BOUNDS)
537#undef GET_BOUNDS
538
542 bool legion_domain_contains(legion_domain_t d, legion_domain_point_t p);
543
547 size_t legion_domain_get_volume(legion_domain_t d);
548
549 // -----------------------------------------------------------------------
550 // Domain Transform Operations
551 // -----------------------------------------------------------------------
552
553 legion_domain_transform_t legion_domain_transform_identity(
554 unsigned m, unsigned n);
555
556#define FROM_TRANSFORM(D1, D2) \
557 legion_domain_transform_t legion_domain_transform_from_##D1##x##D2( \
558 legion_transform_##D1##x##D2##_t t);
559 LEGION_FOREACH_NN(FROM_TRANSFORM)
560#undef FROM_TRANSFORM
561
562 legion_domain_affine_transform_t legion_domain_affine_transform_identity(
563 unsigned m, unsigned n);
564
565#define FROM_AFFINE(D1, D2) \
566 legion_domain_affine_transform_t \
567 legion_domain_affine_transform_from_##D1##x##D2( \
568 legion_affine_transform_##D1##x##D2##_t t);
569 LEGION_FOREACH_NN(FROM_AFFINE)
570#undef FROM_AFFINE
571
572 // -----------------------------------------------------------------------
573 // Domain Point Operations
574 // -----------------------------------------------------------------------
575
579#define FROM_POINT(DIM) \
580 legion_domain_point_t legion_domain_point_from_point_##DIM##d( \
581 legion_point_##DIM##d_t p);
582 LEGION_FOREACH_N(FROM_POINT)
583#undef FROM_POINT
584
588#define GET_POINT(DIM) \
589 legion_point_##DIM##d_t legion_domain_point_get_point_##DIM##d( \
590 legion_domain_point_t p);
591 LEGION_FOREACH_N(GET_POINT)
592#undef GET_POINT
593
594 legion_domain_point_t legion_domain_point_origin(unsigned dim);
595
599 legion_domain_point_t legion_domain_point_nil(void);
600
604 bool legion_domain_point_is_null(legion_domain_point_t point);
605
610 legion_domain_point_t legion_domain_point_safe_cast(
611 legion_runtime_t runtime, legion_context_t ctx,
613
614 // -----------------------------------------------------------------------
615 // Domain Point Iterator
616 // -----------------------------------------------------------------------
617
623 legion_domain_point_iterator_t legion_domain_point_iterator_create(
624 legion_domain_t handle);
625
631 void legion_domain_point_iterator_destroy(
632 legion_domain_point_iterator_t handle);
633
637 bool legion_domain_point_iterator_has_next(
638 legion_domain_point_iterator_t handle);
639
643 legion_domain_point_t legion_domain_point_iterator_next(
644 legion_domain_point_iterator_t handle);
645
646 // -----------------------------------------------------------------------
647 // Rect in Domain Iterator
648 // -----------------------------------------------------------------------
649
655#define ITERATOR_CREATE(DIM) \
656 legion_rect_in_domain_iterator_##DIM##d_t \
657 legion_rect_in_domain_iterator_create_##DIM##d(legion_domain_t handle);
658 LEGION_FOREACH_N(ITERATOR_CREATE)
659#undef ITERATOR_CREATE
660
666#define ITERATOR_DESTROY(DIM) \
667 void legion_rect_in_domain_iterator_destroy_##DIM##d( \
668 legion_rect_in_domain_iterator_##DIM##d_t handle);
669 LEGION_FOREACH_N(ITERATOR_DESTROY)
670#undef ITERATOR_DESTROY
671
675#define ITERATOR_VALID(DIM) \
676 bool legion_rect_in_domain_iterator_valid_##DIM##d( \
677 legion_rect_in_domain_iterator_##DIM##d_t handle);
678 LEGION_FOREACH_N(ITERATOR_VALID)
679#undef ITERATOR_VALID
680
684#define ITERATOR_STEP(DIM) \
685 bool legion_rect_in_domain_iterator_step_##DIM##d( \
686 legion_rect_in_domain_iterator_##DIM##d_t handle);
687 LEGION_FOREACH_N(ITERATOR_STEP)
688#undef ITERATOR_STEP
689
693#define ITERATOR_OP(DIM) \
694 legion_rect_##DIM##d_t legion_rect_in_domain_iterator_get_rect_##DIM##d( \
695 legion_rect_in_domain_iterator_##DIM##d_t handle);
696 LEGION_FOREACH_N(ITERATOR_OP)
697#undef ITERATOR_OP
698
699 // -----------------------------------------------------------------------
700 // Coloring Operations
701 // -----------------------------------------------------------------------
702
708 legion_coloring_t legion_coloring_create(void);
709
715 void legion_coloring_destroy(legion_coloring_t handle);
716
720 void legion_coloring_ensure_color(
721 legion_coloring_t handle, legion_color_t color);
722
726 void legion_coloring_add_point(
727 legion_coloring_t handle, legion_color_t color, legion_ptr_t point);
728
732 void legion_coloring_delete_point(
733 legion_coloring_t handle, legion_color_t color, legion_ptr_t point);
734
738 bool legion_coloring_has_point(
739 legion_coloring_t handle, legion_color_t color, legion_ptr_t point);
740
744 void legion_coloring_add_range(
745 legion_coloring_t handle, legion_color_t color, legion_ptr_t start,
746 legion_ptr_t end );
747
748 // -----------------------------------------------------------------------
749 // Domain Coloring Operations
750 // -----------------------------------------------------------------------
751
757 legion_domain_coloring_t legion_domain_coloring_create(void);
758
764 void legion_domain_coloring_destroy(legion_domain_coloring_t handle);
765
769 void legion_domain_coloring_color_domain(
770 legion_domain_coloring_t handle, legion_color_t color,
771 legion_domain_t domain);
772
776 legion_domain_t legion_domain_coloring_get_color_space(
777 legion_domain_coloring_t handle);
778
779 // -----------------------------------------------------------------------
780 // Point Coloring Operations
781 // -----------------------------------------------------------------------
782
788 legion_point_coloring_t legion_point_coloring_create(void);
789
795 void legion_point_coloring_destroy(legion_point_coloring_t handle);
796
800 void legion_point_coloring_add_point(
801 legion_point_coloring_t handle, legion_domain_point_t color,
802 legion_ptr_t point);
803
807 void legion_point_coloring_add_range(
808 legion_point_coloring_t handle, legion_domain_point_t color,
809 legion_ptr_t start, legion_ptr_t end );
810
811 // -----------------------------------------------------------------------
812 // Domain Point Coloring Operations
813 // -----------------------------------------------------------------------
814
820 legion_domain_point_coloring_t legion_domain_point_coloring_create(void);
821
827 void legion_domain_point_coloring_destroy(
828 legion_domain_point_coloring_t handle);
829
833 void legion_domain_point_coloring_color_domain(
834 legion_domain_point_coloring_t handle, legion_domain_point_t color,
835 legion_domain_t domain);
836
837 // -----------------------------------------------------------------------
838 // Multi-Domain Point Coloring Operations
839 // -----------------------------------------------------------------------
840
846 legion_multi_domain_point_coloring_t
847 legion_multi_domain_point_coloring_create(void);
848
854 void legion_multi_domain_point_coloring_destroy(
855 legion_multi_domain_point_coloring_t handle);
856
860 void legion_multi_domain_point_coloring_color_domain(
861 legion_multi_domain_point_coloring_t handle, legion_domain_point_t color,
862 legion_domain_t domain);
863
864 // -----------------------------------------------------------------------
865 // Index Space Operations
866 // ----------------------------------------------------------------------
867
873 legion_index_space_t legion_index_space_create(
874 legion_runtime_t runtime, legion_context_t ctx, size_t max_num_elmts);
875
881 legion_index_space_t legion_index_space_create_domain(
882 legion_runtime_t runtime, legion_context_t ctx, legion_domain_t domain);
883
889 legion_index_space_t legion_index_space_create_future(
890 legion_runtime_t runtime, legion_context_t ctx, size_t dimensions,
891 legion_future_t future, legion_type_tag_t type_tag /*=0*/);
892
898 legion_index_space_t legion_index_space_union(
899 legion_runtime_t runtime, legion_context_t ctx,
900 const legion_index_space_t* spaces, size_t num_spaces);
901
907 legion_index_space_t legion_index_space_intersection(
908 legion_runtime_t runtime, legion_context_t ctx,
909 const legion_index_space_t* spaces, size_t num_spaces);
910
916 legion_index_space_t legion_index_space_subtraction(
917 legion_runtime_t runtime, legion_context_t ctx, legion_index_space_t left,
919
923 bool legion_index_space_has_multiple_domains(
924 legion_runtime_t runtime, legion_index_space_t handle);
925
931 legion_domain_t legion_index_space_get_domain(
932 legion_runtime_t runtime, legion_index_space_t handle);
933
939 bool legion_index_space_has_parent_index_partition(
940 legion_runtime_t runtime, legion_index_space_t handle);
946 legion_index_partition_t legion_index_space_get_parent_index_partition(
947 legion_runtime_t runtime, legion_index_space_t handle);
948
954 void legion_index_space_create_shared_ownership(
955 legion_runtime_t runtime, legion_context_t ctx,
956 legion_index_space_t handle);
957
963 void legion_index_space_destroy(
964 legion_runtime_t runtime, legion_context_t ctx,
965 legion_index_space_t handle);
966
972 void legion_index_space_destroy_unordered(
973 legion_runtime_t runtime, legion_context_t ctx,
974 legion_index_space_t handle, bool unordered);
975
979 void legion_index_space_attach_semantic_information(
980 legion_runtime_t runtime, legion_index_space_t handle,
981 legion_semantic_tag_t tag, const void* buffer, size_t size,
982 bool is_mutable /* = false */);
983
987 bool legion_index_space_retrieve_semantic_information(
988 legion_runtime_t runtime, legion_index_space_t handle,
989 legion_semantic_tag_t tag, const void** result, size_t* size,
990 bool can_fail /* = false */, bool wait_until_ready /* = false */);
991
995 void legion_index_space_attach_name(
996 legion_runtime_t runtime, legion_index_space_t handle, const char* name,
997 bool is_mutable /* = false */);
998
1002 void legion_index_space_retrieve_name(
1003 legion_runtime_t runtime, legion_index_space_t handle,
1004 const char** result);
1005
1011 int legion_index_space_get_dim(legion_index_space_t handle);
1012
1013 // -----------------------------------------------------------------------
1014 // Index Partition Operations
1015 // -----------------------------------------------------------------------
1016
1023 legion_index_partition_t legion_index_partition_create_coloring(
1024 legion_runtime_t runtime, legion_context_t ctx,
1025 legion_index_space_t parent, legion_coloring_t coloring, bool disjoint,
1026 legion_color_t part_color /* = AUTO_GENERATE_ID */);
1027
1034 legion_index_partition_t legion_index_partition_create_domain_coloring(
1035 legion_runtime_t runtime, legion_context_t ctx,
1036 legion_index_space_t parent, legion_domain_t color_space,
1037 legion_domain_coloring_t coloring, bool disjoint,
1038 legion_color_t part_color /* = AUTO_GENERATE_ID */);
1039
1046 legion_index_partition_t legion_index_partition_create_point_coloring(
1047 legion_runtime_t runtime, legion_context_t ctx,
1048 legion_index_space_t parent, legion_domain_t color_space,
1049 legion_point_coloring_t coloring,
1050 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1051 legion_color_t color /* = AUTO_GENERATE_ID */);
1052
1060 legion_index_partition_t legion_index_partition_create_domain_point_coloring(
1061 legion_runtime_t runtime, legion_context_t ctx,
1062 legion_index_space_t parent, legion_domain_t color_space,
1063 legion_domain_point_coloring_t coloring,
1064 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1065 legion_color_t color /* = AUTO_GENERATE_ID */);
1066
1075 legion_index_partition_create_multi_domain_point_coloring(
1076 legion_runtime_t runtime, legion_context_t ctx,
1077 legion_index_space_t parent, legion_domain_t color_space,
1078 legion_multi_domain_point_coloring_t coloring,
1079 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1080 legion_color_t color /* = AUTO_GENERATE_ID */);
1081
1088#define CREATE_BLOCKIFY(DIM) \
1089 legion_index_partition_t legion_index_partition_create_blockify_##DIM##d( \
1090 legion_runtime_t runtime, legion_context_t ctx, \
1091 legion_index_space_t parent, legion_blockify_##DIM##d_t blockify, \
1092 legion_color_t part_color /* = AUTO_GENERATE_ID */);
1093 LEGION_FOREACH_N(CREATE_BLOCKIFY)
1094#undef CREATE_BLOCKIFY
1095
1101 legion_index_partition_t legion_index_partition_create_equal(
1102 legion_runtime_t runtime, legion_context_t ctx,
1103 legion_index_space_t parent, legion_index_space_t color_space,
1104 size_t granularity, legion_color_t color /* = AUTO_GENERATE_ID */);
1105
1111 legion_index_partition_t legion_index_partition_create_by_weights(
1112 legion_runtime_t runtime, legion_context_t ctx,
1113 legion_index_space_t parent, legion_domain_point_t* colors, int* weights,
1114 size_t num_colors, legion_index_space_t color_space,
1115 size_t granularity /* = 1 */,
1116 legion_color_t color /* = AUTO_GENERATE_ID */);
1117
1123 legion_index_partition_t legion_index_partition_create_by_weights_future_map(
1124 legion_runtime_t runtime, legion_context_t ctx,
1125 legion_index_space_t parent, legion_future_map_t future_map,
1126 legion_index_space_t color_space, size_t granularity /* = 1 */,
1127 legion_color_t color /* = AUTO_GENERATE_ID */);
1128
1134 legion_index_partition_t legion_index_partition_create_by_union(
1135 legion_runtime_t runtime, legion_context_t ctx,
1138 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1139 legion_color_t color /* = AUTO_GENERATE_ID */);
1140
1146 legion_index_partition_t legion_index_partition_create_by_intersection(
1147 legion_runtime_t runtime, legion_context_t ctx,
1150 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1151 legion_color_t color /* = AUTO_GENERATE_ID */);
1152
1158 legion_index_partition_t legion_index_partition_create_by_intersection_mirror(
1159 legion_runtime_t runtime, legion_context_t ctx,
1161 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1162 legion_color_t color /* = AUTO_GENERATE_ID */,
1163 bool dominates /* = false */);
1164
1170 legion_index_partition_t legion_index_partition_create_by_difference(
1171 legion_runtime_t runtime, legion_context_t ctx,
1174 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1175 legion_color_t color /* = AUTO_GENERATE_ID */);
1176
1182 legion_index_partition_t legion_index_partition_create_by_domain(
1183 legion_runtime_t runtime, legion_context_t ctx,
1185 legion_domain_t* domains, size_t num_color_domains,
1186 legion_index_space_t color_space, bool perform_intersections /* = true */,
1187 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1188 legion_color_t color /* = AUTO_GENERATE_ID */);
1189
1195 legion_index_partition_t legion_index_partition_create_by_domain_future_map(
1196 legion_runtime_t runtime, legion_context_t ctx,
1197 legion_index_space_t parent, legion_future_map_t future_map,
1198 legion_index_space_t color_space, bool perform_intersections /* = true */,
1199 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1200 legion_color_t color /* = AUTO_GENERATE_ID */);
1201
1207 legion_index_partition_t legion_index_partition_create_by_field(
1208 legion_runtime_t runtime, legion_context_t ctx,
1210 legion_field_id_t fid, legion_index_space_t color_space,
1211 legion_color_t color /* = AUTO_GENERATE_ID */,
1212 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */,
1213 legion_partition_kind_t part_kind /* = DISJOINT_KIND */,
1214 legion_untyped_buffer_t map_arg);
1215
1221 legion_index_partition_t legion_index_partition_create_by_image(
1222 legion_runtime_t runtime, legion_context_t ctx,
1224 legion_logical_region_t parent, legion_field_id_t fid,
1225 legion_index_space_t color_space,
1226 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1227 legion_color_t color /* = AUTO_GENERATE_ID */,
1228 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */,
1229 legion_untyped_buffer_t map_arg);
1230
1236 legion_index_partition_t legion_index_partition_create_by_preimage(
1237 legion_runtime_t runtime, legion_context_t ctx,
1239 legion_logical_region_t parent, legion_field_id_t fid,
1240 legion_index_space_t color_space,
1241 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1242 legion_color_t color /* = AUTO_GENERATE_ID */,
1243 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */,
1244 legion_untyped_buffer_t map_arg);
1245
1251 legion_index_partition_t legion_index_partition_create_by_image_range(
1252 legion_runtime_t runtime, legion_context_t ctx,
1254 legion_logical_region_t parent, legion_field_id_t fid,
1255 legion_index_space_t color_space,
1256 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1257 legion_color_t color /* = AUTO_GENERATE_ID */,
1258 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */,
1259 legion_untyped_buffer_t map_arg);
1260
1266 legion_index_partition_t legion_index_partition_create_by_preimage_range(
1267 legion_runtime_t runtime, legion_context_t ctx,
1269 legion_logical_region_t parent, legion_field_id_t fid,
1270 legion_index_space_t color_space,
1271 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1272 legion_color_t color /* = AUTO_GENERATE_ID */,
1273 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */,
1274 legion_untyped_buffer_t map_arg);
1275
1281 legion_index_partition_t legion_index_partition_create_by_restriction(
1282 legion_runtime_t runtime, legion_context_t ctx,
1283 legion_index_space_t parent, legion_index_space_t color_space,
1285 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1286 legion_color_t color /* = AUTO_GENERATE_ID */);
1287
1293 legion_index_partition_t legion_index_partition_create_pending_partition(
1294 legion_runtime_t runtime, legion_context_t ctx,
1295 legion_index_space_t parent, legion_index_space_t color_space,
1296 legion_partition_kind_t part_kind /* = COMPUTE_KIND */,
1297 legion_color_t color /* = AUTO_GENERATE_ID */);
1298
1302 legion_index_space_t legion_index_partition_create_index_space_union_spaces(
1303 legion_runtime_t runtime, legion_context_t ctx,
1305 const legion_index_space_t* spaces, size_t num_spaces);
1306
1311 legion_index_partition_create_index_space_union_partition(
1312 legion_runtime_t runtime, legion_context_t ctx,
1315
1320 legion_index_partition_create_index_space_intersection_spaces(
1321 legion_runtime_t runtime, legion_context_t ctx,
1323 const legion_index_space_t* spaces, size_t num_spaces);
1324
1329 legion_index_partition_create_index_space_intersection_partition(
1330 legion_runtime_t runtime, legion_context_t ctx,
1333
1337 legion_index_space_t legion_index_partition_create_index_space_difference(
1338 legion_runtime_t runtime, legion_context_t ctx,
1340 legion_index_space_t initial, const legion_index_space_t* spaces,
1341 size_t num_spaces);
1342
1346 bool legion_index_partition_is_disjoint(
1347 legion_runtime_t runtime, legion_index_partition_t handle);
1348
1352 bool legion_index_partition_is_complete(
1353 legion_runtime_t runtime, legion_index_partition_t handle);
1354
1360 legion_index_space_t legion_index_partition_get_index_subspace(
1361 legion_runtime_t runtime, legion_index_partition_t handle,
1362 legion_color_t color);
1363
1369 legion_index_space_t legion_index_partition_get_index_subspace_domain_point(
1370 legion_runtime_t runtime, legion_index_partition_t handle,
1371 legion_domain_point_t color);
1372
1376 bool legion_index_partition_has_index_subspace_domain_point(
1377 legion_runtime_t runtime, legion_index_partition_t handle,
1378 legion_domain_point_t color);
1379
1383 legion_index_space_t legion_index_partition_get_color_space(
1384 legion_runtime_t runtime, legion_index_partition_t handle);
1385
1389 legion_color_t legion_index_partition_get_color(
1390 legion_runtime_t runtime, legion_index_partition_t handle);
1391
1397 legion_index_space_t legion_index_partition_get_parent_index_space(
1398 legion_runtime_t runtime, legion_index_partition_t handle);
1399
1405 void legion_index_partition_create_shared_ownership(
1406 legion_runtime_t runtime, legion_context_t ctx,
1408
1414 void legion_index_partition_destroy(
1415 legion_runtime_t runtime, legion_context_t ctx,
1417
1423 void legion_index_partition_destroy_unordered(
1424 legion_runtime_t runtime, legion_context_t ctx,
1425 legion_index_partition_t handle, bool unordered /* = false */,
1426 bool recurse /* = true */);
1427
1431 void legion_index_partition_attach_semantic_information(
1432 legion_runtime_t runtime, legion_index_partition_t handle,
1433 legion_semantic_tag_t tag, const void* buffer, size_t size,
1434 bool is_mutable /* = false */);
1435
1439 bool legion_index_partition_retrieve_semantic_information(
1440 legion_runtime_t runtime, legion_index_partition_t handle,
1441 legion_semantic_tag_t tag, const void** result, size_t* size,
1442 bool can_fail /* = false */, bool wait_until_ready /* = false */);
1443
1447 void legion_index_partition_attach_name(
1448 legion_runtime_t runtime, legion_index_partition_t handle,
1449 const char* name, bool is_mutable /* = false */);
1450
1454 void legion_index_partition_retrieve_name(
1455 legion_runtime_t runtime, legion_index_partition_t handle,
1456 const char** result);
1457
1458 // -----------------------------------------------------------------------
1459 // Field Space Operations
1460 // -----------------------------------------------------------------------
1461
1467 legion_field_space_t legion_field_space_create(
1468 legion_runtime_t runtime, legion_context_t ctx);
1469
1475 legion_field_space_t legion_field_space_create_with_fields(
1476 legion_runtime_t runtime, legion_context_t ctx, size_t* field_sizes,
1477 legion_field_id_t* field_ids, size_t num_fields,
1478 legion_custom_serdez_id_t serdez);
1479
1485 legion_field_space_t legion_field_space_create_with_futures(
1486 legion_runtime_t runtime, legion_context_t ctx,
1487 legion_future_t* field_sizes, legion_field_id_t* field_ids,
1488 size_t num_fields, legion_custom_serdez_id_t serdez);
1489
1493 legion_field_space_t legion_field_space_no_space();
1494
1500 void legion_field_space_create_shared_ownership(
1501 legion_runtime_t runtime, legion_context_t ctx,
1502 legion_field_space_t handle);
1503
1509 void legion_field_space_destroy(
1510 legion_runtime_t runtime, legion_context_t ctx,
1511 legion_field_space_t handle);
1512
1518 void legion_field_space_destroy_unordered(
1519 legion_runtime_t runtime, legion_context_t ctx,
1520 legion_field_space_t handle, bool unordered);
1521
1525 void legion_field_space_attach_semantic_information(
1526 legion_runtime_t runtime, legion_field_space_t handle,
1527 legion_semantic_tag_t tag, const void* buffer, size_t size,
1528 bool is_mutable /* = false */);
1529
1533 bool legion_field_space_retrieve_semantic_information(
1534 legion_runtime_t runtime, legion_field_space_t handle,
1535 legion_semantic_tag_t tag, const void** result, size_t* size,
1536 bool can_fail /* = false */, bool wait_until_ready /* = false */);
1537
1543 legion_field_id_t* legion_field_space_get_fields(
1544 legion_runtime_t runtime, legion_context_t ctx,
1545 legion_field_space_t handle, size_t* size);
1546
1552 bool legion_field_space_has_fields(
1553 legion_runtime_t runtime, legion_context_t ctx,
1554 legion_field_space_t handle, const legion_field_id_t* fields,
1555 size_t fields_size);
1556
1560 void legion_field_id_attach_semantic_information(
1561 legion_runtime_t runtime, legion_field_space_t handle,
1562 legion_field_id_t id, legion_semantic_tag_t tag, const void* buffer,
1563 size_t size, bool is_mutable /* = false */);
1564
1568 bool legion_field_id_retrieve_semantic_information(
1569 legion_runtime_t runtime, legion_field_space_t handle,
1570 legion_field_id_t id, legion_semantic_tag_t tag, const void** result,
1571 size_t* size, bool can_fail /* = false */,
1572 bool wait_until_ready /* = false */);
1573
1577 void legion_field_space_attach_name(
1578 legion_runtime_t runtime, legion_field_space_t handle, const char* name,
1579 bool is_mutable /* = false */);
1580
1584 void legion_field_space_retrieve_name(
1585 legion_runtime_t runtime, legion_field_space_t handle,
1586 const char** result);
1587
1591 void legion_field_id_attach_name(
1592 legion_runtime_t runtime, legion_field_space_t handle,
1593 legion_field_id_t id, const char* name, bool is_mutable /* = false */);
1594
1598 void legion_field_id_retrieve_name(
1599 legion_runtime_t runtime, legion_field_space_t handle,
1600 legion_field_id_t id, const char** result);
1601
1605 size_t legion_field_id_get_size(
1606 legion_runtime_t runtime, legion_context_t ctx,
1607 legion_field_space_t handle, legion_field_id_t id);
1608
1609 // -----------------------------------------------------------------------
1610 // Logical Region Operations
1611 // -----------------------------------------------------------------------
1612
1618 legion_logical_region_t legion_logical_region_create(
1619 legion_runtime_t runtime, legion_context_t ctx,
1620 legion_index_space_t index, legion_field_space_t fields, bool task_local);
1621
1627 void legion_logical_region_create_shared_ownership(
1628 legion_runtime_t runtime, legion_context_t ctx,
1630
1636 void legion_logical_region_destroy(
1637 legion_runtime_t runtime, legion_context_t ctx,
1639
1645 void legion_logical_region_destroy_unordered(
1646 legion_runtime_t runtime, legion_context_t ctx,
1647 legion_logical_region_t handle, bool unordered);
1648
1652 legion_color_t legion_logical_region_get_color(
1653 legion_runtime_t runtime, legion_logical_region_t handle);
1654
1658 legion_domain_point_t legion_logical_region_get_color_domain_point(
1659 legion_runtime_t runtime_, legion_logical_region_t handle_);
1660
1664 bool legion_logical_region_has_parent_logical_partition(
1665 legion_runtime_t runtime, legion_logical_region_t handle);
1666
1670 legion_logical_partition_t legion_logical_region_get_parent_logical_partition(
1671 legion_runtime_t runtime, legion_logical_region_t handle);
1672
1676 void legion_logical_region_attach_semantic_information(
1677 legion_runtime_t runtime, legion_logical_region_t handle,
1678 legion_semantic_tag_t tag, const void* buffer, size_t size,
1679 bool is_mutable /* = false */);
1680
1684 bool legion_logical_region_retrieve_semantic_information(
1685 legion_runtime_t runtime, legion_logical_region_t handle,
1686 legion_semantic_tag_t tag, const void** result, size_t* size,
1687 bool can_fail /* = false */, bool wait_until_ready /* = false */);
1688
1692 void legion_logical_region_attach_name(
1693 legion_runtime_t runtime, legion_logical_region_t handle,
1694 const char* name, bool is_mutable /* = false */);
1695
1699 void legion_logical_region_retrieve_name(
1700 legion_runtime_t runtime, legion_logical_region_t handle,
1701 const char** result);
1702
1706 legion_index_space_t legion_logical_region_get_index_space(
1708
1709 // -----------------------------------------------------------------------
1710 // Logical Region Tree Traversal Operations
1711 // -----------------------------------------------------------------------
1712
1718 legion_logical_partition_t legion_logical_partition_create(
1719 legion_runtime_t runtime, legion_logical_region_t parent,
1721
1727 legion_logical_partition_t legion_logical_partition_create_by_tree(
1728 legion_runtime_t runtime, legion_context_t ctx,
1730 legion_region_tree_id_t tid);
1731
1737 void legion_logical_partition_destroy(
1738 legion_runtime_t runtime, legion_context_t ctx,
1740
1746 void legion_logical_partition_destroy_unordered(
1747 legion_runtime_t runtime, legion_context_t ctx,
1748 legion_logical_partition_t handle, bool unordered);
1749
1755 legion_logical_region_t legion_logical_partition_get_logical_subregion(
1756 legion_runtime_t runtime, legion_logical_partition_t parent,
1757 legion_index_space_t handle);
1758
1765 legion_logical_partition_get_logical_subregion_by_color(
1766 legion_runtime_t runtime, legion_logical_partition_t parent,
1767 legion_color_t c);
1768
1775 legion_logical_partition_get_logical_subregion_by_color_domain_point(
1776 legion_runtime_t runtime, legion_logical_partition_t parent,
1778
1782 bool legion_logical_partition_has_logical_subregion_by_color_domain_point(
1783 legion_runtime_t runtime, legion_logical_partition_t parent,
1785
1792 legion_logical_partition_get_logical_subregion_by_tree(
1793 legion_runtime_t runtime, legion_index_space_t handle,
1794 legion_field_space_t fspace, legion_region_tree_id_t tid);
1795
1799 legion_logical_region_t legion_logical_partition_get_parent_logical_region(
1800 legion_runtime_t runtime, legion_logical_partition_t handle);
1801
1805 void legion_logical_partition_attach_semantic_information(
1806 legion_runtime_t runtime, legion_logical_partition_t handle,
1807 legion_semantic_tag_t tag, const void* buffer, size_t size,
1808 bool is_mutable /* = false */);
1809
1813 bool legion_logical_partition_retrieve_semantic_information(
1814 legion_runtime_t runtime, legion_logical_partition_t handle,
1815 legion_semantic_tag_t tag, const void** result, size_t* size,
1816 bool can_fail /* = false */, bool wait_until_ready /* = false */);
1817
1821 void legion_logical_partition_attach_name(
1822 legion_runtime_t runtime, legion_logical_partition_t handle,
1823 const char* name, bool is_mutable /* = false */);
1824
1828 void legion_logical_partition_retrieve_name(
1829 legion_runtime_t runtime, legion_logical_partition_t handle,
1830 const char** result);
1831
1838 void legion_reset_equivalence_sets(
1839 legion_runtime_t runtime, legion_context_t ctx,
1841 int num_fields, legion_field_id_t* fields);
1842
1843 // -----------------------------------------------------------------------
1844 // Region Requirement Operations
1845 // -----------------------------------------------------------------------
1846
1850 legion_region_requirement_t legion_region_requirement_create_logical_region(
1851 legion_logical_region_t handle, legion_privilege_mode_t priv,
1852 legion_coherence_property_t prop, legion_logical_region_t parent,
1853 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
1854
1858 legion_region_requirement_t
1859 legion_region_requirement_create_logical_region_projection(
1860 legion_logical_region_t handle, legion_projection_id_t proj /* = 0 */,
1861 legion_privilege_mode_t priv, legion_coherence_property_t prop,
1862 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
1863 bool verified /* = false*/);
1864
1868 legion_region_requirement_t
1869 legion_region_requirement_create_logical_partition(
1871 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
1872 legion_coherence_property_t prop, legion_logical_region_t parent,
1873 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
1874
1878 void legion_region_requirement_destroy(legion_region_requirement_t handle);
1879
1883 void legion_region_requirement_add_field(
1884 legion_region_requirement_t handle, legion_field_id_t field,
1885 bool instance_field);
1886
1890 void legion_region_requirement_add_flags(
1891 legion_region_requirement_t handle, legion_region_flags_t flags);
1892
1896 legion_logical_region_t legion_region_requirement_get_region(
1897 legion_region_requirement_t handle);
1898
1902 legion_logical_region_t legion_region_requirement_get_parent(
1903 legion_region_requirement_t handle);
1904
1908 legion_logical_partition_t legion_region_requirement_get_partition(
1909 legion_region_requirement_t handle);
1910
1914 unsigned legion_region_requirement_get_privilege_fields_size(
1915 legion_region_requirement_t handle);
1916
1928 void legion_region_requirement_get_privilege_fields(
1929 legion_region_requirement_t handle, legion_field_id_t* fields,
1930 unsigned fields_size);
1931
1939 legion_field_id_t legion_region_requirement_get_privilege_field(
1940 legion_region_requirement_t handle, unsigned idx);
1941
1945 unsigned legion_region_requirement_get_instance_fields_size(
1946 legion_region_requirement_t handle);
1947
1959 void legion_region_requirement_get_instance_fields(
1960 legion_region_requirement_t handle, legion_field_id_t* fields,
1961 unsigned fields_size);
1962
1968 legion_field_id_t legion_region_requirement_get_instance_field(
1969 legion_region_requirement_t handle, unsigned idx);
1970
1974 legion_privilege_mode_t legion_region_requirement_get_privilege(
1975 legion_region_requirement_t handle);
1976
1980 legion_coherence_property_t legion_region_requirement_get_prop(
1981 legion_region_requirement_t handle);
1982
1986 legion_reduction_op_id_t legion_region_requirement_get_redop(
1987 legion_region_requirement_t handle);
1988
1992 legion_mapping_tag_id_t legion_region_requirement_get_tag(
1993 legion_region_requirement_t handle);
1994
1998 legion_handle_type_t legion_region_requirement_get_handle_type(
1999 legion_region_requirement_t handle);
2000
2004 legion_projection_id_t legion_region_requirement_get_projection(
2005 legion_region_requirement_t handle);
2006
2007 // -----------------------------------------------------------------------
2008 // Output Requirement Operations
2009 // -----------------------------------------------------------------------
2010
2014 legion_output_requirement_t legion_output_requirement_create(
2015 legion_field_space_t field_space, legion_field_id_t* fields,
2016 size_t fields_size, int dim, bool global_indexing);
2017
2021 legion_output_requirement_t
2022 legion_output_requirement_create_region_requirement(
2023 legion_region_requirement_t handle);
2024
2028 void legion_output_requirement_destroy(legion_output_requirement_t handle);
2029
2033 void legion_output_requirement_add_field(
2034 legion_output_requirement_t handle, legion_field_id_t field,
2035 bool instance);
2036
2040 legion_logical_region_t legion_output_requirement_get_region(
2041 legion_output_requirement_t handle);
2042
2046 legion_logical_region_t legion_output_requirement_get_parent(
2047 legion_output_requirement_t handle);
2048
2052 legion_logical_partition_t legion_output_requirement_get_partition(
2053 legion_output_requirement_t handle);
2054
2055 // -----------------------------------------------------------------------
2056 // Allocator and Argument Map Operations
2057 // -----------------------------------------------------------------------
2058
2064 legion_field_allocator_t legion_field_allocator_create(
2065 legion_runtime_t runtime, legion_context_t ctx,
2066 legion_field_space_t handle);
2067
2073 void legion_field_allocator_destroy(legion_field_allocator_t handle);
2074
2078 legion_field_id_t legion_auto_generate_id(void);
2079
2083 legion_field_id_t legion_field_allocator_allocate_field(
2084 legion_field_allocator_t allocator, size_t field_size,
2085 legion_field_id_t desired_fieldid /* = AUTO_GENERATE_ID */);
2086
2090 legion_field_id_t legion_field_allocator_allocate_field_future(
2091 legion_field_allocator_t allocator, legion_future_t field_size,
2092 legion_field_id_t desired_fieldid /* = AUTO_GENERATE_ID */);
2093
2097 void legion_field_allocator_free_field(
2098 legion_field_allocator_t allocator, legion_field_id_t fid);
2099
2103 void legion_field_allocator_free_field_unordered(
2104 legion_field_allocator_t allocator, legion_field_id_t fid,
2105 bool unordered);
2106
2110 legion_field_id_t legion_field_allocator_allocate_local_field(
2111 legion_field_allocator_t allocator, size_t field_size,
2112 legion_field_id_t desired_fieldid /* = AUTO_GENERATE_ID */);
2113
2119 legion_argument_map_t legion_argument_map_create(void);
2120
2126 legion_argument_map_t legion_argument_map_from_future_map(
2127 legion_future_map_t map);
2128
2132 void legion_argument_map_set_point(
2133 legion_argument_map_t map, legion_domain_point_t dp,
2134 legion_untyped_buffer_t arg, bool replace /* = true */);
2135
2139 void legion_argument_map_set_future(
2140 legion_argument_map_t map, legion_domain_point_t dp,
2141 legion_future_t future, bool replace /* = true */);
2142
2148 void legion_argument_map_destroy(legion_argument_map_t handle);
2149
2150 // -----------------------------------------------------------------------
2151 // Predicate Operations
2152 // -----------------------------------------------------------------------
2153
2159 legion_predicate_t legion_predicate_create(
2160 legion_runtime_t runtime, legion_context_t ctx, legion_future_t f);
2161
2167 void legion_predicate_destroy(legion_predicate_t handle);
2168
2174 const legion_predicate_t legion_predicate_true(void);
2175
2181 const legion_predicate_t legion_predicate_false(void);
2182
2183 // -----------------------------------------------------------------------
2184 // Phase Barrier Operations
2185 // -----------------------------------------------------------------------
2186
2192 legion_phase_barrier_t legion_phase_barrier_create(
2193 legion_runtime_t runtime, legion_context_t ctx, unsigned arrivals);
2194
2200 void legion_phase_barrier_destroy(
2201 legion_runtime_t runtime, legion_context_t ctx,
2202 legion_phase_barrier_t handle);
2203
2207 legion_phase_barrier_t legion_phase_barrier_alter_arrival_count(
2208 legion_runtime_t runtime, legion_context_t ctx,
2209 legion_phase_barrier_t handle, int delta);
2210
2214 void legion_phase_barrier_arrive(
2215 legion_runtime_t runtime, legion_context_t ctx,
2216 legion_phase_barrier_t handle, unsigned count /* = 1 */);
2217
2221 void legion_phase_barrier_wait(
2222 legion_runtime_t runtime, legion_context_t ctx,
2223 legion_phase_barrier_t handle);
2224
2230 legion_phase_barrier_t legion_phase_barrier_advance(
2231 legion_runtime_t runtime, legion_context_t ctx,
2232 legion_phase_barrier_t handle);
2233
2234 // -----------------------------------------------------------------------
2235 // Dynamic Collective Operations
2236 // -----------------------------------------------------------------------
2237
2243 legion_dynamic_collective_t legion_dynamic_collective_create(
2244 legion_runtime_t runtime, legion_context_t ctx, unsigned arrivals,
2245 legion_reduction_op_id_t redop, const void* init_value, size_t init_size);
2246
2252 void legion_dynamic_collective_destroy(
2253 legion_runtime_t runtime, legion_context_t ctx,
2255
2259 legion_dynamic_collective_t legion_dynamic_collective_alter_arrival_count(
2260 legion_runtime_t runtime, legion_context_t ctx,
2261 legion_dynamic_collective_t handle, int delta);
2262
2266 void legion_dynamic_collective_arrive(
2267 legion_runtime_t runtime, legion_context_t ctx,
2268 legion_dynamic_collective_t handle, const void* buffer, size_t size,
2269 unsigned count /* = 1 */);
2270
2274 void legion_dynamic_collective_defer_arrival(
2275 legion_runtime_t runtime, legion_context_t ctx,
2276 legion_dynamic_collective_t handle, legion_future_t f,
2277 unsigned count /* = 1 */);
2278
2284 legion_future_t legion_dynamic_collective_get_result(
2285 legion_runtime_t runtime, legion_context_t ctx,
2287
2293 legion_dynamic_collective_t legion_dynamic_collective_advance(
2294 legion_runtime_t runtime, legion_context_t ctx,
2296
2297 // -----------------------------------------------------------------------
2298 // Future Operations
2299 // -----------------------------------------------------------------------
2300
2306 legion_future_t legion_future_from_untyped_pointer(
2307 legion_runtime_t runtime, const void* buffer, size_t size);
2308
2314 legion_future_t legion_future_from_untyped_pointer_detailed(
2315 legion_runtime_t runtime, const void* buffer, size_t size,
2316 bool take_ownership, const char* provenance, bool shard_local);
2317
2323 legion_future_t legion_future_copy(legion_future_t handle);
2324
2330 void legion_future_destroy(legion_future_t handle);
2331
2335 void legion_future_get_void_result(legion_future_t handle);
2336
2340 void legion_future_wait(
2341 legion_future_t handle, bool silence_warnings /* = false */,
2342 const char* warning_string /* = nullptr */);
2343
2347 bool legion_future_is_empty(legion_future_t handle, bool block /* = false */);
2348
2352 bool legion_future_is_ready(legion_future_t handle);
2353
2357 bool legion_future_is_ready_subscribe(legion_future_t handle, bool subscribe);
2358
2362 const void* legion_future_get_untyped_pointer(legion_future_t handle);
2363
2367 size_t legion_future_get_untyped_size(legion_future_t handle);
2368
2372 const void* legion_future_get_metadata(
2373 legion_future_t handle, size_t* size /*=nullptr*/);
2374
2375 // -----------------------------------------------------------------------
2376 // Future Map Operations
2377 // -----------------------------------------------------------------------
2378
2384 legion_future_map_t legion_future_map_copy(legion_future_map_t handle);
2385
2391 void legion_future_map_destroy(legion_future_map_t handle);
2392
2396 void legion_future_map_wait_all_results(legion_future_map_t handle);
2397
2403 legion_future_t legion_future_map_get_future(
2404 legion_future_map_t handle, legion_domain_point_t point);
2405
2409 legion_domain_t legion_future_map_get_domain(legion_future_map_t handle);
2410
2416 legion_future_t legion_future_map_reduce(
2417 legion_runtime_t runtime, legion_context_t ctx,
2418 legion_future_map_t handle, legion_reduction_op_id_t redop,
2419 bool deterministic, legion_mapper_id_t map_id,
2420 legion_mapping_tag_id_t tag);
2421
2427 legion_future_t legion_future_map_reduce_with_initial_value(
2428 legion_runtime_t runtime, legion_context_t ctx,
2429 legion_future_map_t handle, legion_reduction_op_id_t redop,
2430 bool deterministic, legion_mapper_id_t map_id,
2431 legion_mapping_tag_id_t tag, const char* provenance,
2432 legion_future_t initial_value);
2433
2439 legion_future_map_t legion_future_map_construct_from_buffers(
2440 legion_runtime_t runtime, legion_context_t ctx, legion_domain_t domain,
2442 size_t num_points, bool collective, legion_sharding_id_t sid,
2443 bool implicit_sharding);
2444
2450 legion_future_map_t legion_future_map_construct_from_futures(
2451 legion_runtime_t runtime, legion_context_t ctx, legion_domain_t domain,
2452 legion_domain_point_t* points, legion_future_t* futures,
2453 size_t num_futures, bool collective, legion_sharding_id_t sid,
2454 bool implicit_sharding);
2455
2461 legion_future_map_t legion_future_map_transform(
2462 legion_runtime_t runtime, legion_context_t ctx, legion_future_map_t fm,
2463 legion_index_space_t new_domain, legion_point_transform_functor_t functor,
2464 bool take_ownership);
2465
2466 // -----------------------------------------------------------------------
2467 // Deferred Buffer Operations
2468 // -----------------------------------------------------------------------
2469
2475#define BUFFER_CREATE(DIM) \
2476 legion_deferred_buffer_char_##DIM##d_t \
2477 legion_deferred_buffer_char_##DIM##d_create( \
2478 legion_rect_##DIM##d_t bounds, legion_memory_kind_t kind, \
2479 char* initial_value);
2480 LEGION_FOREACH_N(BUFFER_CREATE)
2481#undef BUFFER_CREATE
2482
2483 /*
2484 * @see Legion::DeferredBuffer::ptr()
2485 */
2486#define BUFFER_PTR(DIM) \
2487 char* legion_deferred_buffer_char_##DIM##d_ptr( \
2488 legion_deferred_buffer_char_##DIM##d_t buffer, \
2489 legion_point_##DIM##d_t p);
2490 LEGION_FOREACH_N(BUFFER_PTR)
2491#undef BUFFER_PTR
2492
2493 /*
2494 * @see Legion::DeferredBuffer::~DeferredBuffer()
2495 */
2496#define BUFFER_DESTROY(DIM) \
2497 void legion_deferred_buffer_char_##DIM##d_destroy( \
2498 legion_deferred_buffer_char_##DIM##d_t buffer);
2499 LEGION_FOREACH_N(BUFFER_DESTROY)
2500#undef BUFFER_DESTROY
2501
2502 // -----------------------------------------------------------------------
2503 // Task Launch Operations
2504 // -----------------------------------------------------------------------
2505
2511 legion_task_launcher_t legion_task_launcher_create(
2512 legion_task_id_t tid, legion_untyped_buffer_t arg,
2513 legion_predicate_t pred /* = legion_predicate_true() */,
2514 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
2515
2521 legion_task_launcher_t legion_task_launcher_create_from_buffer(
2522 legion_task_id_t tid, const void* buffer, size_t buffer_size,
2523 legion_predicate_t pred /* = legion_predicate_true() */,
2524 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
2525
2531 void legion_task_launcher_destroy(legion_task_launcher_t handle);
2532
2538 legion_future_t legion_task_launcher_execute(
2539 legion_runtime_t runtime, legion_context_t ctx,
2540 legion_task_launcher_t launcher);
2541
2547 legion_future_t legion_task_launcher_execute_outputs(
2548 legion_runtime_t runtime, legion_context_t ctx,
2549 legion_task_launcher_t launcher, legion_output_requirement_t* reqs,
2550 size_t reqs_size);
2551
2555 unsigned legion_task_launcher_add_region_requirement_logical_region(
2556 legion_task_launcher_t launcher, legion_logical_region_t handle,
2557 legion_privilege_mode_t priv, legion_coherence_property_t prop,
2558 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2559 bool verified /* = false*/);
2560
2564 unsigned legion_task_launcher_add_region_requirement_logical_region_reduction(
2565 legion_task_launcher_t launcher, legion_logical_region_t handle,
2566 legion_reduction_op_id_t redop, legion_coherence_property_t prop,
2567 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2568 bool verified /* = false*/);
2569
2573 void legion_task_launcher_set_region_requirement_logical_region(
2574 legion_task_launcher_t launcher, unsigned idx,
2575 legion_logical_region_t handle, legion_privilege_mode_t priv,
2576 legion_coherence_property_t prop, legion_logical_region_t parent,
2577 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2578
2582 void legion_task_launcher_set_region_requirement_logical_region_reduction(
2583 legion_task_launcher_t launcher, unsigned idx,
2584 legion_logical_region_t handle, legion_reduction_op_id_t redop,
2585 legion_coherence_property_t prop, legion_logical_region_t parent,
2586 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2587
2591 void legion_task_launcher_add_field(
2592 legion_task_launcher_t launcher, unsigned idx, legion_field_id_t fid,
2593 bool inst /* = true */);
2594
2598 const void* legion_index_launcher_get_projection_args(
2599 legion_region_requirement_t requirement, size_t* size);
2600
2604 void legion_index_launcher_set_projection_args(
2605 legion_index_launcher_t launcher_, unsigned idx, const void* args,
2606 size_t size, bool own);
2607
2611 void legion_task_launcher_add_flags(
2612 legion_task_launcher_t launcher, unsigned idx,
2613 enum legion_region_flags_t flags);
2614
2618 void legion_task_launcher_intersect_flags(
2619 legion_task_launcher_t launcher, unsigned idx,
2620 enum legion_region_flags_t flags);
2621
2625 unsigned legion_task_launcher_add_index_requirement(
2626 legion_task_launcher_t launcher, legion_index_space_t handle,
2627 legion_allocate_mode_t priv, legion_index_space_t parent,
2628 bool verified /* = false*/);
2629
2633 void legion_task_launcher_add_future(
2634 legion_task_launcher_t launcher, legion_future_t future);
2635
2639 void legion_task_launcher_add_wait_barrier(
2640 legion_task_launcher_t launcher, legion_phase_barrier_t bar);
2641
2645 void legion_task_launcher_add_arrival_barrier(
2646 legion_task_launcher_t launcher, legion_phase_barrier_t bar);
2647
2651 void legion_task_launcher_set_argument(
2652 legion_task_launcher_t launcher, legion_untyped_buffer_t arg);
2653
2657 void legion_task_launcher_set_point(
2658 legion_task_launcher_t launcher, legion_domain_point_t point);
2659
2663 void legion_task_launcher_set_sharding_space(
2664 legion_task_launcher_t launcher, legion_index_space_t is);
2665
2669 void legion_task_launcher_set_predicate_false_future(
2670 legion_task_launcher_t launcher, legion_future_t f);
2671
2675 void legion_task_launcher_set_predicate_false_result(
2676 legion_task_launcher_t launcher, legion_untyped_buffer_t arg);
2677
2681 void legion_task_launcher_set_mapper(
2682 legion_task_launcher_t launcher, legion_mapper_id_t mapper_id);
2683
2687 void legion_task_launcher_set_mapping_tag(
2688 legion_task_launcher_t launcher, legion_mapping_tag_id_t tag);
2689
2693 void legion_task_launcher_set_mapper_arg(
2694 legion_task_launcher_t launcher, legion_untyped_buffer_t arg);
2695
2699 void legion_task_launcher_set_enable_inlining(
2700 legion_task_launcher_t launcher, bool enable_inlining);
2701
2705 void legion_task_launcher_set_local_function_task(
2706 legion_task_launcher_t launcher, bool local_function_task);
2707
2711 void legion_task_launcher_set_elide_future_return(
2712 legion_task_launcher_t launcher, bool elide_future_return);
2713
2717 void legion_task_launcher_set_provenance(
2718 legion_task_launcher_t launcher, const char* provenance);
2719
2725 legion_index_launcher_t legion_index_launcher_create(
2726 legion_task_id_t tid, legion_domain_t domain,
2727 legion_untyped_buffer_t global_arg, legion_argument_map_t map,
2728 legion_predicate_t pred /* = legion_predicate_true() */,
2729 bool must /* = false */, legion_mapper_id_t id /* = 0 */,
2730 legion_mapping_tag_id_t tag /* = 0 */);
2731
2737 legion_index_launcher_t legion_index_launcher_create_from_buffer(
2738 legion_task_id_t tid, legion_domain_t domain, const void* buffer,
2739 size_t buffer_size, legion_argument_map_t map,
2740 legion_predicate_t pred /* = legion_predicate_true() */,
2741 bool must /* = false */, legion_mapper_id_t id /* = 0 */,
2742 legion_mapping_tag_id_t tag /* = 0 */);
2743
2749 void legion_index_launcher_destroy(legion_index_launcher_t handle);
2750
2757 legion_future_map_t legion_index_launcher_execute(
2758 legion_runtime_t runtime, legion_context_t ctx,
2759 legion_index_launcher_t launcher);
2760
2767 legion_future_t legion_index_launcher_execute_reduction(
2768 legion_runtime_t runtime, legion_context_t ctx,
2769 legion_index_launcher_t launcher, legion_reduction_op_id_t redop);
2770
2777 legion_future_map_t legion_index_launcher_execute_outputs(
2778 legion_runtime_t runtime, legion_context_t ctx,
2779 legion_index_launcher_t launcher, legion_output_requirement_t* reqs,
2780 size_t reqs_size);
2781
2788 legion_future_t legion_index_launcher_execute_deterministic_reduction(
2789 legion_runtime_t runtime, legion_context_t ctx,
2790 legion_index_launcher_t launcher, legion_reduction_op_id_t redop,
2791 bool deterministic);
2792
2799 legion_future_t legion_index_launcher_execute_reduction_and_outputs(
2800 legion_runtime_t runtime, legion_context_t ctx,
2801 legion_index_launcher_t launcher, legion_reduction_op_id_t redop,
2802 bool deterministic, legion_output_requirement_t* reqs, size_t reqs_size);
2803
2807 unsigned legion_index_launcher_add_region_requirement_logical_region(
2808 legion_index_launcher_t launcher, legion_logical_region_t handle,
2809 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
2810 legion_coherence_property_t prop, legion_logical_region_t parent,
2811 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2812
2816 unsigned legion_index_launcher_add_region_requirement_logical_partition(
2817 legion_index_launcher_t launcher, legion_logical_partition_t handle,
2818 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
2819 legion_coherence_property_t prop, legion_logical_region_t parent,
2820 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2821
2825 unsigned
2826 legion_index_launcher_add_region_requirement_logical_region_reduction(
2827 legion_index_launcher_t launcher, legion_logical_region_t handle,
2828 legion_projection_id_t proj /* = 0 */, legion_reduction_op_id_t redop,
2829 legion_coherence_property_t prop, legion_logical_region_t parent,
2830 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2831
2835 unsigned
2836 legion_index_launcher_add_region_requirement_logical_partition_reduction(
2837 legion_index_launcher_t launcher, legion_logical_partition_t handle,
2838 legion_projection_id_t proj /* = 0 */, legion_reduction_op_id_t redop,
2839 legion_coherence_property_t prop, legion_logical_region_t parent,
2840 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
2841
2845 void legion_index_launcher_set_region_requirement_logical_region(
2846 legion_index_launcher_t launcher, unsigned idx,
2847 legion_logical_region_t handle, legion_projection_id_t proj /* = 0 */,
2848 legion_privilege_mode_t priv, legion_coherence_property_t prop,
2849 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2850 bool verified /* = false*/);
2851
2855 void legion_index_launcher_set_region_requirement_logical_partition(
2856 legion_index_launcher_t launcher, unsigned idx,
2857 legion_logical_partition_t handle, legion_projection_id_t proj /* = 0 */,
2858 legion_privilege_mode_t priv, legion_coherence_property_t prop,
2859 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2860 bool verified /* = false*/);
2861
2865 void legion_index_launcher_set_region_requirement_logical_region_reduction(
2866 legion_index_launcher_t launcher, unsigned idx,
2867 legion_logical_region_t handle, legion_projection_id_t proj /* = 0 */,
2868 legion_reduction_op_id_t redop, legion_coherence_property_t prop,
2869 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2870 bool verified /* = false*/);
2871
2875 void legion_index_launcher_set_region_requirement_logical_partition_reduction(
2876 legion_index_launcher_t launcher, unsigned idx,
2877 legion_logical_partition_t handle, legion_projection_id_t proj /* = 0 */,
2878 legion_reduction_op_id_t redop, legion_coherence_property_t prop,
2879 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
2880 bool verified /* = false*/);
2881
2885 void legion_index_launcher_add_field(
2886 legion_index_launcher_t launcher, unsigned idx, legion_field_id_t fid,
2887 bool inst /* = true */);
2888
2892 void legion_index_launcher_add_flags(
2893 legion_index_launcher_t launcher, unsigned idx,
2894 enum legion_region_flags_t flags);
2895
2899 void legion_index_launcher_intersect_flags(
2900 legion_index_launcher_t launcher, unsigned idx,
2901 enum legion_region_flags_t flags);
2902
2906 unsigned legion_index_launcher_add_index_requirement(
2907 legion_index_launcher_t launcher, legion_index_space_t handle,
2908 legion_allocate_mode_t priv, legion_index_space_t parent,
2909 bool verified /* = false*/);
2910
2914 void legion_index_launcher_add_future(
2915 legion_index_launcher_t launcher, legion_future_t future);
2916
2920 void legion_index_launcher_add_wait_barrier(
2921 legion_index_launcher_t launcher, legion_phase_barrier_t bar);
2922
2926 void legion_index_launcher_add_arrival_barrier(
2927 legion_index_launcher_t launcher, legion_phase_barrier_t bar);
2928
2932 void legion_index_launcher_add_point_future(
2933 legion_index_launcher_t launcher, legion_argument_map_t map);
2934
2938 void legion_index_launcher_set_global_arg(
2939 legion_index_launcher_t launcher, legion_untyped_buffer_t global_arg);
2940
2944 void legion_index_launcher_set_sharding_space(
2945 legion_index_launcher_t launcher, legion_index_space_t is);
2946
2950 void legion_index_launcher_set_mapper(
2951 legion_index_launcher_t launcher, legion_mapper_id_t mapper_id);
2952
2956 void legion_index_launcher_set_mapping_tag(
2957 legion_index_launcher_t launcher, legion_mapping_tag_id_t tag);
2958
2962 void legion_index_launcher_set_mapper_arg(
2963 legion_index_launcher_t launcher, legion_untyped_buffer_t map_arg);
2964
2968 void legion_index_launcher_set_elide_future_return(
2969 legion_index_launcher_t launcher, bool elide_future_return);
2970
2974 void legion_index_launcher_set_provenance(
2975 legion_index_launcher_t launcher, const char* provenance);
2976
2980 void legion_index_launcher_set_concurrent(
2981 legion_index_launcher_t launcher, bool concurrent);
2982
2986 void legion_index_launcher_set_initial_value(
2987 legion_index_launcher_t launcher, legion_future_t initial_value);
2988
2989 // -----------------------------------------------------------------------
2990 // Inline Mapping Operations
2991 // -----------------------------------------------------------------------
2992
2998 legion_inline_launcher_t legion_inline_launcher_create_logical_region(
2999 legion_logical_region_t handle, legion_privilege_mode_t priv,
3000 legion_coherence_property_t prop, legion_logical_region_t parent,
3001 legion_mapping_tag_id_t region_tag /* = 0 */, bool verified /* = false*/,
3002 legion_mapper_id_t id /* = 0 */,
3003 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3004
3010 void legion_inline_launcher_destroy(legion_inline_launcher_t handle);
3011
3017 legion_physical_region_t legion_inline_launcher_execute(
3018 legion_runtime_t runtime, legion_context_t ctx,
3019 legion_inline_launcher_t launcher);
3020
3024 void legion_inline_launcher_add_field(
3025 legion_inline_launcher_t launcher, legion_field_id_t fid,
3026 bool inst /* = true */);
3027
3031 void legion_inline_launcher_set_mapper_arg(
3032 legion_inline_launcher_t launcher, legion_untyped_buffer_t arg);
3033
3037 void legion_inline_launcher_set_provenance(
3038 legion_inline_launcher_t launcher, const char* provenance);
3039
3043 void legion_runtime_remap_region(
3044 legion_runtime_t runtime, legion_context_t ctx,
3045 legion_physical_region_t region);
3046
3050 void legion_runtime_unmap_region(
3051 legion_runtime_t runtime, legion_context_t ctx,
3052 legion_physical_region_t region);
3053
3057 void legion_runtime_unmap_all_regions(
3058 legion_runtime_t runtime, legion_context_t ctx);
3059
3060 // -----------------------------------------------------------------------
3061 // Fill Field Operations
3062 // -----------------------------------------------------------------------
3063
3067 void legion_runtime_fill_field(
3068 legion_runtime_t runtime, legion_context_t ctx,
3070 legion_field_id_t fid, const void* value, size_t value_size,
3071 legion_predicate_t pred /* = legion_predicate_true() */);
3072
3076 void legion_runtime_fill_field_future(
3077 legion_runtime_t runtime, legion_context_t ctx,
3079 legion_field_id_t fid, legion_future_t f,
3080 legion_predicate_t pred /* = legion_predicate_true() */);
3081
3087 legion_fill_launcher_t legion_fill_launcher_create(
3089 legion_field_id_t fid, const void* value, size_t value_size,
3090 legion_predicate_t pred /* = legion_predicate_true() */,
3091 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
3092
3098 legion_fill_launcher_t legion_fill_launcher_create_from_future(
3100 legion_field_id_t fid, legion_future_t f,
3101 legion_predicate_t pred /* = legion_predicate_true() */,
3102 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
3103
3109 void legion_fill_launcher_destroy(legion_fill_launcher_t handle);
3110
3114 void legion_fill_launcher_add_field(
3115 legion_fill_launcher_t handle, legion_field_id_t fid);
3116
3120 void legion_fill_launcher_execute(
3121 legion_runtime_t runtime, legion_context_t ctx,
3122 legion_fill_launcher_t launcher);
3123
3127 void legion_fill_launcher_set_point(
3128 legion_fill_launcher_t launcher, legion_domain_point_t point);
3129
3133 void legion_fill_launcher_set_sharding_space(
3134 legion_fill_launcher_t launcher, legion_index_space_t space);
3135
3139 void legion_fill_launcher_set_mapper_arg(
3140 legion_fill_launcher_t launcher, legion_untyped_buffer_t arg);
3141
3145 void legion_fill_launcher_set_provenance(
3146 legion_fill_launcher_t launcher, const char* provenance);
3147
3148 // -----------------------------------------------------------------------
3149 // Index Fill Field Operations
3150 // -----------------------------------------------------------------------
3151
3156 void legion_runtime_index_fill_field(
3157 legion_runtime_t runtime, legion_context_t ctx,
3159 legion_field_id_t fid, const void* value, size_t value_size,
3160 legion_projection_id_t proj /* = 0 */,
3161 legion_predicate_t pred /* = legion_predicate_true() */,
3162 legion_mapper_id_t id /* = 0 */,
3163 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3164
3169 void legion_runtime_index_fill_field_with_space(
3170 legion_runtime_t runtime, legion_context_t ctx,
3172 legion_logical_region_t parent, legion_field_id_t fid, const void* value,
3173 size_t value_size, legion_projection_id_t proj /* = 0 */,
3174 legion_predicate_t pred /* = legion_predicate_true() */,
3175 legion_mapper_id_t id /* = 0 */,
3176 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3177
3182 void legion_runtime_index_fill_field_with_domain(
3183 legion_runtime_t runtime, legion_context_t ctx, legion_domain_t domain,
3185 legion_field_id_t fid, const void* value, size_t value_size,
3186 legion_projection_id_t proj /* = 0 */,
3187 legion_predicate_t pred /* = legion_predicate_true() */,
3188 legion_mapper_id_t id /* = 0 */,
3189 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3190
3195 void legion_runtime_index_fill_field_future(
3196 legion_runtime_t runtime, legion_context_t ctx,
3198 legion_field_id_t fid, legion_future_t f,
3199 legion_projection_id_t proj /* = 0 */,
3200 legion_predicate_t pred /* = legion_predicate_true() */,
3201 legion_mapper_id_t id /* = 0 */,
3202 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3203
3208 void legion_runtime_index_fill_field_future_with_space(
3209 legion_runtime_t runtime, legion_context_t ctx,
3211 legion_logical_region_t parent, legion_field_id_t fid, legion_future_t f,
3212 legion_projection_id_t proj /* = 0 */,
3213 legion_predicate_t pred /* = legion_predicate_true() */,
3214 legion_mapper_id_t id /* = 0 */,
3215 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3216
3221 void legion_runtime_index_fill_field_future_with_domain(
3222 legion_runtime_t runtime, legion_context_t ctx, legion_domain_t domain,
3224 legion_field_id_t fid, legion_future_t f,
3225 legion_projection_id_t proj /* = 0 */,
3226 legion_predicate_t pred /* = legion_predicate_true() */,
3227 legion_mapper_id_t id /* = 0 */,
3228 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3229
3235 legion_index_fill_launcher_t legion_index_fill_launcher_create_with_space(
3237 legion_logical_region_t parent, legion_field_id_t fid, const void* value,
3238 size_t value_size, legion_projection_id_t proj /* = 0 */,
3239 legion_predicate_t pred /* = legion_predicate_true() */,
3240 legion_mapper_id_t id /* = 0 */,
3241 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3242
3248 legion_index_fill_launcher_t legion_index_fill_launcher_create_with_domain(
3250 legion_logical_region_t parent, legion_field_id_t fid, const void* value,
3251 size_t value_size, legion_projection_id_t proj /* = 0 */,
3252 legion_predicate_t pred /* = legion_predicate_true() */,
3253 legion_mapper_id_t id /* = 0 */,
3254 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3255
3261 legion_index_fill_launcher_t
3262 legion_index_fill_launcher_create_from_future_with_space(
3264 legion_logical_region_t parent, legion_field_id_t fid,
3265 legion_future_t future, legion_projection_id_t proj /* = 0 */,
3266 legion_predicate_t pred /* = legion_predicate_true() */,
3267 legion_mapper_id_t id /* = 0 */,
3268 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3269
3275 legion_index_fill_launcher_t
3276 legion_index_fill_launcher_create_from_future_with_domain(
3278 legion_logical_region_t parent, legion_field_id_t fid,
3279 legion_future_t future, legion_projection_id_t proj /* = 0 */,
3280 legion_predicate_t pred /* = legion_predicate_true() */,
3281 legion_mapper_id_t id /* = 0 */,
3282 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3283
3289 void legion_index_fill_launcher_destroy(legion_index_fill_launcher_t handle);
3290
3294 void legion_index_fill_launcher_add_field(
3295 legion_fill_launcher_t handle, legion_field_id_t fid);
3296
3300 void legion_index_fill_launcher_execute(
3301 legion_runtime_t runtime, legion_context_t ctx,
3302 legion_index_fill_launcher_t launcher);
3303
3307 void legion_index_fill_launcher_set_sharding_space(
3308 legion_index_fill_launcher_t launcher, legion_index_space_t space);
3309
3313 void legion_index_fill_launcher_set_mapper_arg(
3314 legion_index_fill_launcher_t launcher, legion_untyped_buffer_t arg);
3315
3319 void legion_index_fill_launcher_set_provenance(
3320 legion_index_fill_launcher_t launcher, const char* provenance);
3321
3327 legion_region_requirement_t legion_fill_get_requirement(legion_fill_t fill);
3328
3329 // -----------------------------------------------------------------------
3330 // Discard Operation
3331 // -----------------------------------------------------------------------
3332
3338 legion_discard_launcher_t legion_discard_launcher_create(
3340
3346 void legion_discard_launcher_destroy(legion_discard_launcher_t handle);
3347
3351 void legion_discard_launcher_add_field(
3352 legion_discard_launcher_t handle, legion_field_id_t fid);
3353
3357 void legion_discard_launcher_execute(
3358 legion_runtime_t runtime, legion_context_t ctx,
3359 legion_discard_launcher_t launcher);
3360
3364 void legion_discard_launcher_set_provenance(
3365 legion_discard_launcher_t launcher, const char* provenance);
3366
3367 // -----------------------------------------------------------------------
3368 // File Operations
3369 // -----------------------------------------------------------------------
3370
3374 legion_field_map_t legion_field_map_create(void);
3375
3379 void legion_field_map_destroy(legion_field_map_t handle);
3380
3381 void legion_field_map_insert(
3382 legion_field_map_t handle, legion_field_id_t key, const char* value);
3383
3389 legion_physical_region_t legion_runtime_attach_hdf5(
3390 legion_runtime_t runtime, legion_context_t ctx, const char* filename,
3392 legion_field_map_t field_map, legion_file_mode_t mode);
3393
3397 void legion_runtime_detach_hdf5(
3398 legion_runtime_t runtime, legion_context_t ctx,
3399 legion_physical_region_t region);
3400
3401 // -----------------------------------------------------------------------
3402 // Copy Operations
3403 // -----------------------------------------------------------------------
3404
3410 legion_copy_launcher_t legion_copy_launcher_create(
3411 legion_predicate_t pred /* = legion_predicate_true() */,
3412 legion_mapper_id_t id /* = 0 */,
3413 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3414
3420 void legion_copy_launcher_destroy(legion_copy_launcher_t handle);
3421
3427 void legion_copy_launcher_execute(
3428 legion_runtime_t runtime, legion_context_t ctx,
3429 legion_copy_launcher_t launcher);
3430
3434 unsigned legion_copy_launcher_add_src_region_requirement_logical_region(
3435 legion_copy_launcher_t launcher, legion_logical_region_t handle,
3436 legion_privilege_mode_t priv, legion_coherence_property_t prop,
3437 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
3438 bool verified /* = false*/);
3439
3443 unsigned legion_copy_launcher_add_dst_region_requirement_logical_region(
3444 legion_copy_launcher_t launcher, legion_logical_region_t handle,
3445 legion_privilege_mode_t priv, legion_coherence_property_t prop,
3446 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
3447 bool verified /* = false*/);
3448
3452 unsigned
3453 legion_copy_launcher_add_dst_region_requirement_logical_region_reduction(
3454 legion_copy_launcher_t launcher, legion_logical_region_t handle,
3455 legion_reduction_op_id_t redop, legion_coherence_property_t prop,
3456 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
3457 bool verified /* = false*/);
3458
3462 unsigned
3463 legion_copy_launcher_add_src_indirect_region_requirement_logical_region(
3464 legion_copy_launcher_t launcher, legion_logical_region_t handle,
3465 legion_field_id_t fid, legion_coherence_property_t prop,
3466 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
3467 bool is_range_indirection /* = false */, bool verified /* = false*/);
3468
3472 unsigned
3473 legion_copy_launcher_add_dst_indirect_region_requirement_logical_region(
3474 legion_copy_launcher_t launcher, legion_logical_region_t handle,
3475 legion_field_id_t fid, legion_coherence_property_t prop,
3476 legion_logical_region_t parent, legion_mapping_tag_id_t tag /* = 0 */,
3477 bool is_range_indirection /* = false */, bool verified /* = false*/);
3478
3482 void legion_copy_launcher_add_src_field(
3483 legion_copy_launcher_t launcher, unsigned idx, legion_field_id_t fid,
3484 bool inst /* = true */);
3485
3489 void legion_copy_launcher_add_dst_field(
3490 legion_copy_launcher_t launcher, unsigned idx, legion_field_id_t fid,
3491 bool inst /* = true */);
3492
3496 void legion_copy_launcher_add_wait_barrier(
3497 legion_copy_launcher_t launcher, legion_phase_barrier_t bar);
3498
3502 void legion_copy_launcher_add_arrival_barrier(
3503 legion_copy_launcher_t launcher, legion_phase_barrier_t bar);
3504
3508 void legion_copy_launcher_set_possible_src_indirect_out_of_range(
3509 legion_copy_launcher_t launcher, bool flag);
3510
3514 void legion_copy_launcher_set_possible_dst_indirect_out_of_range(
3515 legion_copy_launcher_t launcher, bool flag);
3516
3520 void legion_copy_launcher_set_point(
3521 legion_copy_launcher_t launcher, legion_domain_point_t point);
3522
3526 void legion_copy_launcher_set_sharding_space(
3527 legion_copy_launcher_t launcher, legion_index_space_t space);
3528
3532 void legion_copy_launcher_set_mapper_arg(
3533 legion_copy_launcher_t launcher, legion_untyped_buffer_t arg);
3534
3538 void legion_copy_launcher_set_provenance(
3539 legion_copy_launcher_t launcher, const char* provenance);
3540
3549 legion_region_requirement_t legion_copy_get_requirement(
3550 legion_copy_t copy, unsigned idx);
3551
3552 // -----------------------------------------------------------------------
3553 // Index Copy Operations
3554 // -----------------------------------------------------------------------
3555
3561 legion_index_copy_launcher_t legion_index_copy_launcher_create(
3562 legion_domain_t domain,
3563 legion_predicate_t pred /* = legion_predicate_true() */,
3564 legion_mapper_id_t id /* = 0 */,
3565 legion_mapping_tag_id_t launcher_tag /* = 0 */);
3566
3572 void legion_index_copy_launcher_destroy(legion_index_copy_launcher_t handle);
3573
3579 void legion_index_copy_launcher_execute(
3580 legion_runtime_t runtime, legion_context_t ctx,
3581 legion_index_copy_launcher_t launcher);
3582
3586 unsigned legion_index_copy_launcher_add_src_region_requirement_logical_region(
3587 legion_index_copy_launcher_t launcher, legion_logical_region_t handle,
3588 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
3589 legion_coherence_property_t prop, legion_logical_region_t parent,
3590 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3591
3595 unsigned legion_index_copy_launcher_add_dst_region_requirement_logical_region(
3596 legion_index_copy_launcher_t launcher, legion_logical_region_t handle,
3597 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
3598 legion_coherence_property_t prop, legion_logical_region_t parent,
3599 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3600
3604 unsigned
3605 legion_index_copy_launcher_add_src_region_requirement_logical_partition(
3606 legion_index_copy_launcher_t launcher,
3608 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
3609 legion_coherence_property_t prop, legion_logical_region_t parent,
3610 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3611
3615 unsigned
3616 legion_index_copy_launcher_add_dst_region_requirement_logical_partition(
3617 legion_index_copy_launcher_t launcher,
3619 legion_projection_id_t proj /* = 0 */, legion_privilege_mode_t priv,
3620 legion_coherence_property_t prop, legion_logical_region_t parent,
3621 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3622
3626 unsigned
3627 legion_index_copy_launcher_add_dst_region_requirement_logical_region_reduction(
3628 legion_index_copy_launcher_t launcher, legion_logical_region_t handle,
3629 legion_projection_id_t proj /* = 0 */, legion_reduction_op_id_t redop,
3630 legion_coherence_property_t prop, legion_logical_region_t parent,
3631 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3632
3636 unsigned
3637 legion_index_copy_launcher_add_dst_region_requirement_logical_partition_reduction(
3638 legion_index_copy_launcher_t launcher,
3640 legion_projection_id_t proj /* = 0 */, legion_reduction_op_id_t redop,
3641 legion_coherence_property_t prop, legion_logical_region_t parent,
3642 legion_mapping_tag_id_t tag /* = 0 */, bool verified /* = false*/);
3643
3647 unsigned
3648 legion_index_copy_launcher_add_src_indirect_region_requirement_logical_region(
3649 legion_index_copy_launcher_t launcher, legion_logical_region_t handle,
3650 legion_projection_id_t proj /* = 0 */, legion_field_id_t fid,
3651 legion_coherence_property_t prop, legion_logical_region_t parent,
3652 legion_mapping_tag_id_t tag /* = 0 */,
3653 bool is_range_indirection /* = false */, bool verified /* = false*/);
3654
3658 unsigned
3659 legion_index_copy_launcher_add_dst_indirect_region_requirement_logical_region(
3660 legion_index_copy_launcher_t launcher, legion_logical_region_t handle,
3661 legion_projection_id_t proj /* = 0 */, legion_field_id_t fid,
3662 legion_coherence_property_t prop, legion_logical_region_t parent,
3663 legion_mapping_tag_id_t tag /* = 0 */,
3664 bool is_range_indirection /* = false */, bool verified /* = false*/);
3665
3669 unsigned
3670 legion_index_copy_launcher_add_src_indirect_region_requirement_logical_partition(
3671 legion_index_copy_launcher_t launcher,
3673 legion_projection_id_t proj /* = 0 */, legion_field_id_t fid,
3674 legion_coherence_property_t prop, legion_logical_region_t parent,
3675 legion_mapping_tag_id_t tag /* = 0 */,
3676 bool is_range_indirection /* = false */, bool verified /* = false*/);
3677
3681 unsigned
3682 legion_index_copy_launcher_add_dst_indirect_region_requirement_logical_partition(
3683 legion_index_copy_launcher_t launcher,
3685 legion_projection_id_t proj /* = 0 */, legion_field_id_t fid,
3686 legion_coherence_property_t prop, legion_logical_region_t parent,
3687 legion_mapping_tag_id_t tag /* = 0 */,
3688 bool is_range_indirection /* = false */, bool verified /* = false*/);
3689
3693 void legion_index_copy_launcher_add_src_field(
3694 legion_index_copy_launcher_t launcher, unsigned idx,
3695 legion_field_id_t fid, bool inst /* = true */);
3696
3700 void legion_index_copy_launcher_add_dst_field(
3701 legion_index_copy_launcher_t launcher, unsigned idx,
3702 legion_field_id_t fid, bool inst /* = true */);
3703
3707 void legion_index_copy_launcher_add_wait_barrier(
3708 legion_index_copy_launcher_t launcher, legion_phase_barrier_t bar);
3709
3713 void legion_index_copy_launcher_add_arrival_barrier(
3714 legion_index_copy_launcher_t launcher, legion_phase_barrier_t bar);
3715
3719 void legion_index_copy_launcher_set_possible_src_indirect_out_of_range(
3720 legion_index_copy_launcher_t launcher, bool flag);
3721
3725 void legion_index_copy_launcher_set_possible_dst_indirect_out_of_range(
3726 legion_index_copy_launcher_t launcher, bool flag);
3727
3731 void legion_index_copy_launcher_set_sharding_space(
3732 legion_index_copy_launcher_t launcher, legion_index_space_t is);
3733
3737 void legion_index_copy_launcher_set_mapper_arg(
3738 legion_index_copy_launcher_t launcher, legion_untyped_buffer_t arg);
3739
3743 void legion_index_copy_launcher_set_provenance(
3744 legion_index_copy_launcher_t launcher, const char* provenance);
3745
3746 // -----------------------------------------------------------------------
3747 // Acquire Operations
3748 // -----------------------------------------------------------------------
3749
3755 legion_acquire_launcher_t legion_acquire_launcher_create(
3756 legion_logical_region_t logical_region,
3757 legion_logical_region_t parent_region,
3758 legion_predicate_t pred /* = legion_predicate_true() */,
3759 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
3760
3766 void legion_acquire_launcher_destroy(legion_acquire_launcher_t handle);
3767
3773 void legion_acquire_launcher_execute(
3774 legion_runtime_t runtime, legion_context_t ctx,
3775 legion_acquire_launcher_t launcher);
3776
3780 void legion_acquire_launcher_add_field(
3781 legion_acquire_launcher_t launcher, legion_field_id_t fid);
3782
3786 void legion_acquire_launcher_add_wait_barrier(
3787 legion_acquire_launcher_t launcher, legion_phase_barrier_t bar);
3788
3792 void legion_acquire_launcher_add_arrival_barrier(
3793 legion_acquire_launcher_t launcher, legion_phase_barrier_t bar);
3794
3798 void legion_acquire_launcher_set_sharding_space(
3799 legion_acquire_launcher_t launcher, legion_index_space_t space);
3800
3804 void legion_acquire_launcher_set_mapper_arg(
3805 legion_acquire_launcher_t launcher, legion_untyped_buffer_t arg);
3806
3810 void legion_acquire_launcher_set_provenance(
3811 legion_acquire_launcher_t launcher, const char* provenance);
3812
3813 // -----------------------------------------------------------------------
3814 // Release Operations
3815 // -----------------------------------------------------------------------
3816
3822 legion_release_launcher_t legion_release_launcher_create(
3823 legion_logical_region_t logical_region,
3824 legion_logical_region_t parent_region,
3825 legion_predicate_t pred /* = legion_predicate_true() */,
3826 legion_mapper_id_t id /* = 0 */, legion_mapping_tag_id_t tag /* = 0 */);
3827
3833 void legion_release_launcher_destroy(legion_release_launcher_t handle);
3834
3840 void legion_release_launcher_execute(
3841 legion_runtime_t runtime, legion_context_t ctx,
3842 legion_release_launcher_t launcher);
3843
3847 void legion_release_launcher_add_field(
3848 legion_release_launcher_t launcher, legion_field_id_t fid);
3849
3853 void legion_release_launcher_add_wait_barrier(
3854 legion_release_launcher_t launcher, legion_phase_barrier_t bar);
3855
3859 void legion_release_launcher_add_arrival_barrier(
3860 legion_release_launcher_t launcher, legion_phase_barrier_t bar);
3861
3865 void legion_release_launcher_set_sharding_space(
3866 legion_release_launcher_t launcher, legion_index_space_t space);
3867
3871 void legion_release_launcher_set_mapper_arg(
3872 legion_release_launcher_t launcher, legion_untyped_buffer_t arg);
3873
3877 void legion_release_launcher_set_provenance(
3878 legion_release_launcher_t launcher, const char* provenance);
3879
3880 // -----------------------------------------------------------------------
3881 // Attach/Detach Operations
3882 // -----------------------------------------------------------------------
3883
3889 legion_attach_launcher_t legion_attach_launcher_create(
3890 legion_logical_region_t logical_region,
3891 legion_logical_region_t parent_region,
3892 legion_external_resource_t resource);
3893
3897 void legion_attach_launcher_attach_hdf5(
3898 legion_attach_launcher_t handle, const char* filename,
3899 legion_field_map_t field_map, legion_file_mode_t mode);
3900
3904 void legion_attach_launcher_set_restricted(
3905 legion_attach_launcher_t handle, bool restricted);
3906
3910 void legion_attach_launcher_set_mapped(
3911 legion_attach_launcher_t handle, bool mapped);
3912
3916 void legion_attach_launcher_set_provenance(
3917 legion_attach_launcher_t handle, const char* provenance);
3918
3924 void legion_attach_launcher_destroy(legion_attach_launcher_t handle);
3925
3931 legion_physical_region_t legion_attach_launcher_execute(
3932 legion_runtime_t runtime, legion_context_t ctx,
3933 legion_attach_launcher_t launcher);
3934
3938 void legion_attach_launcher_add_cpu_soa_field(
3939 legion_attach_launcher_t launcher, legion_field_id_t fid, void* base_ptr,
3940 bool column_major);
3941
3945 void legion_attach_launcher_set_footprint(
3946 legion_attach_launcher_t launcher, size_t footprint);
3947
3953 legion_future_t legion_detach_external_resource(
3954 legion_runtime_t runtime, legion_context_t ctx,
3955 legion_physical_region_t handle);
3956
3962 legion_future_t legion_flush_detach_external_resource(
3963 legion_runtime_t runtime, legion_context_t ctx,
3964 legion_physical_region_t handle, bool flush);
3965
3971 legion_future_t legion_unordered_detach_external_resource(
3972 legion_runtime_t runtime, legion_context_t ctx,
3973 legion_physical_region_t handle, bool flush, bool unordered);
3974
3978 void legion_context_progress_unordered_operations(
3979 legion_runtime_t runtime, legion_context_t ctx);
3980
3981 // -----------------------------------------------------------------------
3982 // Index Attach/Detach Operations
3983 // -----------------------------------------------------------------------
3984
3990 legion_index_attach_launcher_t legion_index_attach_launcher_create(
3991 legion_logical_region_t parent_region,
3992 legion_external_resource_t resource, bool restricted /*=true*/);
3993
3997 void legion_index_attach_launcher_set_restricted(
3998 legion_index_attach_launcher_t handle, bool restricted);
3999
4003 void legion_index_attach_launcher_set_provenance(
4004 legion_index_attach_launcher_t handle, const char* provenance);
4005
4009 void legion_index_attach_launcher_set_deduplicate_across_shards(
4010 legion_index_attach_launcher_t handle, bool deduplicate);
4011
4015 void legion_index_attach_launcher_attach_file(
4016 legion_index_attach_launcher_t handle, legion_logical_region_t region,
4017 const char* filename, const legion_field_id_t* fields, size_t num_fields,
4018 legion_file_mode_t mode);
4019
4023 void legion_index_attach_launcher_attach_hdf5(
4024 legion_index_attach_launcher_t handle, legion_logical_region_t region,
4025 const char* filename, legion_field_map_t field_map,
4026 legion_file_mode_t mode);
4027
4031 void legion_index_attach_launcher_attach_array_soa(
4032 legion_index_attach_launcher_t handle, legion_logical_region_t region,
4033 void* base_ptr, bool column_major, const legion_field_id_t* fields,
4034 size_t num_fields, legion_memory_t memory);
4035
4039 void legion_index_attach_launcher_attach_array_aos(
4040 legion_index_attach_launcher_t handle, legion_logical_region_t region,
4041 void* base_ptr, bool column_major, const legion_field_id_t* fields,
4042 size_t num_fields, legion_memory_t memory);
4043
4049 void legion_index_attach_launcher_destroy(
4050 legion_index_attach_launcher_t handle);
4051
4057 legion_external_resources_t legion_attach_external_resources(
4058 legion_runtime_t runtime, legion_context_t ctx,
4059 legion_index_attach_launcher_t launcher);
4060
4066 legion_future_t legion_detach_external_resources(
4067 legion_runtime_t runtime, legion_context_t ctx,
4068 legion_external_resources_t, bool flush, bool unordered);
4069
4070 // -----------------------------------------------------------------------
4071 // Must Epoch Operations
4072 // -----------------------------------------------------------------------
4073
4079 legion_must_epoch_launcher_t legion_must_epoch_launcher_create(
4080 legion_mapper_id_t id /* = 0 */,
4081 legion_mapping_tag_id_t launcher_tag /* = 0 */);
4082
4088 void legion_must_epoch_launcher_destroy(legion_must_epoch_launcher_t handle);
4089
4095 legion_future_map_t legion_must_epoch_launcher_execute(
4096 legion_runtime_t runtime, legion_context_t ctx,
4097 legion_must_epoch_launcher_t launcher);
4098
4104 void legion_must_epoch_launcher_add_single_task(
4105 legion_must_epoch_launcher_t launcher, legion_domain_point_t point,
4106 legion_task_launcher_t handle);
4107
4113 void legion_must_epoch_launcher_add_index_task(
4114 legion_must_epoch_launcher_t launcher, legion_index_launcher_t handle);
4115
4119 void legion_must_epoch_launcher_set_launch_domain(
4120 legion_must_epoch_launcher_t launcher, legion_domain_t domain);
4121
4125 void legion_must_epoch_launcher_set_launch_space(
4126 legion_must_epoch_launcher_t launcher, legion_index_space_t is);
4127
4131 void legion_must_epoch_launcher_set_provenance(
4132 legion_must_epoch_launcher_t launcher, const char* provenance);
4133
4134 // -----------------------------------------------------------------------
4135 // Fence Operations
4136 // -----------------------------------------------------------------------
4137
4141 legion_future_t legion_runtime_issue_mapping_fence(
4142 legion_runtime_t runtime, legion_context_t ctx);
4143
4147 legion_future_t legion_runtime_issue_execution_fence(
4148 legion_runtime_t runtime, legion_context_t ctx);
4149
4150 // -----------------------------------------------------------------------
4151 // Tracing Operations
4152 // -----------------------------------------------------------------------
4153
4157 void legion_runtime_begin_trace(
4158 legion_runtime_t runtime, legion_context_t ctx, legion_trace_id_t tid,
4159 bool logical_only);
4160
4164 void legion_runtime_end_trace(
4165 legion_runtime_t runtime, legion_context_t ctx, legion_trace_id_t tid);
4166
4167 // -----------------------------------------------------------------------
4168 // Frame Operations
4169 // -----------------------------------------------------------------------
4170
4171 void legion_runtime_complete_frame(
4172 legion_runtime_t runtime, legion_context_t ctx);
4173
4174 // -----------------------------------------------------------------------
4175 // Tunable Variables
4176 // -----------------------------------------------------------------------
4177
4183 legion_future_t legion_runtime_select_tunable_value(
4184 legion_runtime_t runtime, legion_context_t ctx, legion_tunable_id_t tid,
4185 legion_mapper_id_t mapper /* = 0 */,
4186 legion_mapping_tag_id_t tag /* = 0 */);
4187
4188 // -----------------------------------------------------------------------
4189 // Miscellaneous Operations
4190 // -----------------------------------------------------------------------
4191
4195 bool legion_runtime_has_runtime(void);
4196
4200 legion_runtime_t legion_runtime_get_runtime(void);
4201
4205 bool legion_runtime_has_context(void);
4206
4212 legion_context_t legion_runtime_get_context(void);
4213
4220 void legion_context_destroy(legion_context_t);
4221
4225 legion_processor_t legion_runtime_get_executing_processor(
4226 legion_runtime_t runtime, legion_context_t ctx);
4227
4231 void legion_runtime_yield(legion_runtime_t runtime, legion_context_t ctx);
4232
4236 legion_shard_id_t legion_runtime_local_shard(
4237 legion_runtime_t runtime, legion_context_t ctx);
4238
4239 legion_shard_id_t legion_runtime_local_shard_without_context(void);
4240
4244 size_t legion_runtime_total_shards(
4245 legion_runtime_t runtime, legion_context_t ctx);
4246
4252 legion_shard_id_t legion_sharding_functor_shard(
4253 legion_sharding_id_t sid, legion_domain_point_t point,
4254 legion_domain_t full_space, size_t total_shards);
4255
4270 void legion_sharding_functor_invert(
4271 legion_sharding_id_t sid, legion_shard_id_t shard,
4272 legion_domain_t shard_domain, legion_domain_t full_domain,
4273 size_t total_shards, legion_domain_point_t* points, size_t* points_size);
4274
4275 void legion_runtime_enable_scheduler_lock(void);
4276
4277 void legion_runtime_disable_scheduler_lock(void);
4278
4282 void legion_runtime_print_once(
4283 legion_runtime_t runtime, legion_context_t ctx, FILE* f,
4284 const char* message);
4288 void legion_runtime_print_once_fd(
4289 legion_runtime_t runtime, legion_context_t ctx, int fd, const char* mode,
4290 const char* message);
4291
4292 // -----------------------------------------------------------------------
4293 // Physical Data Operations
4294 // -----------------------------------------------------------------------
4295
4301 void legion_physical_region_destroy(legion_physical_region_t handle);
4302
4308 legion_physical_region_t legion_physical_region_copy(
4309 legion_physical_region_t handle);
4310
4314 bool legion_physical_region_is_mapped(legion_physical_region_t handle);
4315
4319 void legion_physical_region_wait_until_valid(legion_physical_region_t handle);
4320
4324 bool legion_physical_region_is_valid(legion_physical_region_t handle);
4325
4329 legion_logical_region_t legion_physical_region_get_logical_region(
4330 legion_physical_region_t handle);
4331
4335 size_t legion_physical_region_get_field_count(
4336 legion_physical_region_t handle);
4337 legion_field_id_t legion_physical_region_get_field_id(
4338 legion_physical_region_t handle, size_t index);
4339
4343 size_t legion_physical_region_get_memory_count(
4344 legion_physical_region_t handle);
4345 legion_memory_t legion_physical_region_get_memory(
4346 legion_physical_region_t handle, size_t index);
4347
4353#define ACCESSOR_ARRAY(DIM) \
4354 legion_accessor_array_##DIM##d_t \
4355 legion_physical_region_get_field_accessor_array_##DIM##d( \
4356 legion_physical_region_t handle, legion_field_id_t fid);
4357 LEGION_FOREACH_N(ACCESSOR_ARRAY)
4358#undef ACCESSOR_ARRAY
4359
4360#define ACCESSOR_ARRAY(DIM) \
4361 legion_accessor_array_##DIM##d_t \
4362 legion_physical_region_get_field_accessor_array_##DIM##d_with_transform( \
4363 legion_physical_region_t handle, legion_field_id_t fid, \
4364 legion_domain_affine_transform_t transform);
4365 LEGION_FOREACH_N(ACCESSOR_ARRAY)
4366#undef ACCESSOR_ARRAY
4367
4368#define RAW_PTR(DIM) \
4369 void* legion_accessor_array_##DIM##d_raw_rect_ptr( \
4370 legion_accessor_array_##DIM##d_t handle, legion_rect_##DIM##d_t rect, \
4371 legion_rect_##DIM##d_t* subrect, legion_byte_offset_t* offsets);
4372 LEGION_FOREACH_N(RAW_PTR)
4373#undef RAW_PTR
4374
4375 // Read
4376 void legion_accessor_array_1d_read(
4377 legion_accessor_array_1d_t handle, legion_ptr_t ptr, void* dst,
4378 size_t bytes);
4379
4380#define READ_ARRAY(DIM) \
4381 void legion_accessor_array_##DIM##d_read_point( \
4382 legion_accessor_array_##DIM##d_t handle, legion_point_##DIM##d_t point, \
4383 void* dst, size_t bytes);
4384 LEGION_FOREACH_N(READ_ARRAY)
4385#undef READ_ARRAY
4386
4387 // Write
4388 void legion_accessor_array_1d_write(
4389 legion_accessor_array_1d_t handle, legion_ptr_t ptr, const void* src,
4390 size_t bytes);
4391
4392#define WRITE_ARRAY(DIM) \
4393 void legion_accessor_array_##DIM##d_write_point( \
4394 legion_accessor_array_##DIM##d_t handle, legion_point_##DIM##d_t point, \
4395 const void* src, size_t bytes);
4396 LEGION_FOREACH_N(WRITE_ARRAY)
4397#undef WRITE_ARRAY
4398
4399 // Ref
4400 void* legion_accessor_array_1d_ref(
4401 legion_accessor_array_1d_t handle, legion_ptr_t ptr);
4402
4403#define REF_ARRAY(DIM) \
4404 void* legion_accessor_array_##DIM##d_ref_point( \
4405 legion_accessor_array_##DIM##d_t handle, legion_point_##DIM##d_t point);
4406 LEGION_FOREACH_N(REF_ARRAY)
4407#undef REF_ARRAY
4408
4412#define DESTROY_ARRAY(DIM) \
4413 void legion_accessor_array_##DIM##d_destroy( \
4414 legion_accessor_array_##DIM##d_t handle);
4415 LEGION_FOREACH_N(DESTROY_ARRAY)
4416#undef DESTROY_ARRAY
4417
4418 // -----------------------------------------------------------------------
4419 // External Resource Operations
4420 // -----------------------------------------------------------------------
4421
4425 void legion_external_resources_destroy(legion_external_resources_t handle);
4426
4430 size_t legion_external_resources_size(legion_external_resources_t handle);
4431
4437 legion_physical_region_t legion_external_resources_get_region(
4438 legion_external_resources_t handle, unsigned index);
4439
4440 // -----------------------------------------------------------------------
4441 // Mappable Operations
4442 // -----------------------------------------------------------------------
4443
4447 enum legion_mappable_type_id_t legion_mappable_get_type(
4448 legion_mappable_t mappable);
4449
4453 legion_task_t legion_mappable_as_task(legion_mappable_t mappable);
4454
4458 legion_copy_t legion_mappable_as_copy(legion_mappable_t mappable);
4459
4463 legion_fill_t legion_mappable_as_fill(legion_mappable_t mappable);
4464
4468 legion_inline_t legion_mappable_as_inline_mapping(legion_mappable_t mappable);
4469
4470 // -----------------------------------------------------------------------
4471 // Task Operations
4472 // -----------------------------------------------------------------------
4473
4477 legion_unique_id_t legion_context_get_unique_id(legion_context_t ctx);
4478
4489 legion_task_mut_t legion_task_create_empty();
4490
4496 void legion_task_destroy(legion_task_mut_t handle);
4497
4503 legion_task_t legion_task_mut_as_task(legion_task_mut_t task);
4504
4508 legion_unique_id_t legion_task_get_unique_id(legion_task_t task);
4509
4513 int legion_task_get_depth(legion_task_t task);
4514
4518 legion_mapper_id_t legion_task_get_mapper(legion_task_t task);
4519
4523 legion_mapping_tag_id_t legion_task_get_tag(legion_task_t task);
4524
4528 void legion_task_id_attach_semantic_information(
4529 legion_runtime_t runtime, legion_task_id_t task_id,
4530 legion_semantic_tag_t tag, const void* buffer, size_t size,
4531 bool is_mutable /* = false */);
4532
4536 bool legion_task_id_retrieve_semantic_information(
4537 legion_runtime_t runtime, legion_task_id_t task_id,
4538 legion_semantic_tag_t tag, const void** result, size_t* size,
4539 bool can_fail /* = false */, bool wait_until_ready /* = false */);
4540
4544 void legion_task_id_attach_name(
4545 legion_runtime_t runtime, legion_task_id_t task_id, const char* name,
4546 bool is_mutable /* = false */);
4547
4551 void legion_task_id_retrieve_name(
4552 legion_runtime_t runtime, legion_task_id_t task_id, const char** result);
4553
4557 const void* legion_task_get_args(legion_task_t task);
4558
4562 void legion_task_set_args(legion_task_mut_t task, void* args);
4563
4567 size_t legion_task_get_arglen(legion_task_t task);
4568
4572 void legion_task_set_arglen(legion_task_mut_t task, size_t arglen);
4573
4577 legion_domain_t legion_task_get_index_domain(legion_task_t task);
4578
4582 legion_domain_point_t legion_task_get_index_point(legion_task_t task);
4583
4587 bool legion_task_get_is_index_space(legion_task_t task);
4588
4592 const void* legion_task_get_local_args(legion_task_t task);
4593
4597 size_t legion_task_get_local_arglen(legion_task_t task);
4598
4602 unsigned legion_task_get_regions_size(legion_task_t task);
4603
4609 legion_region_requirement_t legion_task_get_requirement(
4610 legion_task_t task, unsigned idx);
4611
4615 unsigned legion_task_get_futures_size(legion_task_t task);
4616
4620 legion_future_t legion_task_get_future(legion_task_t task, unsigned idx);
4621
4625 void legion_task_add_future(legion_task_mut_t task, legion_future_t future);
4626
4630 legion_task_id_t legion_task_get_task_id(legion_task_t task);
4631
4635 legion_processor_t legion_task_get_target_proc(legion_task_t task);
4636
4640 const char* legion_task_get_name(legion_task_t task);
4641
4642 // -----------------------------------------------------------------------
4643 // Inline Operations
4644 // -----------------------------------------------------------------------
4645
4651 legion_region_requirement_t legion_inline_get_requirement(
4652 legion_inline_t inline_operation);
4653
4654 // -----------------------------------------------------------------------
4655 // Execution Constraints
4656 // -----------------------------------------------------------------------
4657
4663 legion_execution_constraint_set_t legion_execution_constraint_set_create(
4664 void);
4665
4671 void legion_execution_constraint_set_destroy(
4672 legion_execution_constraint_set_t handle);
4673
4677 void legion_execution_constraint_set_add_isa_constraint(
4678 legion_execution_constraint_set_t handle, uint64_t prop);
4679
4684 void legion_execution_constraint_set_add_processor_constraint(
4685 legion_execution_constraint_set_t handle,
4686 legion_processor_kind_t proc_kind);
4687
4692 void legion_execution_constraint_set_add_resource_constraint(
4693 legion_execution_constraint_set_t handle,
4694 legion_resource_constraint_t resource, legion_equality_kind_t eq,
4695 size_t value);
4696
4701 void legion_execution_constraint_set_add_launch_constraint(
4702 legion_execution_constraint_set_t handle, legion_launch_constraint_t kind,
4703 size_t value);
4704
4709 void legion_execution_constraint_set_add_launch_constraint_multi_dim(
4710 legion_execution_constraint_set_t handle, legion_launch_constraint_t kind,
4711 const size_t* values, int dims);
4712
4717 void legion_execution_constraint_set_add_colocation_constraint(
4718 legion_execution_constraint_set_t handle, const unsigned* indexes,
4719 size_t num_indexes, const legion_field_id_t* fields, size_t num_fields);
4720
4721 // -----------------------------------------------------------------------
4722 // Layout Constraints
4723 // -----------------------------------------------------------------------
4724
4730 legion_layout_constraint_set_t legion_layout_constraint_set_create(void);
4731
4737 void legion_layout_constraint_set_destroy(
4738 legion_layout_constraint_set_t handle);
4739
4745 legion_layout_constraint_id_t legion_layout_constraint_set_register(
4746 legion_runtime_t runtime, legion_field_space_t fspace,
4747 legion_layout_constraint_set_t handle,
4748 const char* layout_name /* = nullptr */);
4749
4755 legion_layout_constraint_id_t legion_layout_constraint_set_preregister(
4756 legion_layout_constraint_set_t handle,
4757 const char* layout_name /* = nullptr */);
4758
4764 void legion_layout_constraint_set_release(
4765 legion_runtime_t runtime, legion_layout_constraint_id_t handle);
4766
4771 void legion_layout_constraint_set_add_specialized_constraint(
4772 legion_layout_constraint_set_t handle,
4773 legion_specialized_constraint_t specialized,
4774 legion_reduction_op_id_t redop);
4775
4780 void legion_layout_constraint_set_add_memory_constraint(
4781 legion_layout_constraint_set_t handle, legion_memory_kind_t kind);
4782
4787 void legion_layout_constraint_set_add_field_constraint(
4788 legion_layout_constraint_set_t handle, const legion_field_id_t* fields,
4789 size_t num_fields, bool contiguous, bool inorder);
4790
4795 void legion_layout_constraint_set_add_ordering_constraint(
4796 legion_layout_constraint_set_t handle,
4797 const legion_dimension_kind_t* dims, size_t num_dims, bool contiguous);
4798
4803 void legion_layout_constraint_set_add_tiling_constraint(
4804 legion_layout_constraint_set_t handle, legion_dimension_kind_t dim,
4805 size_t value, bool tiles);
4806
4811 void legion_layout_constraint_set_add_dimension_constraint(
4812 legion_layout_constraint_set_t handle, legion_dimension_kind_t dim,
4813 legion_equality_kind_t eq, size_t value);
4814
4819 void legion_layout_constraint_set_add_alignment_constraint(
4820 legion_layout_constraint_set_t handle, legion_field_id_t field,
4821 legion_equality_kind_t eq, size_t byte_boundary);
4822
4827 void legion_layout_constraint_set_add_offset_constraint(
4828 legion_layout_constraint_set_t handle, legion_field_id_t field,
4829 size_t offset);
4830
4835 void legion_layout_constraint_set_add_pointer_constraint(
4836 legion_layout_constraint_set_t handle, legion_memory_t memory,
4837 uintptr_t ptr);
4838
4839 // -----------------------------------------------------------------------
4840 // Task Layout Constraints
4841 // -----------------------------------------------------------------------
4842
4848 legion_task_layout_constraint_set_t legion_task_layout_constraint_set_create(
4849 void);
4850
4856 void legion_task_layout_constraint_set_destroy(
4857 legion_task_layout_constraint_set_t handle);
4858
4862 void legion_task_layout_constraint_set_add_layout_constraint(
4863 legion_task_layout_constraint_set_t handle, unsigned idx,
4864 legion_layout_constraint_id_t layout);
4865
4866 // -----------------------------------------------------------------------
4867 // Start-up Operations
4868 // -----------------------------------------------------------------------
4869
4873 void legion_runtime_initialize(
4874 int* argc, char*** argv, bool filter /* = false */);
4875
4879 int legion_runtime_start(
4880 int argc, char** argv, bool background /* = false */);
4881
4885 int legion_runtime_wait_for_shutdown(void);
4886
4890 void legion_runtime_set_return_code(int return_code);
4891
4895 void legion_runtime_set_top_level_task_id(legion_task_id_t top_id);
4896
4900 size_t legion_runtime_get_maximum_dimension(void);
4901
4905 const legion_input_args_t legion_runtime_get_input_args(void);
4906
4910 void legion_runtime_add_registration_callback(
4911 legion_registration_callback_pointer_t callback);
4912
4916 legion_mapper_id_t legion_runtime_generate_library_mapper_ids(
4917 legion_runtime_t runtime, const char* library_name, size_t count);
4918
4922 void legion_runtime_replace_default_mapper(
4923 legion_runtime_t runtime, legion_mapper_t mapper,
4924 legion_processor_t proc);
4925
4929 legion_projection_id_t legion_runtime_generate_static_projection_id();
4930
4934 legion_projection_id_t legion_runtime_generate_library_projection_ids(
4935 legion_runtime_t runtime, const char* library_name, size_t count);
4936
4940 legion_sharding_id_t legion_runtime_generate_library_sharding_ids(
4941 legion_runtime_t runtime, const char* library_name, size_t count);
4942
4946 legion_reduction_op_id_t legion_runtime_generate_library_reduction_ids(
4947 legion_runtime_t runtime, const char* library_name, size_t count);
4948
4952 void legion_runtime_preregister_projection_functor(
4953 legion_projection_id_t id, bool exclusive, unsigned depth,
4954 legion_projection_functor_logical_region_t region_functor,
4955 legion_projection_functor_logical_partition_t partition_functor);
4956
4960 void legion_runtime_register_projection_functor(
4961 legion_runtime_t runtime, legion_projection_id_t id, bool exclusive,
4962 unsigned depth,
4963 legion_projection_functor_logical_region_args_t region_functor,
4964 legion_projection_functor_logical_partition_args_t partition_functor);
4965
4969 void legion_runtime_preregister_projection_functor_args(
4970 legion_projection_id_t id, bool exclusive, unsigned depth,
4971 legion_projection_functor_logical_region_args_t region_functor,
4972 legion_projection_functor_logical_partition_args_t partition_functor);
4973
4977 void legion_runtime_register_projection_functor_args(
4978 legion_runtime_t runtime, legion_projection_id_t id, bool exclusive,
4979 unsigned depth, legion_projection_functor_logical_region_t region_functor,
4980 legion_projection_functor_logical_partition_t partition_functor);
4981
4985 void legion_runtime_preregister_projection_functor_mappable(
4986 legion_projection_id_t id, bool exclusive, unsigned depth,
4987 legion_projection_functor_logical_region_mappable_t region_functor,
4988 legion_projection_functor_logical_partition_mappable_t partition_functor);
4989
4993 void legion_runtime_register_projection_functor_mappable(
4994 legion_runtime_t runtime, legion_projection_id_t id, bool exclusive,
4995 unsigned depth,
4996 legion_projection_functor_logical_region_mappable_t region_functor,
4997 legion_projection_functor_logical_partition_mappable_t partition_functor);
4998
5002 legion_task_id_t legion_runtime_generate_library_task_ids(
5003 legion_runtime_t runtime, const char* library_name, size_t count);
5004
5010 legion_task_variant_registrar_t legion_task_variant_registrar_create(
5011 legion_task_id_t tid, bool global, const char* variant_name);
5012
5018 void legion_task_variant_registrar_destroy(
5019 legion_task_variant_registrar_t registrar);
5020
5024 void legion_task_variant_registrar_set_execution_constraints(
5025 legion_task_variant_registrar_t registrar,
5026 legion_execution_constraint_set_t constraints);
5027
5031 void legion_task_variant_registrar_set_layout_constraints(
5032 legion_task_variant_registrar_t registrar,
5033 legion_task_layout_constraint_set_t constraints);
5034
5041 void legion_task_variant_registrar_set_options(
5042 legion_task_variant_registrar_t registrar,
5044
5048 void legion_task_variant_registrar_set_leaf_memory_pool_bounds(
5049 legion_task_variant_registrar_t registrar, legion_memory_kind_t kind,
5050 size_t size, unsigned alignment);
5051
5055 legion_variant_id_t legion_runtime_register_task_variant_fnptr_with_registrar(
5056 legion_runtime_t runtime, legion_task_variant_registrar_t registrar,
5057 legion_task_pointer_wrapped_t wrapped_task_pointer,
5058 legion_variant_id_t variant_id, const void* userdata, size_t userlen,
5059 size_t return_type_size, bool has_return_type_size);
5060
5064 legion_variant_id_t
5065 legion_runtime_preregister_task_variant_fnptr_with_registrar(
5066 legion_task_variant_registrar_t registrar,
5067 legion_task_pointer_wrapped_t wrapped_task_pointer,
5068 legion_variant_id_t variant_id, const char* task_name,
5069 const void* userdata, size_t userlen, size_t return_type_size,
5070 bool has_return_type_size);
5071
5075 legion_task_id_t legion_runtime_register_task_variant_fnptr(
5076 legion_runtime_t runtime, legion_task_id_t id /* = AUTO_GENERATE_ID */,
5077 const char* task_name /* = nullptr*/,
5078 const char* variant_name /* = nullptr*/, bool global,
5079 legion_execution_constraint_set_t execution_constraints,
5080 legion_task_layout_constraint_set_t layout_constraints,
5082 legion_task_pointer_wrapped_t wrapped_task_pointer, const void* userdata,
5083 size_t userlen);
5084
5088 legion_task_id_t legion_runtime_preregister_task_variant_fnptr(
5089 legion_task_id_t id /* = AUTO_GENERATE_ID */,
5090 legion_variant_id_t variant_id /* = AUTO_GENERATE_ID */,
5091 const char* task_name /* = nullptr*/,
5092 const char* variant_name /* = nullptr*/,
5093 legion_execution_constraint_set_t execution_constraints,
5094 legion_task_layout_constraint_set_t layout_constraints,
5096 legion_task_pointer_wrapped_t wrapped_task_pointer, const void* userdata,
5097 size_t userlen);
5098
5099#ifdef REALM_USE_LLVM
5103 legion_task_id_t legion_runtime_register_task_variant_llvmir(
5104 legion_runtime_t runtime, legion_task_id_t id /* = AUTO_GENERATE_ID */,
5105 const char* task_name /* = nullptr*/, bool global,
5106 legion_execution_constraint_set_t execution_constraints,
5107 legion_task_layout_constraint_set_t layout_constraints,
5108 legion_task_config_options_t options, const char* llvmir,
5109 const char* entry_symbol, const void* userdata, size_t userlen);
5110
5114 legion_task_id_t legion_runtime_preregister_task_variant_llvmir(
5115 legion_task_id_t id /* = AUTO_GENERATE_ID */,
5116 legion_variant_id_t variant_id /* = AUTO_GENERATE_ID */,
5117 const char* task_name /* = nullptr*/,
5118 legion_execution_constraint_set_t execution_constraints,
5119 legion_task_layout_constraint_set_t layout_constraints,
5120 legion_task_config_options_t options, const char* llvmir,
5121 const char* entry_symbol, const void* userdata, size_t userlen);
5122#endif
5123
5124#ifdef REALM_USE_PYTHON
5128 legion_task_id_t legion_runtime_register_task_variant_python_source(
5129 legion_runtime_t runtime, legion_task_id_t id /* = AUTO_GENERATE_ID */,
5130 const char* task_name /* = nullptr*/, bool global,
5131 legion_execution_constraint_set_t execution_constraints,
5132 legion_task_layout_constraint_set_t layout_constraints,
5133 legion_task_config_options_t options, const char* module_name,
5134 const char* function_name, const void* userdata, size_t userlen);
5135
5139 legion_task_id_t legion_runtime_register_task_variant_python_source_qualname(
5140 legion_runtime_t runtime, legion_task_id_t id /* = AUTO_GENERATE_ID */,
5141 const char* task_name /* = nullptr*/, bool global,
5142 legion_execution_constraint_set_t execution_constraints,
5143 legion_task_layout_constraint_set_t layout_constraints,
5144 legion_task_config_options_t options, const char* module_name,
5145 const char** function_qualname, size_t function_qualname_len,
5146 const void* userdata, size_t userlen);
5147#endif
5148
5152 void legion_task_preamble(
5153 const void* data, size_t datalen, realm_id_t proc_id,
5154 legion_task_t* taskptr, const legion_physical_region_t** regionptr,
5155 unsigned* num_regions_ptr, legion_context_t* ctxptr,
5156 legion_runtime_t* runtimeptr);
5157
5161 void legion_task_postamble(
5162 legion_runtime_t runtime, legion_context_t ctx, const void* retval,
5163 size_t retsize);
5164
5165 // -----------------------------------------------------------------------
5166 // Timing Operations
5167 // -----------------------------------------------------------------------
5168
5172 unsigned long long legion_get_current_time_in_micros(void);
5173
5177 unsigned long long legion_get_current_time_in_nanos(void);
5178
5182 legion_future_t legion_issue_timing_op_seconds(
5183 legion_runtime_t runtime, legion_context_t ctx);
5184
5188 legion_future_t legion_issue_timing_op_microseconds(
5189 legion_runtime_t runtime, legion_context_t ctx);
5190
5194 legion_future_t legion_issue_timing_op_nanoseconds(
5195 legion_runtime_t runtime, legion_context_t ctx);
5196
5197 // -----------------------------------------------------------------------
5198 // Logging Operations
5199 // -----------------------------------------------------------------------
5200
5206 legion_logger_t legion_logger_create(const char* name);
5207
5213 void legion_logger_destroy(legion_logger_t handle);
5214
5218 void legion_logger_spew(legion_logger_t handle, const char* msg);
5219
5223 void legion_logger_debug(legion_logger_t handle, const char* msg);
5224
5228 void legion_logger_info(legion_logger_t handle, const char* msg);
5229
5233 void legion_logger_print(legion_logger_t handle, const char* msg);
5234
5238 void legion_logger_warning(legion_logger_t handle, const char* msg);
5239
5243 void legion_logger_error(legion_logger_t handle, const char* msg);
5244
5248 void legion_logger_fatal(legion_logger_t handle, const char* msg);
5249
5253 bool legion_logger_want_spew(legion_logger_t handle);
5254
5258 bool legion_logger_want_debug(legion_logger_t handle);
5259
5263 bool legion_logger_want_info(legion_logger_t handle);
5264
5268 bool legion_logger_want_print(legion_logger_t handle);
5269
5273 bool legion_logger_want_warning(legion_logger_t handle);
5274
5278 bool legion_logger_want_error(legion_logger_t handle);
5279
5283 bool legion_logger_want_fatal(legion_logger_t handle);
5284
5285 // -----------------------------------------------------------------------
5286 // Machine Operations
5287 // -----------------------------------------------------------------------
5288
5294 legion_machine_t legion_machine_create(void);
5295
5301 void legion_machine_destroy(legion_machine_t handle);
5302
5306 void legion_machine_get_all_processors(
5307 legion_machine_t machine, legion_processor_t* processors,
5308 size_t processors_size);
5309
5313 size_t legion_machine_get_all_processors_size(legion_machine_t machine);
5314
5318 void legion_machine_get_all_memories(
5319 legion_machine_t machine, legion_memory_t* memories,
5320 size_t memories_size);
5321
5325 size_t legion_machine_get_all_memories_size(legion_machine_t machine);
5326
5327 // -----------------------------------------------------------------------
5328 // Processor Operations
5329 // -----------------------------------------------------------------------
5330
5334 legion_processor_kind_t legion_processor_kind(legion_processor_t proc);
5335
5339 legion_address_space_t legion_processor_address_space(
5340 legion_processor_t proc);
5341
5342 // -----------------------------------------------------------------------
5343 // Memory Operations
5344 // -----------------------------------------------------------------------
5345
5349 legion_memory_kind_t legion_memory_kind(legion_memory_t mem);
5350
5354 legion_address_space_t legion_memory_address_space(legion_memory_t mem);
5355
5356 // -----------------------------------------------------------------------
5357 // Processor Query Operations
5358 // -----------------------------------------------------------------------
5359
5365 legion_processor_query_t legion_processor_query_create(
5366 legion_machine_t machine);
5367
5373 legion_processor_query_t legion_processor_query_create_copy(
5374 legion_processor_query_t query);
5375
5381 void legion_processor_query_destroy(legion_processor_query_t handle);
5382
5388 void legion_processor_query_only_kind(
5389 legion_processor_query_t query, legion_processor_kind_t kind);
5390
5396 void legion_processor_query_local_address_space(
5397 legion_processor_query_t query);
5398
5404 void legion_processor_query_same_address_space_as_processor(
5405 legion_processor_query_t query, legion_processor_t proc);
5406
5412 void legion_processor_query_same_address_space_as_memory(
5413 legion_processor_query_t query, legion_memory_t mem);
5414
5420 void legion_processor_query_has_affinity_to_memory(
5421 legion_processor_query_t query, legion_memory_t mem,
5422 unsigned min_bandwidth /* = 0 */, unsigned max_latency /* = 0 */);
5423
5429 void legion_processor_query_best_affinity_to_memory(
5430 legion_processor_query_t query, legion_memory_t mem,
5431 int bandwidth_weight /* = 0 */, int latency_weight /* = 0 */);
5432
5436 size_t legion_processor_query_count(legion_processor_query_t query);
5437
5441 legion_processor_t legion_processor_query_first(
5442 legion_processor_query_t query);
5443
5447 legion_processor_t legion_processor_query_next(
5448 legion_processor_query_t query, legion_processor_t after);
5449
5453 legion_processor_t legion_processor_query_random(
5454 legion_processor_query_t query);
5455
5456 // -----------------------------------------------------------------------
5457 // Memory Query Operations
5458 // -----------------------------------------------------------------------
5459
5465 legion_memory_query_t legion_memory_query_create(legion_machine_t machine);
5466
5472 legion_memory_query_t legion_memory_query_create_copy(
5473 legion_memory_query_t query);
5474
5480 void legion_memory_query_destroy(legion_memory_query_t handle);
5481
5487 void legion_memory_query_only_kind(
5488 legion_memory_query_t query, legion_memory_kind_t kind);
5489
5495 void legion_memory_query_local_address_space(legion_memory_query_t query);
5496
5502 void legion_memory_query_same_address_space_as_processor(
5503 legion_memory_query_t query, legion_processor_t proc);
5504
5510 void legion_memory_query_same_address_space_as_memory(
5511 legion_memory_query_t query, legion_memory_t mem);
5512
5518 void legion_memory_query_has_affinity_to_processor(
5519 legion_memory_query_t query, legion_processor_t proc,
5520 unsigned min_bandwidth /* = 0 */, unsigned max_latency /* = 0 */);
5521
5527 void legion_memory_query_has_affinity_to_memory(
5528 legion_memory_query_t query, legion_memory_t mem,
5529 unsigned min_bandwidth /* = 0 */, unsigned max_latency /* = 0 */);
5530
5536 void legion_memory_query_best_affinity_to_processor(
5537 legion_memory_query_t query, legion_processor_t proc,
5538 int bandwidth_weight /* = 0 */, int latency_weight /* = 0 */);
5539
5545 void legion_memory_query_best_affinity_to_memory(
5546 legion_memory_query_t query, legion_memory_t mem,
5547 int bandwidth_weight /* = 0 */, int latency_weight /* = 0 */);
5548
5552 size_t legion_memory_query_count(legion_memory_query_t query);
5553
5557 legion_memory_t legion_memory_query_first(legion_memory_query_t query);
5558
5562 legion_memory_t legion_memory_query_next(
5563 legion_memory_query_t query, legion_memory_t after);
5564
5568 legion_memory_t legion_memory_query_random(legion_memory_query_t query);
5569
5570 // -----------------------------------------------------------------------
5571 // Physical Instance Operations
5572 // -----------------------------------------------------------------------
5573
5574 /*
5575 * @param instance Caller must have ownership of parameter `instance`.
5576 *
5577 * @see Legion::Mapping::PhysicalInstance
5578 */
5579 void legion_physical_instance_destroy(legion_physical_instance_t instance);
5580
5581 // -----------------------------------------------------------------------
5582 // Slice Task Output
5583 // -----------------------------------------------------------------------
5584
5588 void legion_slice_task_output_slices_add(
5589 legion_slice_task_output_t output, legion_task_slice_t slice);
5590
5594 void legion_slice_task_output_verify_correctness_set(
5595 legion_slice_task_output_t output, bool verify_correctness);
5596
5597 // -----------------------------------------------------------------------
5598 // Map Task Input/Output
5599 // -----------------------------------------------------------------------
5600
5604 void legion_map_task_output_chosen_instances_clear_all(
5605 legion_map_task_output_t output);
5606
5610 void legion_map_task_output_chosen_instances_clear_each(
5611 legion_map_task_output_t output, size_t idx);
5612
5616 void legion_map_task_output_chosen_instances_add(
5617 legion_map_task_output_t output, legion_physical_instance_t* instances,
5618 size_t instances_size);
5619
5623 void legion_map_task_output_chosen_instances_set(
5624 legion_map_task_output_t output, size_t idx,
5625 legion_physical_instance_t* instances, size_t instances_size);
5626
5630 void legion_map_task_output_target_procs_clear(
5631 legion_map_task_output_t output);
5632
5636 void legion_map_task_output_target_procs_add(
5637 legion_map_task_output_t output, legion_processor_t proc);
5638
5642 legion_processor_t legion_map_task_output_target_procs_get(
5643 legion_map_task_output_t output, size_t idx);
5644
5648 void legion_map_task_output_task_priority_set(
5649 legion_map_task_output_t output, legion_task_priority_t priority);
5650
5651 // -----------------------------------------------------------------------
5652 // MapperRuntime Operations
5653 // -----------------------------------------------------------------------
5654
5660 bool legion_mapper_runtime_create_physical_instance_layout_constraint(
5661 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5662 legion_memory_t target_memory, legion_layout_constraint_set_t constraints,
5663 const legion_logical_region_t* regions, size_t regions_size,
5664 legion_physical_instance_t* result, bool acquire,
5665 legion_garbage_collection_priority_t priority);
5666
5672 bool legion_mapper_runtime_create_physical_instance_layout_constraint_id(
5673 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5674 legion_memory_t target_memory, legion_layout_constraint_id_t layout_id,
5675 const legion_logical_region_t* regions, size_t regions_size,
5676 legion_physical_instance_t* result, bool acquire,
5677 legion_garbage_collection_priority_t priority);
5678
5684 bool legion_mapper_runtime_find_or_create_physical_instance_layout_constraint(
5685 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5686 legion_memory_t target_memory, legion_layout_constraint_set_t constraints,
5687 const legion_logical_region_t* regions, size_t regions_size,
5688 legion_physical_instance_t* result, bool* created, bool acquire,
5689 legion_garbage_collection_priority_t priority, bool tight_region_bounds);
5690
5696 bool
5697 legion_mapper_runtime_find_or_create_physical_instance_layout_constraint_id(
5698 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5699 legion_memory_t target_memory,
5700 legion_layout_constraint_id_t layout_id,
5701 const legion_logical_region_t* regions, size_t regions_size,
5702 legion_physical_instance_t* result, bool* created, bool acquire,
5703 legion_garbage_collection_priority_t priority,
5704 bool tight_region_bounds);
5705
5711 bool legion_mapper_runtime_find_physical_instance_layout_constraint(
5712 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5713 legion_memory_t target_memory, legion_layout_constraint_set_t constraints,
5714 const legion_logical_region_t* regions, size_t regions_size,
5715 legion_physical_instance_t* result, bool acquire,
5716 bool tight_region_bounds);
5717
5723 bool legion_mapper_runtime_find_physical_instance_layout_constraint_id(
5724 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5725 legion_memory_t target_memory, legion_layout_constraint_id_t layout_id,
5726 const legion_logical_region_t* regions, size_t regions_size,
5727 legion_physical_instance_t* result, bool acquire,
5728 bool tight_region_bounds);
5729
5735 bool legion_mapper_runtime_acquire_instance(
5736 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5737 legion_physical_instance_t instance);
5738
5744 bool legion_mapper_runtime_acquire_instances(
5745 legion_mapper_runtime_t runtime, legion_mapper_context_t ctx,
5746 legion_physical_instance_t* instances, size_t instances_size);
5747
5748 // A hidden method here that hopefully nobody sees or ever needs
5749 // to use but its here anyway just in case
5750 legion_shard_id_t legion_context_get_shard_id(
5751 legion_runtime_t /*runtime*/, legion_context_t /*context*/,
5752 bool /*I know what I am doing*/);
5753 // Another hidden method for getting the number of shards
5754 size_t legion_context_get_num_shards(
5755 legion_runtime_t /*runtime*/, legion_context_t /*context*/,
5756 bool /*I know what I am doing*/);
5757 // Another hidden method for control replication that most
5758 // people should not be using but for which there are legitamite
5759 // user, especially in garbage collected languages
5760 // Note the caller takes ownership of the future
5761 legion_future_t legion_context_consensus_match(
5762 legion_runtime_t /*runtime*/, legion_context_t /*context*/,
5763 const void* /*input*/, void* /*output*/, size_t /*num elements*/,
5764 size_t /*element size*/);
5765
5769 legion_physical_region_t legion_get_physical_region_by_id(
5770 legion_physical_region_t* regionptr, int id, int num_regions);
5771#ifdef __cplusplus
5772}
5773#endif
5774
5775#endif // __LEGION_C_H__
Definition c_bindings.h:316
Definition c_bindings.h:257
Definition c_bindings.h:211
Definition c_bindings.h:172
Definition c_bindings.h:219
Definition c_bindings.h:375
Definition c_bindings.h:283
Definition c_bindings.h:274
Definition c_bindings.h:265
Definition c_bindings.h:323
Definition c_bindings.h:299
Definition c_bindings.h:290
Definition c_bindings.h:348
Definition c_bindings.h:365
Definition c_bindings.h:341
Definition c_bindings.h:126
Definition c_bindings.h:399
Definition c_bindings.h:331
Definition c_bindings.h:388
Definition c_bindings.h:355
Definition c_bindings.h:308