Legion Runtime
Loading...
Searching...
No Matches
argument_map.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_ARGUMENT_MAP_H__
17#define __LEGION_ARGUMENT_MAP_H__
18
25
26namespace Legion {
27
28 //==========================================================================
29 // Pass-By-Value Argument Classes
30 //==========================================================================
31
41 public:
42 UntypedBuffer(void) : args(nullptr), arglen(0) { }
43 UntypedBuffer(const void* arg, size_t argsize)
44 : args(const_cast<void*>(arg)), arglen(argsize)
45 { }
46 UntypedBuffer(const UntypedBuffer& rhs) : args(rhs.args), arglen(rhs.arglen)
47 { }
48 UntypedBuffer(UntypedBuffer&& rhs) noexcept
49 : args(rhs.args), arglen(rhs.arglen)
50 { }
51 public:
52 inline size_t get_size(void) const { return arglen; }
53 inline void* get_ptr(void) const { return args; }
54 public:
55 inline bool operator==(const UntypedBuffer& arg) const
56 {
57 return (args == arg.args) && (arglen == arg.arglen);
58 }
59 inline bool operator<(const UntypedBuffer& arg) const
60 {
61 return (args < arg.args) && (arglen < arg.arglen);
62 }
63 inline UntypedBuffer& operator=(const UntypedBuffer& rhs)
64 {
65 args = rhs.args;
66 arglen = rhs.arglen;
67 return *this;
68 }
69 inline UntypedBuffer& operator=(UntypedBuffer&& rhs) noexcept
70 {
71 args = rhs.args;
72 arglen = rhs.arglen;
73 return *this;
74 }
75 private:
76 void* args;
77 size_t arglen;
78 };
79 // This typedef is here for backwards compatibility since we
80 // used to call an UntypedBuffer a TaskArgument
82
93 class ArgumentMap : public Unserializable {
94 public:
95 ArgumentMap(void);
96 ArgumentMap(const FutureMap& rhs);
97 ArgumentMap(const ArgumentMap& rhs);
98 ArgumentMap(ArgumentMap&& rhs) noexcept;
99 ~ArgumentMap(void);
100 public:
101 ArgumentMap& operator=(const FutureMap& rhs);
102 ArgumentMap& operator=(const ArgumentMap& rhs);
103 ArgumentMap& operator=(ArgumentMap&& rhs) noexcept;
104 inline bool operator==(const ArgumentMap& rhs) const
105 {
106 return (impl == rhs.impl);
107 }
108 inline bool operator<(const ArgumentMap& rhs) const
109 {
110 return (impl < rhs.impl);
111 }
112 inline bool exists(void) const { return (impl != nullptr); }
113 public:
119 bool has_point(const DomainPoint& point);
127 const DomainPoint& point, const UntypedBuffer& arg,
128 bool replace = true);
136 const DomainPoint& point, const Future& f, bool replace = true);
142 bool remove_point(const DomainPoint& point);
151 public:
160 template<typename PT, unsigned DIM>
161 inline void set_point_arg(
162 const PT point[DIM], const UntypedBuffer& arg, bool replace = false);
168 template<typename PT, unsigned DIM>
169 inline bool remove_point(const PT point[DIM]);
170 private:
171 FRIEND_ALL_RUNTIME_CLASSES
172 Internal::ArgumentMapImpl* impl;
173 private:
174 explicit ArgumentMap(Internal::ArgumentMapImpl* i);
175 };
176
177} // namespace Legion
178
179#include "legion/api/argument_map.inl"
180
181#endif // __LEGION_ARGUMENT_MAP_H__
Definition argument_map.h:93
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:34
Definition future.h:50
Definition future_map.h:41
Definition types.h:343
Definition argument_map.h:40
Definition accessors.h:29