Legion Runtime
Loading...
Searching...
No Matches
interop.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_INTEROP_H__
17#define __LEGION_INTEROP_H__
18
19#include "legion/api/types.h"
20
21namespace Legion {
22
34 public:
35 LegionHandshake(void);
37 ~LegionHandshake(void);
38 protected:
39 Internal::LegionHandshakeImpl* impl;
40 protected:
41 // Only the runtime should be able to make these
42 FRIEND_ALL_RUNTIME_CLASSES
43 explicit LegionHandshake(Internal::LegionHandshakeImpl* impl);
44 public:
45 bool operator==(const LegionHandshake& h) const { return impl == h.impl; }
46 bool operator<(const LegionHandshake& h) const { return impl < h.impl; }
47 LegionHandshake& operator=(const LegionHandshake& rhs);
48 public:
53 void ext_handoff_to_legion(void) const;
59 void ext_wait_on_legion(void) const;
60 public:
65 void legion_handoff_to_ext(void) const;
70 void legion_wait_on_ext(void) const;
71 public:
72 /*
73 * For asynchronous Legion execution, you can use these
74 * methods to get a phase barrier associated with the
75 * handshake object instead of blocking on the legion side
76 */
88 void advance_legion_handshake(void) const;
89 };
90
97 public:
101 protected:
102 // Only the runtime should be able to make these
103 FRIEND_ALL_RUNTIME_CLASSES
104 explicit MPILegionHandshake(Internal::LegionHandshakeImpl* impl);
105 public:
106 bool operator==(const MPILegionHandshake& h) const
107 {
108 return impl == h.impl;
109 }
110 bool operator<(const MPILegionHandshake& h) const { return impl < h.impl; }
111 MPILegionHandshake& operator=(const MPILegionHandshake& rhs);
112 public:
117 inline void mpi_handoff_to_legion(void) const { ext_handoff_to_legion(); }
122 inline void mpi_wait_on_legion(void) const { ext_wait_on_legion(); }
123 public:
128 inline void legion_handoff_to_mpi(void) const { legion_handoff_to_ext(); }
133 inline void legion_wait_on_mpi(void) const { legion_wait_on_ext(); }
134 };
135
136} // namespace Legion
137
138#endif // __LEGION_INTEROP_H__
Definition interop.h:33
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:96
void legion_handoff_to_mpi(void) const
Definition interop.h:128
void mpi_handoff_to_legion(void) const
Definition interop.h:117
void legion_wait_on_mpi(void) const
Definition interop.h:133
void mpi_wait_on_legion(void) const
Definition interop.h:122
Definition sync.h:142
Definition types.h:334