Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
image.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// image operations for Realm dependent partitioning
19
20#ifndef REALM_DEPPART_IMAGE_H
21#define REALM_DEPPART_IMAGE_H
22
25
26namespace Realm {
27
28 template <int N, typename T, int N2, typename T2>
30 public:
31 static const int DIM = N;
32 typedef T IDXTYPE;
33 static const int DIM2 = N2;
34 typedef T2 IDXTYPE2;
35
37 RegionInstance _inst, size_t _field_offset, bool _is_ranged);
38
39 virtual ~ImageMicroOp(void);
40
43 IndexSpace<N,T> _diff_rhs,
44 SparsityMap<N,T> _sparsity);
46
47 virtual void execute(void);
48
49 void dispatch(PartitioningOperation *op, bool inline_ok);
50
51 protected:
52 friend struct RemoteMicroOpMessage<ImageMicroOp<N,T,N2,T2> >;
54
55 friend class PartitioningMicroOp;
56 template <typename S>
57 REALM_ATTR_WARN_UNUSED(bool serialize_params(S& s) const);
58
59 // construct from received packet
60 template <typename S>
61 ImageMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S& s);
62
63 template <typename BM>
64 void populate_bitmasks_ptrs(std::map<int, BM *>& bitmasks);
65
66 template <typename BM>
67 void populate_bitmasks_ranges(std::map<int, BM *>& bitmasks);
68
69 template <typename BM>
71
72 template <typename BM>
74
80 std::vector<IndexSpace<N2,T2> > sources;
81 std::vector<IndexSpace<N,T> > diff_rhss;
82 std::vector<SparsityMap<N,T> > sparsity_outputs;
85 };
86
87 template <int N, typename T, int N2, typename T2>
89 public:
91 const DomainTransform<N, T, N2, T2>& _domain_transform,
92 const ProfilingRequestSet& reqs, GenEventImpl* _finish_event,
93 EventImpl::gen_t _finish_gen);
94
95 virtual ~ImageOperation(void);
96
99 const IndexSpace<N2, T2>& source, const IndexSpace<N, T>& diff_rhs);
100
101 virtual void execute(void);
102
103 virtual void print(std::ostream& os) const;
104
105 virtual void set_overlap_tester(void* tester);
106
107 protected:
110 std::vector<IndexSpace<N2, T2>> sources;
111 std::vector<IndexSpace<N, T>> diff_rhss;
112 std::vector<SparsityMap<N, T>> images;
113 };
114
115 template <int N, typename T, int N2, typename T2>
117 public:
119 const IndexSpace<N, T>& _parent,
120 const StructuredTransform<N, T, N2, T2>& _transform);
121
123 virtual void execute(void);
124
125 virtual void populate(std::map<int, HybridRectangleList<N, T>*>& bitmasks);
126
127 void dispatch(PartitioningOperation* op, bool inline_ok);
129 SparsityMap<N, T> _sparsity);
130
131 protected:
134 std::vector<IndexSpace<N2, T2>> sources;
135 std::vector<SparsityMap<N, T>> sparsity_outputs;
136 };
137
138 }; // namespace Realm
139
140#endif // REALM_DEPPART_IMAGE_H
Definition activemsg.h:303
Definition partitions.h:85
Definition indexspace.h:214
unsigned gen_t
Definition event_impl.h:87
Definition event_impl.h:198
Definition rectlist.h:70
Definition image.h:29
ImageMicroOp(IndexSpace< N, T > _parent_space, IndexSpace< N2, T2 > _inst_space, RegionInstance _inst, size_t _field_offset, bool _is_ranged)
T IDXTYPE
Definition image.h:32
std::vector< IndexSpace< N2, T2 > > sources
Definition image.h:80
intptr_t approx_output_op
Definition image.h:84
RegionInstance inst
Definition image.h:77
IndexSpace< N, T > parent_space
Definition image.h:75
void dispatch(PartitioningOperation *op, bool inline_ok)
REALM_ATTR_WARN_UNUSED(bool serialize_params(S &s) const)
static const int DIM2
Definition image.h:33
void add_sparsity_output(IndexSpace< N2, T2 > _source, SparsityMap< N, T > _sparsity)
std::vector< SparsityMap< N, T > > sparsity_outputs
Definition image.h:82
void add_approx_output(int index, PartitioningOperation *op)
void populate_bitmasks_ptrs(std::map< int, BM * > &bitmasks)
int approx_output_index
Definition image.h:83
void populate_bitmasks_ranges(std::map< int, BM * > &bitmasks)
void populate_approx_bitmask_ranges(BM &bitmask)
ImageMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S &s)
std::vector< IndexSpace< N, T > > diff_rhss
Definition image.h:81
void populate_approx_bitmask_ptrs(BM &bitmask)
void add_sparsity_output_with_difference(IndexSpace< N2, T2 > _source, IndexSpace< N, T > _diff_rhs, SparsityMap< N, T > _sparsity)
static ActiveMessageHandlerReg< RemoteMicroOpMessage< ImageMicroOp< N, T, N2, T2 > > > areg
Definition image.h:53
virtual void execute(void)
virtual ~ImageMicroOp(void)
T2 IDXTYPE2
Definition image.h:34
size_t field_offset
Definition image.h:78
IndexSpace< N2, T2 > inst_space
Definition image.h:76
static const int DIM
Definition image.h:31
bool is_ranged
Definition image.h:79
Definition image.h:88
std::vector< IndexSpace< N2, T2 > > sources
Definition image.h:110
virtual void set_overlap_tester(void *tester)
virtual ~ImageOperation(void)
IndexSpace< N, T > parent
Definition image.h:108
std::vector< IndexSpace< N, T > > diff_rhss
Definition image.h:111
ImageOperation(const IndexSpace< N, T > &_parent, const DomainTransform< N, T, N2, T2 > &_domain_transform, const ProfilingRequestSet &reqs, GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen)
std::vector< SparsityMap< N, T > > images
Definition image.h:112
IndexSpace< N, T > add_source_with_difference(const IndexSpace< N2, T2 > &source, const IndexSpace< N, T > &diff_rhs)
DomainTransform< N, T, N2, T2 > domain_transform
Definition image.h:109
virtual void print(std::ostream &os) const
IndexSpace< N, T > add_source(const IndexSpace< N2, T2 > &source)
virtual void execute(void)
Definition partitions.h:98
Definition partitions.h:153
Definition profiling.h:363
Definition instance.h:66
Definition sparsity.h:65
Definition image.h:116
StructuredImageMicroOp(const IndexSpace< N, T > &_parent, const StructuredTransform< N, T, N2, T2 > &_transform)
virtual void execute(void)
void dispatch(PartitioningOperation *op, bool inline_ok)
std::vector< IndexSpace< N2, T2 > > sources
Definition image.h:134
virtual ~StructuredImageMicroOp(void)
virtual void populate(std::map< int, HybridRectangleList< N, T > * > &bitmasks)
StructuredTransform< N, T, N2, T2 > transform
Definition image.h:133
void add_sparsity_output(IndexSpace< N2, T2 > _source, SparsityMap< N, T > _sparsity)
IndexSpace< N, T > parent_space
Definition image.h:132
std::vector< SparsityMap< N, T > > sparsity_outputs
Definition image.h:135
Definition indexspace.h:176
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition indexspace.h:323
Definition partitions.h:230