/home/runner/work/HiCR/HiCR/include/hicr/backends/boost/executionUnit.hpp Source File

HiCR: /home/runner/work/HiCR/HiCR/include/hicr/backends/boost/executionUnit.hpp Source File
HiCR
executionUnit.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
26#include <hicr/core/definitions.hpp>
28#include <utility>
29#include "coroutine.hpp"
30
31namespace HiCR::backend::boost
32{
33
38{
39 public:
40
47 : HiCR::ExecutionUnit(),
48 _fc(std::move(fc)){};
49 ExecutionUnit() = delete;
50
54 ~ExecutionUnit() override = default;
55
56 [[nodiscard]] __INLINE__ std::string getType() const override { return "Boost C++ Coroutine Function"; }
57
63 [[nodiscard]] __INLINE__ const Coroutine::coroutineFc_t &getFunction() const { return _fc; }
64
65 private:
66
71};
72
73} // namespace HiCR::backend::boost
Definition executionUnit.hpp:37
std::function< void(void *)> coroutineFc_t
Definition coroutine.hpp:49
Definition executionUnit.hpp:38
__INLINE__ const Coroutine::coroutineFc_t & getFunction() const
Definition executionUnit.hpp:63
__INLINE__ std::string getType() const override
Definition executionUnit.hpp:56
ExecutionUnit(Coroutine::coroutineFc_t fc)
Definition executionUnit.hpp:46
Provides a base definition for a HiCR Execution Unit class.
Provides a definition for the Coroutine class, implemented with Boost context objects.