/home/runner/work/HiCR/HiCR/include/hicr/backends/lpf/globalMemorySlot.hpp Source File

HiCR: /home/runner/work/HiCR/HiCR/include/hicr/backends/lpf/globalMemorySlot.hpp Source File
HiCR
globalMemorySlot.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2025 Huawei Technologies Co., Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
23#pragma once
24
25#include <lpf/core.h>
28#include <utility>
29
30namespace HiCR::backend::lpf
31{
32
37{
38 public:
39
49 GlobalMemorySlot(lpf_pid_t rank,
50 lpf_memslot_t lpfMemSlot,
51 lpf_memslot_t lpfSwapSlot,
52 const HiCR::GlobalMemorySlot::tag_t globalTag = 0,
53 const HiCR::GlobalMemorySlot::globalKey_t globalKey = 0,
54 std::shared_ptr<HiCR::LocalMemorySlot> sourceLocalMemorySlot = nullptr)
55 : HiCR::GlobalMemorySlot(globalTag, globalKey, std::move(sourceLocalMemorySlot)),
56 _rank(rank),
57 _lpfMemSlot(lpfMemSlot),
58 _lpfSwapSlot(lpfSwapSlot)
59 {}
60
64 ~GlobalMemorySlot() override = default;
65
71 const lpf_pid_t getRank() { return _rank; }
72
77 [[nodiscard]] lpf_memslot_t getLPFSlot() const { return _lpfMemSlot; }
78
84 [[nodiscard]] lpf_memslot_t getLPFSwapSlot() const { return _lpfSwapSlot; }
85
86 private:
87
91 lpf_pid_t _rank;
92
96 const lpf_memslot_t _lpfMemSlot;
97
102 const lpf_memslot_t _lpfSwapSlot;
103};
104
105} // namespace HiCR::backend::lpf
Definition globalMemorySlot.hpp:38
uint64_t tag_t
Definition globalMemorySlot.hpp:49
uint64_t globalKey_t
Definition globalMemorySlot.hpp:44
Definition globalMemorySlot.hpp:37
lpf_memslot_t getLPFSlot() const
Definition globalMemorySlot.hpp:77
const lpf_pid_t getRank()
Definition globalMemorySlot.hpp:71
GlobalMemorySlot(lpf_pid_t rank, lpf_memslot_t lpfMemSlot, lpf_memslot_t lpfSwapSlot, const HiCR::GlobalMemorySlot::tag_t globalTag=0, const HiCR::GlobalMemorySlot::globalKey_t globalKey=0, std::shared_ptr< HiCR::LocalMemorySlot > sourceLocalMemorySlot=nullptr)
Definition globalMemorySlot.hpp:49
lpf_memslot_t getLPFSwapSlot() const
Definition globalMemorySlot.hpp:84
Provides a definition for a HiCR Global Memory Slot class.
Provides a definition for a HiCR Local Memory Slot class.