Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
setops.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// set operations for Realm dependent partitioning
19
20#ifndef REALM_DEPPART_SETOPS_H
21#define REALM_DEPPART_SETOPS_H
22
24
25namespace Realm {
26
27 template <int N, typename T>
29 public:
30 static const int DIM = N;
31 typedef T IDXTYPE;
32
33 UnionMicroOp(const std::vector<IndexSpace<N,T> >& _inputs);
35 virtual ~UnionMicroOp(void);
36
38
39 virtual void execute(void);
40
41 void dispatch(PartitioningOperation *op, bool inline_ok);
42
43 protected:
44 friend struct RemoteMicroOpMessage<UnionMicroOp<N,T> >;
46
47 friend class PartitioningMicroOp;
48 template <typename S>
49 REALM_ATTR_WARN_UNUSED(bool serialize_params(S& s) const);
50
51 // construct from received packet
52 template <typename S>
53 UnionMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S& s);
54
55 template <typename BM>
56 void populate_bitmask(BM& bitmask);
57
58 std::vector<IndexSpace<N,T> > inputs;
60 };
61
62 template <int N, typename T>
64 public:
65 static const int DIM = N;
66 typedef T IDXTYPE;
67
68 IntersectionMicroOp(const std::vector<IndexSpace<N,T> >& _inputs);
70 virtual ~IntersectionMicroOp(void);
71
73
74 virtual void execute(void);
75
76 void dispatch(PartitioningOperation *op, bool inline_ok);
77
78 protected:
79 friend struct RemoteMicroOpMessage<IntersectionMicroOp<N,T> >;
81
82 friend class PartitioningMicroOp;
83 template <typename S>
84 REALM_ATTR_WARN_UNUSED(bool serialize_params(S& s) const);
85
86 // construct from received packet
87 template <typename S>
88 IntersectionMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S& s);
89
90 template <typename BM>
91 void populate_bitmask(BM& bitmask);
92
93 std::vector<IndexSpace<N,T> > inputs;
95 };
96
97 template <int N, typename T>
99 public:
100 static const int DIM = N;
101 typedef T IDXTYPE;
102
104 virtual ~DifferenceMicroOp(void);
105
107
108 virtual void execute(void);
109
110 void dispatch(PartitioningOperation *op, bool inline_ok);
111
112 protected:
113 friend struct RemoteMicroOpMessage<DifferenceMicroOp<N,T> >;
115
117 template <typename S>
118 REALM_ATTR_WARN_UNUSED(bool serialize_params(S& s) const);
119
120 // construct from received packet
121 template <typename S>
122 DifferenceMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S& s);
123
124 template <typename BM>
125 void populate_bitmask(BM& bitmask);
126
129 };
130
131 template <int N, typename T>
133 public:
135 GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen);
136
137 virtual ~UnionOperation(void);
138
140 IndexSpace<N,T> add_union(const std::vector<IndexSpace<N,T> >& ops);
141
142 virtual void execute(void);
143
144 virtual void print(std::ostream& os) const;
145
146 protected:
147 std::vector<std::vector<IndexSpace<N,T> > > inputs;
148 std::vector<SparsityMap<N,T> > outputs;
149 };
150
151 template <int N, typename T>
153 public:
155 GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen);
156
158
161
162 virtual void execute(void);
163
164 virtual void print(std::ostream& os) const;
165
166 protected:
167 std::vector<std::vector<IndexSpace<N,T> > > inputs;
168 std::vector<SparsityMap<N,T> > outputs;
169 };
170
171 template <int N, typename T>
173 public:
175 GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen);
176
177 virtual ~DifferenceOperation(void);
178
180
181 virtual void execute(void);
182
183 virtual void print(std::ostream& os) const;
184
185 protected:
186 std::vector<IndexSpace<N,T> > lhss, rhss;
187 std::vector<SparsityMap<N,T> > outputs;
188 };
189
190};
191
192#endif // REALM_DEPPART_SETOPS_H
Definition activemsg.h:303
Definition partitions.h:85
Definition setops.h:98
void add_sparsity_output(SparsityMap< N, T > _sparsity)
void dispatch(PartitioningOperation *op, bool inline_ok)
static const int DIM
Definition setops.h:100
IndexSpace< N, T > lhs
Definition setops.h:127
static ActiveMessageHandlerReg< RemoteMicroOpMessage< DifferenceMicroOp< N, T > > > areg
Definition setops.h:114
T IDXTYPE
Definition setops.h:101
IndexSpace< N, T > rhs
Definition setops.h:127
virtual void execute(void)
DifferenceMicroOp(IndexSpace< N, T > _lhs, IndexSpace< N, T > _rhs)
virtual ~DifferenceMicroOp(void)
void populate_bitmask(BM &bitmask)
REALM_ATTR_WARN_UNUSED(bool serialize_params(S &s) const)
SparsityMap< N, T > sparsity_output
Definition setops.h:128
DifferenceMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S &s)
Definition setops.h:172
std::vector< IndexSpace< N, T > > rhss
Definition setops.h:186
virtual void print(std::ostream &os) const
virtual ~DifferenceOperation(void)
IndexSpace< N, T > add_difference(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs)
DifferenceOperation(const ProfilingRequestSet &reqs, GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen)
std::vector< SparsityMap< N, T > > outputs
Definition setops.h:187
std::vector< IndexSpace< N, T > > lhss
Definition setops.h:186
virtual void execute(void)
unsigned gen_t
Definition event_impl.h:87
Definition event_impl.h:198
Definition setops.h:63
IntersectionMicroOp(IndexSpace< N, T > _lhs, IndexSpace< N, T > _rhs)
virtual ~IntersectionMicroOp(void)
IntersectionMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S &s)
static ActiveMessageHandlerReg< RemoteMicroOpMessage< IntersectionMicroOp< N, T > > > areg
Definition setops.h:80
SparsityMap< N, T > sparsity_output
Definition setops.h:94
virtual void execute(void)
static const int DIM
Definition setops.h:65
std::vector< IndexSpace< N, T > > inputs
Definition setops.h:93
IntersectionMicroOp(const std::vector< IndexSpace< N, T > > &_inputs)
void populate_bitmask(BM &bitmask)
void add_sparsity_output(SparsityMap< N, T > _sparsity)
REALM_ATTR_WARN_UNUSED(bool serialize_params(S &s) const)
T IDXTYPE
Definition setops.h:66
void dispatch(PartitioningOperation *op, bool inline_ok)
Definition setops.h:152
std::vector< SparsityMap< N, T > > outputs
Definition setops.h:168
virtual void execute(void)
virtual void print(std::ostream &os) const
IndexSpace< N, T > add_intersection(const std::vector< IndexSpace< N, T > > &ops)
virtual ~IntersectionOperation(void)
IntersectionOperation(const ProfilingRequestSet &reqs, GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen)
IndexSpace< N, T > add_intersection(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs)
std::vector< std::vector< IndexSpace< N, T > > > inputs
Definition setops.h:167
Definition partitions.h:98
Definition partitions.h:153
Definition profiling.h:363
Definition sparsity.h:65
Definition setops.h:28
REALM_ATTR_WARN_UNUSED(bool serialize_params(S &s) const)
static ActiveMessageHandlerReg< RemoteMicroOpMessage< UnionMicroOp< N, T > > > areg
Definition setops.h:45
std::vector< IndexSpace< N, T > > inputs
Definition setops.h:58
T IDXTYPE
Definition setops.h:31
static const int DIM
Definition setops.h:30
UnionMicroOp(const std::vector< IndexSpace< N, T > > &_inputs)
void add_sparsity_output(SparsityMap< N, T > _sparsity)
void dispatch(PartitioningOperation *op, bool inline_ok)
UnionMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S &s)
virtual ~UnionMicroOp(void)
UnionMicroOp(IndexSpace< N, T > _lhs, IndexSpace< N, T > _rhs)
virtual void execute(void)
SparsityMap< N, T > sparsity_output
Definition setops.h:59
void populate_bitmask(BM &bitmask)
Definition setops.h:132
UnionOperation(const ProfilingRequestSet &reqs, GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen)
virtual void print(std::ostream &os) const
virtual void execute(void)
virtual ~UnionOperation(void)
std::vector< SparsityMap< N, T > > outputs
Definition setops.h:148
IndexSpace< N, T > add_union(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs)
IndexSpace< N, T > add_union(const std::vector< IndexSpace< N, T > > &ops)
std::vector< std::vector< IndexSpace< N, T > > > inputs
Definition setops.h:147
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition indexspace.h:323
Definition partitions.h:230