/home/runner/work/HiCR/HiCR/include/hicr/frontends/channel/variableSize/mpsc/nonlocking/producer.hpp Source File

HiCR: /home/runner/work/HiCR/HiCR/include/hicr/frontends/channel/variableSize/mpsc/nonlocking/producer.hpp Source File
HiCR
producer.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
24#pragma once
25
27#include <utility>
28
29namespace HiCR::channel::variableSize::MPSC::nonlocking
30{
31
39{
40 public:
41
62 Producer(CommunicationManager &communicationManager,
63 std::shared_ptr<LocalMemorySlot> sizeInfoBuffer,
64 std::shared_ptr<GlobalMemorySlot> payloadBuffer,
65 std::shared_ptr<GlobalMemorySlot> tokenBuffer,
66 const std::shared_ptr<LocalMemorySlot> &internalCoordinationBufferForCounts,
67 const std::shared_ptr<LocalMemorySlot> &internalCoordinationBufferForPayloads,
68 std::shared_ptr<GlobalMemorySlot> consumerCoordinationBufferForCounts,
69 std::shared_ptr<GlobalMemorySlot> consumerCoordinationBufferForPayloads,
70 const size_t payloadCapacity,
71 const size_t payloadSize,
72 const size_t capacity)
73 : variableSize::SPSC::Producer(communicationManager,
74 std::move(sizeInfoBuffer),
75 std::move(payloadBuffer),
76 std::move(tokenBuffer),
77 internalCoordinationBufferForCounts,
78 internalCoordinationBufferForPayloads,
79 std::move(consumerCoordinationBufferForCounts),
80 std::move(consumerCoordinationBufferForPayloads),
81 payloadCapacity,
82 payloadSize,
83 capacity)
84 {}
85 ~Producer() = default;
86};
87
88} // namespace HiCR::channel::variableSize::MPSC::nonlocking
Definition communicationManager.hpp:54
Producer(CommunicationManager &communicationManager, std::shared_ptr< LocalMemorySlot > sizeInfoBuffer, std::shared_ptr< GlobalMemorySlot > payloadBuffer, std::shared_ptr< GlobalMemorySlot > tokenBuffer, const std::shared_ptr< LocalMemorySlot > &internalCoordinationBufferForCounts, const std::shared_ptr< LocalMemorySlot > &internalCoordinationBufferForPayloads, std::shared_ptr< GlobalMemorySlot > consumerCoordinationBufferForCounts, std::shared_ptr< GlobalMemorySlot > consumerCoordinationBufferForPayloads, const size_t payloadCapacity, const size_t payloadSize, const size_t capacity)
Definition producer.hpp:62
Provides functionality for a var-size SPSC producer channel.