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 HCCL_CCU_WQEBB_MGR_H
12 : #define HCCL_CCU_WQEBB_MGR_H
13 :
14 : #include <memory>
15 :
16 : #include "ccu_res_allocator_legacy.h"
17 : #include "ccu_device_manager.h"
18 :
19 : namespace Hccl {
20 :
21 : class CcuWqeBBMgr {
22 : public:
23 : CcuWqeBBMgr(const int32_t devLogicId, const uint8_t dieId);
24 : CcuWqeBBMgr() = default;
25 24 : ~CcuWqeBBMgr() = default;
26 :
27 : HcclResult Alloc(const uint32_t sqSize, ResInfo& wqeBBInfo);
28 : HcclResult Release(const ResInfo& wqeBBInfo);
29 :
30 : private:
31 : int32_t devLogicId{0};
32 : uint8_t dieId{0};
33 :
34 : std::unique_ptr<CcuResIdAllocator> idAllocator{nullptr};
35 : };
36 :
37 : }; // namespace Hccl
38 :
39 : #endif
|