Legion Runtime
Loading...
Searching...
No Matches
forwarding_mapper.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 __FORWARDING_MAPPER_H__
17#define __FORWARDING_MAPPER_H__
18
24#include "legion.h"
25
26namespace Legion {
27namespace Mapping {
28
35class ForwardingMapper : public Mapper {
36public:
37 ForwardingMapper(Mapper* mapper);
38 virtual ~ForwardingMapper();
39public:
40 const char* get_mapper_name() const override;
41 MapperSyncModel get_mapper_sync_model() const override;
42public:
43 bool request_valid_instances() const override;
44public: // Task mapping calls
45 void select_task_options(const MapperContext ctx,
46 const Task& task,
47 TaskOptions& output) override;
48 void premap_task(const MapperContext ctx,
49 const Task& task,
50 const PremapTaskInput& input,
51 PremapTaskOutput& output) override;
52 void slice_task(const MapperContext ctx,
53 const Task& task,
54 const SliceTaskInput& input,
55 SliceTaskOutput& output) override;
56 void map_task(const MapperContext ctx,
57 const Task& task,
58 const MapTaskInput& input,
59 MapTaskOutput& output) override;
60 void select_task_variant(const MapperContext ctx,
61 const Task& task,
62 const SelectVariantInput& input,
63 SelectVariantOutput& output) override;
64 void postmap_task(const MapperContext ctx,
65 const Task& task,
66 const PostMapInput& input,
67 PostMapOutput& output) override;
68 void select_task_sources(const MapperContext ctx,
69 const Task& task,
70 const SelectTaskSrcInput& input,
71 SelectTaskSrcOutput& output) override;
72 void report_profiling(const MapperContext ctx,
73 const Task& task,
74 const TaskProfilingInfo& input) override;
75public: // Inline mapping calls
76 void map_inline(const MapperContext ctx,
77 const InlineMapping& inline_op,
78 const MapInlineInput& input,
79 MapInlineOutput& output) override;
80 void select_inline_sources(const MapperContext ctx,
81 const InlineMapping& inline_op,
82 const SelectInlineSrcInput& input,
83 SelectInlineSrcOutput& output) override;
84 void report_profiling(const MapperContext ctx,
85 const InlineMapping& inline_op,
86 const InlineProfilingInfo& input) override;
87public: // Copy mapping calls
88 void map_copy(const MapperContext ctx,
89 const Copy& copy,
90 const MapCopyInput& input,
91 MapCopyOutput& output) override;
92 void select_copy_sources(const MapperContext ctx,
93 const Copy& copy,
94 const SelectCopySrcInput& input,
95 SelectCopySrcOutput& output) override;
96 void report_profiling(const MapperContext ctx,
97 const Copy& copy,
98 const CopyProfilingInfo& input) override;
99public: // Close mapping calls
100 void select_close_sources(const MapperContext ctx,
101 const Close& close,
102 const SelectCloseSrcInput& input,
103 SelectCloseSrcOutput& output) override;
104 void report_profiling(const MapperContext ctx,
105 const Close& close,
106 const CloseProfilingInfo& input) override;
107public: // Acquire mapping calls
108 void map_acquire(const MapperContext ctx,
109 const Acquire& acquire,
110 const MapAcquireInput& input,
111 MapAcquireOutput& output) override;
112 void report_profiling(const MapperContext ctx,
113 const Acquire& acquire,
114 const AcquireProfilingInfo& input) override;
115public: // Release mapping calls
116 void map_release(const MapperContext ctx,
117 const Release& release,
118 const MapReleaseInput& input,
119 MapReleaseOutput& output) override;
120 void select_release_sources(const MapperContext ctx,
121 const Release& release,
122 const SelectReleaseSrcInput& input,
123 SelectReleaseSrcOutput& output) override;
124 void report_profiling(const MapperContext ctx,
125 const Release& release,
126 const ReleaseProfilingInfo& input) override;
127public: // Partition mapping calls
128 void select_partition_projection(const MapperContext ctx,
129 const Partition& partition,
131 SelectPartitionProjectionOutput& output) override;
132 void map_partition(const MapperContext ctx,
133 const Partition& partition,
134 const MapPartitionInput& input,
135 MapPartitionOutput& output) override;
136 void select_partition_sources(
137 const MapperContext ctx,
138 const Partition& partition,
139 const SelectPartitionSrcInput& input,
140 SelectPartitionSrcOutput& output) override;
141 void report_profiling(const MapperContext ctx,
142 const Partition& partition,
143 const PartitionProfilingInfo& input) override;
144public: // Task execution mapping calls
145 void configure_context(const MapperContext ctx,
146 const Task& task,
147 ContextConfigOutput& output) override;
148 void select_tunable_value(const MapperContext ctx,
149 const Task& task,
150 const SelectTunableInput& input,
151 SelectTunableOutput& output) override;
152public: // Must epoch mapping
153 void map_must_epoch(const MapperContext ctx,
154 const MapMustEpochInput& input,
155 MapMustEpochOutput& output) override;
156public: // Dataflow graph mapping
157 void map_dataflow_graph(const MapperContext ctx,
158 const MapDataflowGraphInput& input,
159 MapDataflowGraphOutput& output) override;
160public: // Memoization control
161 void memoize_operation(const MapperContext ctx,
162 const Mappable& mappable,
163 const MemoizeInput& input,
164 MemoizeOutput& output) override;
165public: // Mapping control and stealing
166 void select_tasks_to_map(const MapperContext ctx,
167 const SelectMappingInput& input,
168 SelectMappingOutput& output) override;
169 void select_steal_targets(const MapperContext ctx,
170 const SelectStealingInput& input,
171 SelectStealingOutput& output) override;
172 void permit_steal_request(const MapperContext ctx,
173 const StealRequestInput& intput,
174 StealRequestOutput& output) override;
175public: // handling
176 void handle_message(const MapperContext ctx,
177 const MapperMessage& message) override;
178 void handle_task_result(const MapperContext ctx,
179 const MapperTaskResult& result) override;
180#ifndef NO_LEGION_CONTROL_REPLICATION
181public: // Control replication
182 void replicate_task(MapperContext ctx,
183 const Task& task,
184 const ReplicateTaskInput& input,
185 ReplicateTaskOutput& output) override;
186 void select_sharding_functor(
187 const MapperContext ctx,
188 const Task& task,
189 const SelectShardingFunctorInput& input,
190 SelectShardingFunctorOutput& output) override;
192 const MapperContext ctx,
193 const Copy& copy,
194 const SelectShardingFunctorInput& input,
195 SelectShardingFunctorOutput& output) override;
197 const MapperContext ctx,
198 const Close& close,
199 const SelectShardingFunctorInput& input,
200 SelectShardingFunctorOutput& output) override;
202 const MapperContext ctx,
203 const Acquire& acquire,
204 const SelectShardingFunctorInput& input,
205 SelectShardingFunctorOutput& output) override;
207 const MapperContext ctx,
208 const Release& release,
209 const SelectShardingFunctorInput& input,
210 SelectShardingFunctorOutput& output) override;
212 const MapperContext ctx,
213 const Partition& partition,
214 const SelectShardingFunctorInput& input,
215 SelectShardingFunctorOutput& output) override;
217 const MapperContext ctx,
218 const Fill& fill,
219 const SelectShardingFunctorInput& input,
220 SelectShardingFunctorOutput& output) override;
221 void select_sharding_functor(
222 const MapperContext ctx,
223 const MustEpoch& epoch,
224 const SelectShardingFunctorInput& input,
225 MustEpochShardingFunctorOutput& output) override;
226#endif // NO_LEGION_CONTROL_REPLICATION
227protected:
228 Mapper* const mapper;
229};
230
231}; // namespace Mapping
232}; // namespace Legion
233
234#endif // __FORWARDING_MAPPER_H__
Definition mapping.h:240
Definition mapping.h:292
Definition mapping.h:185
Definition mapping.h:312
Definition mapping.h:216
Definition mapping.h:42
Definition forwarding_mapper.h:35
const char * get_mapper_name() const override
void select_sharding_functor(const MapperContext ctx, const Acquire &acquire, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
void select_sharding_functor(const MapperContext ctx, const Fill &fill, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
void select_sharding_functor(const MapperContext ctx, const Release &release, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
void select_sharding_functor(const MapperContext ctx, const Close &close, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
bool request_valid_instances() const override
void select_sharding_functor(const MapperContext ctx, const Copy &copy, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
void select_sharding_functor(const MapperContext ctx, const Partition &partition, const SelectShardingFunctorInput &input, SelectShardingFunctorOutput &output) override
Definition mapping.h:642
MapperSyncModel
Definition mapping.h:678
Definition mapping.h:377
Definition mapping.h:342
Definition mapping.h:264
Definition mapping.h:112
Definition accessors.h:29
Definition mapping.h:1403
Definition mapping.h:2283
Definition mapping.h:1131
Definition mapping.h:1136
Definition mapping.h:783