Legion Runtime
Loading...
Searching...
No Matches
argument_map.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_ARGUMENT_MAP_H__
17#define __LEGION_ARGUMENT_MAP_H__
18
19#include "legion/api/future_map.h"
20
21namespace Legion {
22
23 //==========================================================================
24 // Pass-By-Value Argument Classes
25 //==========================================================================
26
36 public:
37 UntypedBuffer(void) : args(nullptr), arglen(0) { }
38 UntypedBuffer(const void* arg, size_t argsize)
39 : args(const_cast<void*>(arg)), arglen(argsize)
40 { }
41 UntypedBuffer(const UntypedBuffer& rhs) : args(rhs.args), arglen(rhs.arglen)
42 { }
43 UntypedBuffer(UntypedBuffer&& rhs) noexcept
44 : args(rhs.args), arglen(rhs.arglen)
45 { }
46 public:
47 inline size_t get_size(void) const { return arglen; }
48 inline void* get_ptr(void) const { return args; }
49 public:
50 inline bool operator==(const UntypedBuffer& arg) const
51 {
52 return (args == arg.args) && (arglen == arg.arglen);
53 }
54 inline bool operator<(const UntypedBuffer& arg) const
55 {
56 return (args < arg.args) && (arglen < arg.arglen);
57 }
58 inline UntypedBuffer& operator=(const UntypedBuffer& rhs)
59 {
60 args = rhs.args;
61 arglen = rhs.arglen;
62 return *this;
63 }
64 inline UntypedBuffer& operator=(UntypedBuffer&& rhs) noexcept
65 {
66 args = rhs.args;
67 arglen = rhs.arglen;
68 return *this;
69 }
70 private:
71 void* args;
72 size_t arglen;
73 };
74 // This typedef is here for backwards compatibility since we
75 // used to call an UntypedBuffer a TaskArgument
77
88 class ArgumentMap : public Unserializable {
89 public:
90 ArgumentMap(void);
91 ArgumentMap(const FutureMap& rhs);
92 ArgumentMap(const ArgumentMap& rhs);
93 ArgumentMap(ArgumentMap&& rhs) noexcept;
94 ~ArgumentMap(void);
95 public:
96 ArgumentMap& operator=(const FutureMap& rhs);
97 ArgumentMap& operator=(const ArgumentMap& rhs);
98 ArgumentMap& operator=(ArgumentMap&& rhs) noexcept;
99 inline bool operator==(const ArgumentMap& rhs) const
100 {
101 return (impl == rhs.impl);
102 }
103 inline bool operator<(const ArgumentMap& rhs) const
104 {
105 return (impl < rhs.impl);
106 }
107 inline bool exists(void) const { return (impl != nullptr); }
108 public:
114 bool has_point(const DomainPoint& point);
122 const DomainPoint& point, const UntypedBuffer& arg,
123 bool replace = true);
131 const DomainPoint& point, const Future& f, bool replace = true);
137 bool remove_point(const DomainPoint& point);
146 public:
155 template<typename PT, unsigned DIM>
156 inline void set_point_arg(
157 const PT point[DIM], const UntypedBuffer& arg, bool replace = false);
163 template<typename PT, unsigned DIM>
164 inline bool remove_point(const PT point[DIM]);
165 private:
166 FRIEND_ALL_RUNTIME_CLASSES
167 Internal::ArgumentMapImpl* impl;
168 private:
169 explicit ArgumentMap(Internal::ArgumentMapImpl* i);
170 };
171
172} // namespace Legion
173
174#include "legion/api/argument_map.inl"
175
176#endif // __LEGION_ARGUMENT_MAP_H__
Definition argument_map.h:88
void set_point(const DomainPoint &point, const UntypedBuffer &arg, bool replace=true)
bool remove_point(const DomainPoint &point)
bool remove_point(const PT point[DIM])
bool has_point(const DomainPoint &point)
void set_point_arg(const PT point[DIM], const UntypedBuffer &arg, bool replace=false)
void set_point(const DomainPoint &point, const Future &f, bool replace=true)
UntypedBuffer get_point(const DomainPoint &point) const
Definition geometry.h:29
Definition future.h:45
Definition future_map.h:36
Definition types.h:334
Definition argument_map.h:35