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