Legion Runtime
Loading...
Searching...
No Matches
interop.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_INTEROP_H__
17#define __LEGION_INTEROP_H__
18
24#include "legion/api/types.h"
25
26namespace Legion {
27
39 public:
40 LegionHandshake(void);
42 ~LegionHandshake(void);
43 protected:
44 Internal::LegionHandshakeImpl* impl;
45 protected:
46 // Only the runtime should be able to make these
47 FRIEND_ALL_RUNTIME_CLASSES
48 explicit LegionHandshake(Internal::LegionHandshakeImpl* impl);
49 public:
50 bool operator==(const LegionHandshake& h) const { return impl == h.impl; }
51 bool operator<(const LegionHandshake& h) const { return impl < h.impl; }
52 LegionHandshake& operator=(const LegionHandshake& rhs);
53 public:
58 void ext_handoff_to_legion(void) const;
64 void ext_wait_on_legion(void) const;
65 public:
70 void legion_handoff_to_ext(void) const;
75 void legion_wait_on_ext(void) const;
76 public:
77 /*
78 * For asynchronous Legion execution, you can use these
79 * methods to get a phase barrier associated with the
80 * handshake object instead of blocking on the legion side
81 */
93 void advance_legion_handshake(void) const;
94 };
95
102 public:
103 MPILegionHandshake(void);
106 protected:
107 // Only the runtime should be able to make these
108 FRIEND_ALL_RUNTIME_CLASSES
109 explicit MPILegionHandshake(Internal::LegionHandshakeImpl* impl);
110 public:
111 bool operator==(const MPILegionHandshake& h) const
112 {
113 return impl == h.impl;
114 }
115 bool operator<(const MPILegionHandshake& h) const { return impl < h.impl; }
116 MPILegionHandshake& operator=(const MPILegionHandshake& rhs);
117 public:
122 inline void mpi_handoff_to_legion(void) const { ext_handoff_to_legion(); }
127 inline void mpi_wait_on_legion(void) const { ext_wait_on_legion(); }
128 public:
133 inline void legion_handoff_to_mpi(void) const { legion_handoff_to_ext(); }
138 inline void legion_wait_on_mpi(void) const { legion_wait_on_ext(); }
139 };
140
141} // namespace Legion
142
143#endif // __LEGION_INTEROP_H__
Definition interop.h:38
void legion_handoff_to_ext(void) const
PhaseBarrier get_legion_wait_phase_barrier(void) const
PhaseBarrier get_legion_arrive_phase_barrier(void) const
void ext_handoff_to_legion(void) const
void legion_wait_on_ext(void) const
void ext_wait_on_legion(void) const
void advance_legion_handshake(void) const
Definition interop.h:101
void legion_handoff_to_mpi(void) const
Definition interop.h:133
void mpi_handoff_to_legion(void) const
Definition interop.h:122
void legion_wait_on_mpi(void) const
Definition interop.h:138
void mpi_wait_on_legion(void) const
Definition interop.h:127
Definition sync.h:147
Definition types.h:343
Definition accessors.h:29