Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
cuda_reduc.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 CUDA_REDUC_H
19#define CUDA_REDUC_H
20
21#include <cstddef>
22#include <cstdint>
23
24namespace Realm {
25 namespace Cuda {
26 template <typename Offset_t>
27 struct MemReducInfo {
28 Offset_t extents[3];
29 Offset_t src_strides[2];
30 Offset_t dst_strides[2];
31 uintptr_t dst;
32 uintptr_t src;
33 size_t volume;
34 size_t elem_size;
35 };
36
37 template <size_t N>
39 // Extent of the ND array
40 size_t strides[N - 1];
41 size_t elem_size;
42 // Address of the ND array
43 uintptr_t addr;
44 };
45
46 template <size_t N>
50 // Extent of the ND sub-rect
51 size_t extents[N];
52 // Product of the extents for fast lookup, which is the same across
53 // the pair
54 size_t volume;
55 };
56 // TODO: batch mode, MAX_RECTS > 1
57 template <size_t N, size_t MAX_RECTS = 1>
59 enum
60 {
61 MAX_NUM_RECTS = MAX_RECTS,
62 DIM = N
63 };
65 unsigned short num_rects;
66 };
67 } // namespace Cuda
68} // namespace Realm
69#endif
Definition activemsg.h:38
Definition cuda_reduc.h:58
AffineReducPair< N > subrects[MAX_RECTS]
Definition cuda_reduc.h:64
unsigned short num_rects
Definition cuda_reduc.h:65
@ DIM
Definition cuda_reduc.h:62
@ MAX_NUM_RECTS
Definition cuda_reduc.h:61
Definition cuda_reduc.h:47
size_t volume
Definition cuda_reduc.h:54
size_t extents[N]
Definition cuda_reduc.h:51
AffineReducSubRect< N > dst
Definition cuda_reduc.h:49
AffineReducSubRect< N > src
Definition cuda_reduc.h:48
Definition cuda_reduc.h:38
size_t strides[N - 1]
Definition cuda_reduc.h:40
uintptr_t addr
Definition cuda_reduc.h:43
size_t elem_size
Definition cuda_reduc.h:41
Definition cuda_reduc.h:27
size_t elem_size
Definition cuda_reduc.h:34
Offset_t dst_strides[2]
Definition cuda_reduc.h:30
uintptr_t dst
Definition cuda_reduc.h:31
size_t volume
Definition cuda_reduc.h:33
Offset_t extents[3]
Definition cuda_reduc.h:28
Offset_t src_strides[2]
Definition cuda_reduc.h:29
uintptr_t src
Definition cuda_reduc.h:32