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(
22 : const std::shared_ptr<HDCommunicate>& h2dTransfer, const std::shared_ptr<HDCommunicate>& d2hTransfer);
23 3 : ~HcclAicpuHdcHandler() = default;
24 :
25 : HcclResult GetKfcCommand(Hccl::KfcCommand& cmd);
26 : void SetKfcExecStatus(Hccl::KfcStatus state, Hccl::KfcErrType errorCode);
27 :
28 : private:
29 : std::shared_ptr<HDCommunicate> h2dTransfer_{nullptr};
30 : std::shared_ptr<HDCommunicate> d2hTransfer_{nullptr};
31 : Hccl::KfcCommand lastCmd_{Hccl::KfcCommand::NONE};
32 : };
33 :
34 : } // namespace hccl
35 :
36 : #endif // HCCL_AICPU_HDC_HANDLER_H
|