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_H
12 : #define CCU_WQEBB_MGR_H
13 :
14 : #include "ccu_dev_mgr_imp.h"
15 :
16 : namespace hcomm {
17 :
18 : struct WqeBBReq {
19 : uint32_t sqSize{0};
20 : uint32_t jettyCtxStartId{0};
21 : };
22 :
23 : class CcuWqeBBMgr {
24 : public:
25 231 : CcuWqeBBMgr(const int32_t devLogicId, const uint8_t dieId) : devLogicId_(devLogicId), dieId_(dieId) {};
26 : CcuWqeBBMgr() = default;
27 231 : virtual ~CcuWqeBBMgr() = default;
28 :
29 : virtual HcclResult Init() = 0;
30 : virtual HcclResult Alloc(const WqeBBReq& allocCfg, ResInfo& wqeBBInfo) = 0;
31 : virtual HcclResult Release(const ResInfo& wqeBBInfo) = 0;
32 :
33 : protected:
34 : int32_t devLogicId_{0};
35 : uint8_t dieId_{0};
36 : };
37 :
38 : } // namespace hcomm
39 :
40 : #endif // CCU_WQEBB_MGR_H
|