Line data Source code
1 : /**
2 : * Copyright (c) 2026 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_AICPU_HDC_HANDLER_H
12 : #define HCCL_AICPU_HDC_HANDLER_H
13 :
14 : #include "hdc_pub.h"
15 : #include "kfc.h"
16 :
17 : namespace hccl {
18 :
19 : class HcclAicpuHdcHandler {
20 : public:
21 : HcclAicpuHdcHandler(const std::shared_ptr<HDCommunicate> &h2dTransfer, const std::shared_ptr<HDCommunicate> &d2hTransfer);
22 2 : ~HcclAicpuHdcHandler() = default;
23 :
24 : HcclResult GetKfcCommand(Hccl::KfcCommand &cmd);
25 : void SetKfcExecStatus(Hccl::KfcStatus state, Hccl::KfcErrType errorCode);
26 :
27 : private:
28 : std::shared_ptr<HDCommunicate> h2dTransfer_{nullptr};
29 : std::shared_ptr<HDCommunicate> d2hTransfer_{nullptr};
30 : Hccl::KfcCommand lastCmd_{Hccl::KfcCommand::NONE};
31 : };
32 :
33 : }
34 :
35 : #endif // HCCL_AICPU_HDC_HANDLER_H
|