Legion Runtime
Loading...
Searching...
No Matches
future_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_FUTURE_MAP_H__
17#define __LEGION_FUTURE_MAP_H__
18
24#include "legion/api/future.h"
25
26namespace Legion {
27
41 class FutureMap : public Unserializable {
42 public:
43 FutureMap(void);
44 FutureMap(const FutureMap& map);
45 FutureMap(FutureMap&& map) noexcept;
46 ~FutureMap(void);
47 private:
48 Internal::FutureMapImpl* impl;
49 protected:
50 // Only the runtime should be allowed to make these
51 FRIEND_ALL_RUNTIME_CLASSES
52 explicit FutureMap(Internal::FutureMapImpl* impl);
53 public:
54 inline bool exists(void) const { return (impl != nullptr); }
55 inline bool operator==(const FutureMap& f) const { return impl == f.impl; }
56 inline bool operator<(const FutureMap& f) const { return impl < f.impl; }
57 inline Future operator[](const DomainPoint& point) const
58 {
59 return get_future(point);
60 }
61 FutureMap& operator=(const FutureMap& f);
62 FutureMap& operator=(FutureMap&& f) noexcept;
63 std::size_t hash(void) const;
64 public:
73 template<typename T>
74 inline T get_result(
75 const DomainPoint& point, bool silence_warnings = false,
76 const char* warning_string = nullptr) const;
84 Future get_future(const DomainPoint& point) const;
93 const DomainPoint& point, bool silence_warnings = false,
94 const char* warning_string = nullptr) const;
95 public:
103 template<typename RT, typename PT, unsigned DIM>
104 inline RT get_result(const PT point[DIM]) const;
113 template<typename PT, unsigned DIM>
114 inline Future get_future(const PT point[DIM]) const;
120 template<typename PT, unsigned DIM>
121 inline void get_void_result(const PT point[DIM]) const;
122 public:
130 bool silence_warnings = false,
131 const char* warning_string = nullptr) const;
132 public:
139 };
140
141} // namespace Legion
142
143#include "legion/api/future_map.inl"
144
145#endif // __LEGION_FUTURE_MAP_H__
Definition geometry.h:159
Definition geometry.h:34
Definition future.h:50
Definition future_map.h:41
void wait_all_results(bool silence_warnings=false, const char *warning_string=nullptr) const
Domain get_future_map_domain(void) const
void get_void_result(const PT point[DIM]) const
T get_result(const DomainPoint &point, bool silence_warnings=false, const char *warning_string=nullptr) const
void get_void_result(const DomainPoint &point, bool silence_warnings=false, const char *warning_string=nullptr) const
Future get_future(const PT point[DIM]) const
Future get_future(const DomainPoint &point) const
RT get_result(const PT point[DIM]) const
Definition types.h:343
Definition accessors.h:29