Legion Runtime
Loading...
Searching...
No Matches
accessors.h
1/* Copyright 2026 Stanford University, NVIDIA Corporation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __LEGION_ACCESSORS_H__
17#define __LEGION_ACCESSORS_H__
18
19#include "legion/api/buffers.h"
20#include "legion/api/future.h"
21#include "legion/api/physical_region.h"
22#include "legion/api/transforms.h"
23
24namespace Legion {
25
63 template<
64 PrivilegeMode MODE, typename FT, int N, typename COORD_T = coord_t,
65 typename A = Realm::GenericAccessor<FT, N, COORD_T>,
66#ifdef LEGION_BOUNDS_CHECKS
67 bool CHECK_BOUNDS = true>
68#else
69 bool CHECK_BOUNDS = false>
70#endif
72 private:
73 static_assert(N > 0, "N must be positive");
74 static_assert(N <= LEGION_MAX_DIM, "N must be <= LEGION_MAX_DIM");
75 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
76 public:
77 FieldAccessor(void) { }
79 const PhysicalRegion& region, FieldID fid,
80 // The actual field size in case it is different from the
81 // one being used in FT and we still want to check it
82 size_t actual_field_size = sizeof(FT),
83#ifdef LEGION_DEBUG
84 bool check_field_size = true,
85#else
86 bool check_field_size = false,
87#endif
88 bool silence_warnings = false, const char* warning_string = nullptr,
89 size_t subfield_offset = 0)
90 { }
91 // For Realm::AffineAccessor specializations there are additional
92 // methods for creating accessors with limited bounding boxes and
93 // affine transformations for using alternative coordinates spaces
94 // Specify a specific bounds rectangle to use for the accessor
96 const PhysicalRegion& region, FieldID fid,
97 const Rect<N, COORD_T> bounds,
98 // The actual field size in case it is different from the
99 // one being used in FT and we still want to check it
100 size_t actual_field_size = sizeof(FT),
101#ifdef LEGION_DEBUG
102 bool check_field_size = true,
103#else
104 bool check_field_size = false,
105#endif
106 bool silence_warnings = false, const char* warning_string = nullptr,
107 size_t subfield_offset = 0)
108 { }
109 // Specify a specific Affine transform to use for interpreting points
110 // Not avalable for Realm::MultiAffineAccessor specializations
111 template<int M>
113 const PhysicalRegion& region, FieldID fid,
114 const AffineTransform<M, N, COORD_T> transform,
115 // The actual field size in case it is different from the
116 // one being used in FT and we still want to check it
117 size_t actual_field_size = sizeof(FT),
118#ifdef LEGION_DEBUG
119 bool check_field_size = true,
120#else
121 bool check_field_size = false,
122#endif
123 bool silence_warnings = false, const char* warning_string = nullptr,
124 size_t subfield_offset = 0)
125 { }
126 // Specify both a transform and a bounds to use
127 // Not avalable for Realm::MultiAffineAccessor specializations
128 template<int M>
130 const PhysicalRegion& region, FieldID fid,
131 const AffineTransform<M, N, COORD_T> transform,
132 const Rect<N, COORD_T> bounds,
133 // The actual field size in case it is different from the
134 // one being used in FT and we still want to check it
135 size_t actual_field_size = sizeof(FT),
136#ifdef LEGION_DEBUG
137 bool check_field_size = true,
138#else
139 bool check_field_size = false,
140#endif
141 bool silence_warnings = false, const char* warning_string = nullptr,
142 size_t subfield_offset = 0)
143 { }
144 // Create a field accessor for a Future
145 // (only with READ-ONLY privileges and AffineAccessors)
147 const Future& future, Memory::Kind kind = Memory::NO_MEMKIND,
148 // The actual field size in case it is different from the
149 // one being used in FT and we still want to check it
150 size_t actual_field_size = sizeof(FT),
151#ifdef LEGION_DEBUG
152 bool check_field_size = true,
153#else
154 bool check_field_size = false,
155#endif
156 bool silence_warnings = false, const char* warning_string = nullptr,
157 size_t subfield_offset = 0)
158 { }
159 // Create a field accessor for a Future
160 // (only with READ-ONLY privileges and AffineAccessors)
162 const Future& future, const Rect<N, COORD_T> bounds,
163 Memory::Kind kind = Memory::NO_MEMKIND,
164 // The actual field size in case it is different from the
165 // one being used in FT and we still want to check it
166 size_t actual_field_size = sizeof(FT),
167#ifdef LEGION_DEBUG
168 bool check_field_size = true,
169#else
170 bool check_field_size = false,
171#endif
172 bool silence_warnings = false, const char* warning_string = nullptr,
173 size_t subfield_offset = 0)
174 { }
175 public:
176 // Variations of the above four methods but with multiple physical
177 // regions specified using input iterators for colocation regions
178 // Colocation regions from [start, stop)
179 template<typename InputIterator>
181 InputIterator start_region, InputIterator stop_region, FieldID fid,
182 // The actual field size in case it is different from the
183 // one being used in FT and we still want to check it
184 size_t actual_field_size = sizeof(FT),
185#ifdef LEGION_DEBUG
186 bool check_field_size = true,
187#else
188 bool check_field_size = false,
189#endif
190 bool silence_warnings = false, const char* warning_string = nullptr,
191 size_t subfield_offset = 0)
192 { }
193 // For Realm::AffineAccessor specializations there are additional
194 // methods for creating accessors with limited bounding boxes and
195 // affine transformations for using alternative coordinates spaces
196 // Specify a specific bounds rectangle to use for the accessor
197 // Colocation regions from [start, stop)
198 template<typename InputIterator>
200 InputIterator start_region, InputIterator stop_region, FieldID fid,
201 const Rect<N, COORD_T> bounds,
202 // The actual field size in case it is different from the
203 // one being used in FT and we still want to check it
204 size_t actual_field_size = sizeof(FT),
205#ifdef LEGION_DEBUG
206 bool check_field_size = true,
207#else
208 bool check_field_size = false,
209#endif
210 bool silence_warnings = false, const char* warning_string = nullptr,
211 size_t subfield_offset = 0)
212 { }
213 // Specify a specific Affine transform to use for interpreting points
214 // Not avalable for Realm::MultiAffineAccessor specializations
215 // Colocation regions from [start, stop)
216 template<typename InputIterator, int M>
218 InputIterator start_region, InputIterator stop_region, FieldID fid,
219 const AffineTransform<M, N, COORD_T> transform,
220 // The actual field size in case it is different from the
221 // one being used in FT and we still want to check it
222 size_t actual_field_size = sizeof(FT),
223#ifdef LEGION_DEBUG
224 bool check_field_size = true,
225#else
226 bool check_field_size = false,
227#endif
228 bool silence_warnings = false, const char* warning_string = nullptr,
229 size_t subfield_offset = 0)
230 { }
231 // Specify both a transform and a bounds to use
232 // Not avalable for Realm::MultiAffineAccessor specializations
233 // Colocation regions from [start, stop)
234 template<typename InputIterator, int M>
236 InputIterator start_region, InputIterator stop_region, FieldID fid,
237 const AffineTransform<M, N, COORD_T> transform,
238 const Rect<N, COORD_T> bounds,
239 // The actual field size in case it is different from the
240 // one being used in FT and we still want to check it
241 size_t actual_field_size = sizeof(FT),
242#ifdef LEGION_DEBUG
243 bool check_field_size = true,
244#else
245 bool check_field_size = false,
246#endif
247 bool silence_warnings = false, const char* warning_string = nullptr,
248 size_t subfield_offset = 0)
249 { }
250 public:
251 // Create a FieldAccessor for an UntypedDeferredValue
252 // (only with AffineAccessors)
254 const UntypedDeferredValue& value,
255 // The actual field size in case it is different from the
256 // one being used in FT and we still want to check it
257 size_t actual_field_size = sizeof(FT),
258#ifdef LEGION_DEBUG
259 bool check_field_size = true,
260#else
261 bool check_field_size = false,
262#endif
263 bool silence_warnings = false, const char* warning_string = nullptr,
264 size_t subfield_offset = 0)
265 { }
266 // Create a FieldAccessor for an UntypedDeferredValue
267 // Specify a specific bounds rectangle to use for the accessor
268 // (only with AffineAccessors)
270 const UntypedDeferredValue& value, const Rect<N, COORD_T>& bounds,
271 // The actual field size in case it is different from the
272 // one being used in FT and we still want to check it
273 size_t actual_field_size = sizeof(FT),
274#ifdef LEGION_DEBUG
275 bool check_field_size = true,
276#else
277 bool check_field_size = false,
278#endif
279 bool silence_warnings = false, const char* warning_string = nullptr,
280 size_t subfield_offset = 0)
281 { }
282 public:
283 // Create a FieldAccessor for UntypedDeferredBuffer
284 // (only with AffineAccessors)
286 const UntypedDeferredBuffer<COORD_T>& buffer,
287 // The actual field size in case it is different from the
288 // one being used in FT and we still want to check it
289 size_t actual_field_size = sizeof(FT),
290#ifdef LEGION_DEBUG
291 bool check_field_size = true,
292#else
293 bool check_field_size = false,
294#endif
295 bool silence_warnings = false, const char* warning_string = nullptr,
296 size_t subfield_offset = 0)
297 { }
298 // Create a FieldAccessor for UntypedDeferredBuffer
299 // Specify a specific bounds rectangle to use for the accessor
300 // (only with AffineAccessors)
302 const UntypedDeferredBuffer<COORD_T>& buffer,
303 const Rect<N, COORD_T>& bounds,
304 // The actual field size in case it is different from the
305 // one being used in FT and we still want to check it
306 size_t actual_field_size = sizeof(FT),
307#ifdef LEGION_DEBUG
308 bool check_field_size = true,
309#else
310 bool check_field_size = false,
311#endif
312 bool silence_warnings = false, const char* warning_string = nullptr,
313 size_t subfield_offset = 0)
314 { }
315 // Create a FieldAccessor for UntypedDeferredBuffer
316 // Specify a specific Affine transform to use for interpreting points
317 // (only with AffineAccessors)
318 template<int M>
320 const UntypedDeferredBuffer<COORD_T>& buffer,
321 const AffineTransform<M, N, COORD_T>& transform,
322 // The actual field size in case it is different from the
323 // one being used in FT and we still want to check it
324 size_t actual_field_size = sizeof(FT),
325#ifdef LEGION_DEBUG
326 bool check_field_size = true,
327#else
328 bool check_field_size = false,
329#endif
330 bool silence_warnings = false, const char* warning_string = nullptr,
331 size_t subfield_offset = 0)
332 { }
333 // Create a FieldAccessor for UntypedDeferredBuffer
334 // Specify both a transform and a bounds to use
335 // (only with AffineAccessors)
336 template<int M>
338 const UntypedDeferredBuffer<COORD_T>& buffer,
339 const AffineTransform<M, N, COORD_T>& transform,
340 const Rect<N, COORD_T>& bounds,
341 // The actual field size in case it is different from the
342 // one being used in FT and we still want to check it
343 size_t actual_field_size = sizeof(FT),
344#ifdef LEGION_DEBUG
345 bool check_field_size = true,
346#else
347 bool check_field_size = false,
348#endif
349 bool silence_warnings = false, const char* warning_string = nullptr,
350 size_t subfield_offset = 0)
351 { }
352 public:
353 typedef FT value_type;
354 typedef FT& reference;
355 typedef const FT& const_reference;
356 static const int dim = N;
357 };
358
371 template<
372 typename REDOP, bool EXCLUSIVE, int N, typename COORD_T = coord_t,
373 typename A = Realm::GenericAccessor<typename REDOP::RHS, N, COORD_T>,
374#ifdef LEGION_BOUNDS_CHECKS
375 bool CHECK_BOUNDS = true>
376#else
377 bool CHECK_BOUNDS = false>
378#endif
380 private:
381 static_assert(N > 0, "N must be positive");
382 static_assert(N <= LEGION_MAX_DIM, "N must be <= LEGION_MAX_DIM");
383 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
384 public:
385 ReductionAccessor(void) { }
387 const PhysicalRegion& region, FieldID fid, ReductionOpID redop,
388 bool silence_warnings = false, const char* warning_string = nullptr,
389 size_t subfield_offset = 0,
390 size_t actual_field_size = sizeof(typename REDOP::RHS),
391#ifdef LEGION_DEBUG
392 bool check_field_size = true
393#else
394 bool check_field_size = false
395#endif
396 )
397 { }
398 // For Realm::AffineAccessor specializations there are additional
399 // methods for creating accessors with limited bounding boxes and
400 // affine transformations for using alternative coordinates spaces
401 // Specify a specific bounds rectangle to use for the accessor
403 const PhysicalRegion& region, FieldID fid, ReductionOpID redop,
404 const Rect<N, COORD_T> bounds, bool silence_warnings = false,
405 const char* warning_string = nullptr, size_t subfield_offset = 0,
406 size_t actual_field_size = sizeof(typename REDOP::RHS),
407#ifdef LEGION_DEBUG
408 bool check_field_size = true
409#else
410 bool check_field_size = false
411#endif
412 )
413 { }
414 // Specify a specific Affine transform to use for interpreting points
415 // Not available for Realm::MultiAffineAccessor specializations
416 template<int M>
418 const PhysicalRegion& region, FieldID fid, ReductionOpID redop,
419 const AffineTransform<M, N, COORD_T> transform,
420 bool silence_warnings = false, const char* warning_string = nullptr,
421 size_t subfield_offset = 0,
422 size_t actual_field_size = sizeof(typename REDOP::RHS),
423#ifdef LEGION_DEBUG
424 bool check_field_size = true
425#else
426 bool check_field_size = false
427#endif
428 )
429 { }
430 // Specify both a transform and a bounds to use
431 // Not available for Realm::MultiAffineAccessor specializations
432 template<int M>
434 const PhysicalRegion& region, FieldID fid, ReductionOpID redop,
435 const AffineTransform<M, N, COORD_T> transform,
436 const Rect<N, COORD_T> bounds, bool silence_warnings = false,
437 const char* warning_string = nullptr, size_t subfield_offset = 0,
438 size_t actual_field_size = sizeof(typename REDOP::RHS),
439#ifdef LEGION_DEBUG
440 bool check_field_size = true
441#else
442 bool check_field_size = false
443#endif
444 )
445 { }
446 public:
447 // Variations of the same four methods above but with multiple
448 // physical regions specified using input iterators for colocation regions
449 // Colocation regions from [start, stop)
450 template<typename InputIterator>
452 InputIterator start_region, InputIterator stop_region, FieldID fid,
453 ReductionOpID redop, bool silence_warnings = false,
454 const char* warning_string = nullptr, size_t subfield_offset = 0,
455 size_t actual_field_size = sizeof(typename REDOP::RHS),
456#ifdef LEGION_DEBUG
457 bool check_field_size = true
458#else
459 bool check_field_size = false
460#endif
461 )
462 { }
463 // For Realm::AffineAccessor specializations there are additional
464 // methods for creating accessors with limited bounding boxes and
465 // affine transformations for using alternative coordinates spaces
466 // Specify a specific bounds rectangle to use for the accessor
467 // Colocation regions from [start, stop)
468 template<typename InputIterator>
470 InputIterator start_region, InputIterator stop_region, FieldID fid,
471 ReductionOpID redop, const Rect<N, COORD_T> bounds,
472 bool silence_warnings = false, const char* warning_string = nullptr,
473 size_t subfield_offset = 0,
474 size_t actual_field_size = sizeof(typename REDOP::RHS),
475#ifdef LEGION_DEBUG
476 bool check_field_size = true
477#else
478 bool check_field_size = false
479#endif
480 )
481 { }
482 // Specify a specific Affine transform to use for interpreting points
483 // Not available for Realm::MultiAffineAccessor specializations
484 // Colocation regions from [start, stop)
485 template<typename InputIterator, int M>
487 InputIterator start_region, InputIterator stop_region, FieldID fid,
488 ReductionOpID redop, const AffineTransform<M, N, COORD_T> transform,
489 bool silence_warnings = false, const char* warning_string = nullptr,
490 size_t subfield_offset = 0,
491 size_t actual_field_size = sizeof(typename REDOP::RHS),
492#ifdef LEGION_DEBUG
493 bool check_field_size = true
494#else
495 bool check_field_size = false
496#endif
497 )
498 { }
499 // Specify both a transform and a bounds to use
500 // Not available for Realm::MultiAffineAccessor specializations
501 // Colocation regions from [start, stop)
502 template<typename InputIterator, int M>
504 InputIterator start_region, InputIterator stop_region, FieldID fid,
505 ReductionOpID redop, const AffineTransform<M, N, COORD_T> transform,
506 const Rect<N, COORD_T> bounds, bool silence_warnings = false,
507 const char* warning_string = nullptr, size_t subfield_offset = 0,
508 size_t actual_field_size = sizeof(typename REDOP::RHS),
509#ifdef LEGION_DEBUG
510 bool check_field_size = true
511#else
512 bool check_field_size = false
513#endif
514 )
515 { }
516 public:
517 // Create a ReductionAccessor for an UntypedDeferredValue
518 // (only with AffineAccessors)
520 const UntypedDeferredValue& value, bool silence_warnings = false,
521 const char* warning_string = nullptr, size_t subfield_offset = 0,
522 size_t actual_field_size = sizeof(typename REDOP::RHS),
523#ifdef LEGION_DEBUG
524 bool check_field_size = true
525#else
526 bool check_field_size = false
527#endif
528 )
529 { }
530 // Create a ReductionAccessor for an UntypedDeferredValue
531 // Specify a specific bounds rectangle to use for the accessor
532 // (only with AffineAccessors)
534 const UntypedDeferredValue& value, const Rect<N, COORD_T>& bounds,
535 bool silence_warnings = false, const char* warning_string = nullptr,
536 size_t subfield_offset = 0,
537 size_t actual_field_size = sizeof(typename REDOP::RHS),
538#ifdef LEGION_DEBUG
539 bool check_field_size = true
540#else
541 bool check_field_size = false
542#endif
543 )
544 { }
545 public:
546 // Create a ReductionAccessor for an UntypedDeferredBuffer
547 // (only with AffineAccessors)
549 const UntypedDeferredBuffer<COORD_T>& buffer,
550 bool silence_warnings = false, const char* warning_string = nullptr,
551 size_t subfield_offset = 0,
552 size_t actual_field_size = sizeof(typename REDOP::RHS),
553#ifdef LEGION_DEBUG
554 bool check_field_size = true
555#else
556 bool check_field_size = false
557#endif
558 )
559 { }
560 // Create a ReductionAccessor for an UntypedDeferredBuffer
561 // Specify a specific bounds rectangle to use for the accessor
562 // (only with AffineAccessors)
564 const UntypedDeferredBuffer<COORD_T>& buffer,
565 const Rect<N, COORD_T>& bounds, bool silence_warnings = false,
566 const char* warning_string = nullptr, size_t subfield_offset = 0,
567 size_t actual_field_size = sizeof(typename REDOP::RHS),
568#ifdef LEGION_DEBUG
569 bool check_field_size = true
570#else
571 bool check_field_size = false
572#endif
573 )
574 { }
575 // Create a ReductionAccessor for an UntypedDeferredBuffer
576 // Specify a specific Affine transform to use for interpreting points
577 // (only with AffineAccessors)
578 template<int M>
580 const UntypedDeferredBuffer<COORD_T>& buffer,
581 const AffineTransform<M, N, COORD_T>& transform,
582 bool silence_warnings = false, const char* warning_string = nullptr,
583 size_t subfield_offset = 0,
584 size_t actual_field_size = sizeof(typename REDOP::RHS),
585#ifdef LEGION_DEBUG
586 bool check_field_size = true
587#else
588 bool check_field_size = false
589#endif
590 )
591 { }
592 // Create a ReductionAccessor for an UntypedDeferredBuffer
593 // Specify both a transform and a bounds to use
594 // (only with AffineAccessors)
595 template<int M>
597 const UntypedDeferredBuffer<COORD_T>& buffer,
598 const AffineTransform<M, N, COORD_T>& transform,
599 const Rect<N, COORD_T>& bounds, bool silence_warnings = false,
600 const char* warning_string = nullptr, size_t subfield_offset = 0,
601 size_t actual_field_size = sizeof(typename REDOP::RHS),
602#ifdef LEGION_DEBUG
603 bool check_field_size = true
604#else
605 bool check_field_size = false
606#endif
607 )
608 { }
609 public:
610 typedef typename REDOP::RHS value_type;
611 typedef typename REDOP::RHS& reference;
612 typedef const typename REDOP::RHS& const_reference;
613 static const int dim = N;
614 };
615
638 template<
639 typename FT, int N, typename COORD_T = coord_t,
640 typename A = Realm::GenericAccessor<FT, N, COORD_T>,
641#ifdef LEGION_BOUNDS_CHECKS
642 bool CHECK_BOUNDS = true>
643#else
644 bool CHECK_BOUNDS = false>
645#endif
647 public:
648 PaddingAccessor(void) { }
650 const PhysicalRegion& region, FieldID fid,
651 // The actual field size in case it is different from the
652 // one being used in FT and we still want to check it
653 size_t actual_field_size = sizeof(FT),
654#ifdef LEGION_DEBUG
655 bool check_field_size = true,
656#else
657 bool check_field_size = false,
658#endif
659 bool silence_warnings = false, const char* warning_string = nullptr,
660 size_t subfield_offset = 0)
661 { }
662 };
663
664#ifdef LEGION_MULTI_REGION_ACCESSOR
665 // Multi-Region Accessors are a provisional feature now and are likely
666 // to be deprecated and removed in the near future. Instead of multi-region
667 // accessors you should be able to use the new colocation constructors
668 // on the traditional Field Accessors.
698 template<
699 typename FT, int N, typename COORD_T = coord_t,
700 typename A = Realm::GenericAccessor<FT, N, COORD_T>,
701#ifdef LEGION_BOUNDS_CHECKS
702 bool CHECK_BOUNDS = true,
703#else
704 bool CHECK_BOUNDS = false,
705#endif
706#ifdef LEGION_PRIVILEGE_CHECKS
707 bool CHECK_PRIVILEGES = true,
708#else
709 bool CHECK_PRIVILEGES = false,
710#endif
711 // Only used if bounds/privilege checks enabled
712 // Can safely over-approximate, but may cost space
713 // Especially GPU parameter space
714 int MAX_REGIONS = 4>
715 class MultiRegionAccessor {
716 private:
717 static_assert(N > 0, "N must be positive");
718 static_assert(N <= LEGION_MAX_DIM, "N must be <= LEGION_MAX_DIM");
719 static_assert(std::is_integral<COORD_T>::value, "must be integral type");
720 public:
721 MultiRegionAccessor(void) { }
722 public: // iterator based construction of the multi-region accessors
723 template<typename InputIterator>
724 MultiRegionAccessor(
725 InputIterator start, InputIterator stop,
726 // The actual field size in case it is different from
727 // the one being used in FT and we still want to check
728 FieldID fid, size_t actual_field_size = sizeof(FT),
729#ifdef LEGION_DEBUG
730 bool check_field_size = true,
731#else
732 bool check_field_size = false,
733#endif
734 bool silence_warnings = false, const char* warning_string = nullptr,
735 size_t subfield_offset = 0)
736 { }
737 // Specify a specific bounds rectangle to use for the accessor
738 template<typename InputIterator>
739 MultiRegionAccessor(
740 InputIterator start, InputIterator stop, const Rect<N, COORD_T> bounds,
741 FieldID fid,
742 // The actual field size in case it is different from
743 // the one being used in FT and we still want to check
744 size_t actual_field_size = sizeof(FT),
745#ifdef LEGION_DEBUG
746 bool check_field_size = true,
747#else
748 bool check_field_size = false,
749#endif
750 bool silence_warnings = false, const char* warning_string = nullptr,
751 size_t subfield_offset = 0)
752 { }
753 // Specify a specific Affine transform to use for interpreting points
754 template<int M, typename InputIterator>
755 MultiRegionAccessor(
756 InputIterator start, InputIterator stop,
757 const AffineTransform<M, N, COORD_T> transform,
758 // The actual field size in case it is different from
759 // the one being used in FT and we still want to check
760 FieldID fid, size_t actual_field_size = sizeof(FT),
761#ifdef LEGION_DEBUG
762 bool check_field_size = true,
763#else
764 bool check_field_size = false,
765#endif
766 bool silence_warnings = false, const char* warning_string = nullptr,
767 size_t subfield_offset = 0)
768 { }
769 // Specify both a transform and a bounds to use
770 template<int M, typename InputIterator>
771 MultiRegionAccessor(
772 InputIterator start, InputIterator stop,
773 const AffineTransform<M, N, COORD_T> transform,
774 const Rect<N, COORD_T> bounds, FieldID fid,
775 // The actual field size in case it is different from the
776 // one being used in FT and we still want to check it
777 size_t actual_field_size = sizeof(FT),
778#ifdef LEGION_DEBUG
779 bool check_field_size = true,
780#else
781 bool check_field_size = false,
782#endif
783 bool silence_warnings = false, const char* warning_string = nullptr,
784 size_t subfield_offset = 0)
785 { }
786 public: // explicit data structure versions of the implicit iterators above
787 MultiRegionAccessor(
788 const std::vector<PhysicalRegion>& regions,
789 // The actual field size in case it is different from
790 // the one being used in FT and we still want to check
791 FieldID fid, size_t actual_field_size = sizeof(FT),
792#ifdef LEGION_DEBUG
793 bool check_field_size = true,
794#else
795 bool check_field_size = false,
796#endif
797 bool silence_warnings = false, const char* warning_string = nullptr,
798 size_t subfield_offset = 0)
799 { }
800 // Specify a specific bounds rectangle to use for the accessor
801 MultiRegionAccessor(
802 const std::vector<PhysicalRegion>& regions,
803 const Rect<N, COORD_T> bounds, FieldID fid,
804 // The actual field size in case it is different from
805 // the one being used in FT and we still want to check
806 size_t actual_field_size = sizeof(FT),
807#ifdef LEGION_DEBUG
808 bool check_field_size = true,
809#else
810 bool check_field_size = false,
811#endif
812 bool silence_warnings = false, const char* warning_string = nullptr,
813 size_t subfield_offset = 0)
814 { }
815 // Specify a specific Affine transform to use for interpreting points
816 template<int M>
817 MultiRegionAccessor(
818 const std::vector<PhysicalRegion>& regions,
819 const AffineTransform<M, N, COORD_T> transform,
820 // The actual field size in case it is different from
821 // the one being used in FT and we still want to check
822 FieldID fid, size_t actual_field_size = sizeof(FT),
823#ifdef LEGION_DEBUG
824 bool check_field_size = true,
825#else
826 bool check_field_size = false,
827#endif
828 bool silence_warnings = false, const char* warning_string = nullptr,
829 size_t subfield_offset = 0)
830 { }
831 // Specify both a transform and a bounds to use
832 template<int M>
833 MultiRegionAccessor(
834 const std::vector<PhysicalRegion>& regions,
835 const AffineTransform<M, N, COORD_T> transform,
836 const Rect<N, COORD_T> bounds, FieldID fid,
837 // The actual field size in case it is different from the
838 // one being used in FT and we still want to check it
839 size_t actual_field_size = sizeof(FT),
840#ifdef LEGION_DEBUG
841 bool check_field_size = true,
842#else
843 bool check_field_size = false,
844#endif
845 bool silence_warnings = false, const char* warning_string = nullptr,
846 size_t subfield_offset = 0)
847 { }
848 public:
849 typedef FT value_type;
850 typedef FT& reference;
851 typedef const FT& const_reference;
852 static const int dim = N;
853 };
854#endif // LEGION_MULTI_REGION_ACCESSOR
855
856} // namespace Legion
857
858#include "accessors.inl"
859
860#endif // __LEGION_ACCESSORS_H__
Definition accessors.h:71
Definition future.h:45
Definition accessors.h:646
Definition physical_region.h:33
Definition accessors.h:379
Definition values.h:56