Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #ifndef CCU_WQEBB_MGR_V1_H
12 : #define CCU_WQEBB_MGR_V1_H
13 :
14 : #include "ccu_wqebb_mgr.h"
15 :
16 : #include <memory>
17 :
18 : #include "ccu_res_allocator.h"
19 :
20 :
21 : namespace hcomm {
22 :
23 : class CcuWqeBBMgrV1 : public CcuWqeBBMgr {
24 : public:
25 60 : CcuWqeBBMgrV1(const int32_t devLogicId, const uint8_t dieId)
26 60 : : CcuWqeBBMgr(devLogicId, dieId) {}
27 : CcuWqeBBMgrV1() = default;
28 120 : ~CcuWqeBBMgrV1() override final = default;
29 :
30 : HcclResult Init() override final;
31 : HcclResult Alloc(const WqeBBReq& wqeBBReq, ResInfo &wqeBBInfo) override final;
32 : HcclResult Release(const ResInfo &wqeBBInfo) override final;
33 :
34 : private:
35 : std::unique_ptr<CcuResIdAllocator> idAllocator_{nullptr};
36 : };
37 :
38 : }; // namespace hcomm
39 :
40 : #endif
|