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_REGISTERED_CTX_MGR_H
12 : #define CCU_REGISTERED_CTX_MGR_H
13 :
14 : #include <memory>
15 : #include <unordered_map>
16 : #include "ccu_ctx_mgr.h"
17 :
18 : namespace Hccl {
19 :
20 : class RegisteredCcuCtxMgr {
21 : public:
22 265 : explicit RegisteredCcuCtxMgr(DevId devLogicId) : devLogicId(devLogicId) {}
23 :
24 : bool HasRegistered(const CcuCtxSignature& ctxSignature, const uintptr_t& resPackId, u64& execId);
25 :
26 : u64 Register(
27 : std::unique_ptr<CcuCtxGroup> ccuCtxGroupPtr, const CcuCtxSignature& ctxSignature, const uintptr_t& resPackId,
28 : bool isFuncBlock);
29 :
30 : ~RegisteredCcuCtxMgr();
31 :
32 : private:
33 : DevId devLogicId;
34 : unordered_map<CcuCtxSignature, unordered_map<uintptr_t, u64>> registeredIds;
35 : };
36 :
37 : } // namespace Hccl
38 :
39 : #endif // CCU_REGISTERED_CTX_MGR_H
|