Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
transfer_utils.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#ifndef REALM_TRANSFER_UTILS_H
19#define REALM_TRANSFER_UTILS_H
20
21#include "realm/point.h"
22#include "realm/inst_layout.h"
23#include <unordered_map>
24
25namespace Realm {
26 // finds the largest subrectangle of 'domain' that starts with 'start',
27 // lies entirely within 'restriction', and is consistent with an iteration
28 // order (over the original 'domain') of 'dim_order'
29 // the subrectangle is returned in 'subrect', the start of the next subrect
30 // is in 'next_start', and the return value indicates whether the 'domain'
31 // has been fully covered
32 template <int N, typename T>
33 bool next_subrect(const Rect<N, T> &domain, const Point<N, T> &start,
34 const Rect<N, T> &restriction, const int *dim_order,
35 Rect<N, T> &subrect, Point<N, T> &next_start);
36
48 template <int N, typename T>
49 bool compute_target_subrect(const Rect<N, T> &layout_bounds, const Rect<N, T> &cur_rect,
50 Point<N, T> &cur_point, Rect<N, T> &target_subrect,
51 const int *dim_order);
52
72 template <int N, typename T>
73 inline int
75 const int dim_order[N], size_t field_size, size_t &total_bytes,
76 size_t &contig_bytes,
77 std::unordered_map<int, std::pair<size_t, size_t>> &count_strides);
78
79} // namespace Realm
80
81#include "realm/transfer/transfer_utils.inl"
82
83#endif
Definition inst_layout.h:316
Definition activemsg.h:38
bool compute_target_subrect(const Rect< N, T > &layout_bounds, const Rect< N, T > &cur_rect, Point< N, T > &cur_point, Rect< N, T > &target_subrect, const int *dim_order)
int compact_affine_dims(const AffineLayoutPiece< N, T > *affine, const Rect< N, T > &subrect, const int dim_order[N], size_t field_size, size_t &total_bytes, size_t &contig_bytes, std::unordered_map< int, std::pair< size_t, size_t > > &count_strides)
Computes compact affine addressing information for a subrectangle.
bool next_subrect(const Rect< N, T > &domain, const Point< N, T > &start, const Rect< N, T > &restriction, const int *dim_order, Rect< N, T > &subrect, Point< N, T > &next_start)
Definition point.h:55
Definition point.h:143