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

HiCR: /home/runner/work/HiCR/HiCR/include/hicr/core/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 <hicr/core/definitions.hpp>
27#include <utility>
28
29namespace HiCR
30{
31
38{
39 public:
40
44 using globalKey_t = uint64_t;
45
49 using tag_t = uint64_t;
50
59 GlobalMemorySlot(const tag_t globalTag = 0, const globalKey_t globalKey = 0, std::shared_ptr<HiCR::LocalMemorySlot> sourceLocalMemorySlot = nullptr)
60 : _globalTag(globalTag),
61 _globalKey(globalKey),
62 _sourceLocalMemorySlot(std::move(sourceLocalMemorySlot))
63 {}
64
68 virtual ~GlobalMemorySlot() = default;
69
74 [[nodiscard]] __INLINE__ tag_t getGlobalTag() const noexcept { return _globalTag; }
75
80 [[nodiscard]] __INLINE__ globalKey_t getGlobalKey() const noexcept { return _globalKey; }
81
87 __INLINE__ std::shared_ptr<HiCR::LocalMemorySlot> getSourceLocalMemorySlot() noexcept { return _sourceLocalMemorySlot; }
88
89 private:
90
94 const tag_t _globalTag;
95
99 const globalKey_t _globalKey;
100
104 std::shared_ptr<HiCR::LocalMemorySlot> const _sourceLocalMemorySlot = nullptr;
105};
106
107} // namespace HiCR
Definition globalMemorySlot.hpp:38
GlobalMemorySlot(const tag_t globalTag=0, const globalKey_t globalKey=0, std::shared_ptr< HiCR::LocalMemorySlot > sourceLocalMemorySlot=nullptr)
Definition globalMemorySlot.hpp:59
__INLINE__ std::shared_ptr< HiCR::LocalMemorySlot > getSourceLocalMemorySlot() noexcept
Definition globalMemorySlot.hpp:87
__INLINE__ globalKey_t getGlobalKey() const noexcept
Definition globalMemorySlot.hpp:80
__INLINE__ tag_t getGlobalTag() const noexcept
Definition globalMemorySlot.hpp:74
uint64_t tag_t
Definition globalMemorySlot.hpp:49
virtual ~GlobalMemorySlot()=default
uint64_t globalKey_t
Definition globalMemorySlot.hpp:44
Provides a definition for a HiCR Local Memory Slot class.