Legion Runtime
Loading...
Searching...
No Matches
output_region.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_OUTPUT_REGION_H__
17#define __LEGION_OUTPUT_REGION_H__
18
25
26namespace Legion {
27
35 public:
36 OutputRegion(void);
37 OutputRegion(const OutputRegion& rhs);
38 ~OutputRegion(void);
39 private:
40 Internal::OutputRegionImpl* impl;
41 protected:
42 FRIEND_ALL_RUNTIME_CLASSES
43 explicit OutputRegion(Internal::OutputRegionImpl* impl);
44 public:
45 OutputRegion& operator=(const OutputRegion& rhs);
46 public:
47 Memory target_memory(void) const;
48 // Returns the logical region of this output region.
49 // The call is legal only when the output region is valid and
50 // will raise an error otherwise.
51 LogicalRegion get_logical_region(void) const;
52 bool is_bounded_output_region(void) const;
53 public:
54 // Returns a deferred buffer that satisfies the layout constraints of
55 // this output region. The caller still needs to pass this buffer to
56 // a return_data call if the buffer needs to be bound to this output
57 // region. The caller can optionally choose to bind the returned buffer
58 // to the output region; such a call cannot be made more than once.
59 template<
60 typename T, int DIM, typename COORD_T = coord_t,
61#ifdef LEGION_BOUNDS_CHECKS
62 bool CHECK_BOUNDS = true>
63#else
64 bool CHECK_BOUNDS = false>
65#endif
66 DeferredBuffer<T, DIM, COORD_T, CHECK_BOUNDS> create_buffer(
67 const Point<DIM, COORD_T>& extents, FieldID field_id,
68 const T* initial_value = nullptr, bool return_buffer = false);
69 private:
70 void check_type_tag(TypeTag type_tag) const;
71 void check_field_size(FieldID field_id, size_t field_size) const;
72 void get_layout(
73 FieldID field_id, std::vector<DimensionKind>& ordering,
74 size_t& alignment) const;
75 public:
76 template<
77 typename T, int DIM, typename COORD_T = coord_t,
78#ifdef LEGION_BOUNDS_CHECKS
79 bool CHECK_BOUNDS = true>
80#else
81 bool CHECK_BOUNDS = false>
82#endif
83 void return_data(
84 const Point<DIM, COORD_T>& extents, FieldID field_id,
85 DeferredBuffer<T, DIM, COORD_T, CHECK_BOUNDS>& buffer);
86 void return_data(
87 const DomainPoint& extents, FieldID field_id,
88 Realm::RegionInstance instance, bool check_constraints = true);
89 private:
90 void return_data(
91 const DomainPoint& extents, FieldID field_id,
92 Realm::RegionInstance instance, const LayoutConstraintSet* constraints,
93 bool check_constraints);
94 };
95
96} // namespace Legion
97
98#include "legion/api/output_region.inl"
99
100#endif // __LEGION_OUTPUT_REGION_H__
Definition geometry.h:34
Definition constraints.h:881
Definition data.h:189
Definition output_region.h:34
Definition types.h:343
Definition accessors.h:29