Legion Runtime
Loading...
Searching...
No Matches
future_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_FUTURE_MAP_H__
17#define __LEGION_FUTURE_MAP_H__
18
19#include "legion/api/future.h"
20
21namespace Legion {
22
36 class FutureMap : public Unserializable {
37 public:
38 FutureMap(void);
39 FutureMap(const FutureMap& map);
40 FutureMap(FutureMap&& map) noexcept;
41 ~FutureMap(void);
42 private:
43 Internal::FutureMapImpl* impl;
44 protected:
45 // Only the runtime should be allowed to make these
46 FRIEND_ALL_RUNTIME_CLASSES
47 explicit FutureMap(Internal::FutureMapImpl* impl);
48 public:
49 inline bool exists(void) const { return (impl != nullptr); }
50 inline bool operator==(const FutureMap& f) const { return impl == f.impl; }
51 inline bool operator<(const FutureMap& f) const { return impl < f.impl; }
52 inline Future operator[](const DomainPoint& point) const
53 {
54 return get_future(point);
55 }
56 FutureMap& operator=(const FutureMap& f);
57 FutureMap& operator=(FutureMap&& f) noexcept;
58 std::size_t hash(void) const;
59 public:
68 template<typename T>
69 inline T get_result(
70 const DomainPoint& point, bool silence_warnings = false,
71 const char* warning_string = nullptr) const;
79 Future get_future(const DomainPoint& point) const;
88 const DomainPoint& point, bool silence_warnings = false,
89 const char* warning_string = nullptr) const;
90 public:
98 template<typename RT, typename PT, unsigned DIM>
99 inline RT get_result(const PT point[DIM]) const;
108 template<typename PT, unsigned DIM>
109 inline Future get_future(const PT point[DIM]) const;
115 template<typename PT, unsigned DIM>
116 inline void get_void_result(const PT point[DIM]) const;
117 public:
125 bool silence_warnings = false,
126 const char* warning_string = nullptr) const;
127 public:
134 };
135
136} // namespace Legion
137
138#include "legion/api/future_map.inl"
139
140#endif // __LEGION_FUTURE_MAP_H__
Definition geometry.h:154
Definition geometry.h:29
Definition future.h:45
Definition future_map.h:36
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:334