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 : #include "hcclCommOp.h"
12 :
13 : namespace hccl {
14 :
15 0 : std::shared_ptr<Hccl::DfxOpInfo> ConvertToDfxOpInfo(const HcclDfxOpInfo& dfxOpInfo)
16 : {
17 0 : auto dfxOpInfoOnce = std::make_shared<Hccl::DfxOpInfo>();
18 0 : dfxOpInfoOnce->op_.opMode = static_cast<Hccl::OpMode::Value>(dfxOpInfo.opMode);
19 0 : dfxOpInfoOnce->op_.oldOpType = dfxOpInfo.opType; // 存A3的类型
20 0 : dfxOpInfoOnce->op_.oldReduceOp = dfxOpInfo.reduceOp; // 存A3的类型
21 0 : dfxOpInfoOnce->op_.oldDataType = dfxOpInfo.dataType; // 存A3的类型
22 :
23 0 : dfxOpInfoOnce->op_.dataCount = dfxOpInfo.dataCount;
24 0 : dfxOpInfoOnce->op_.root = dfxOpInfo.root;
25 :
26 0 : dfxOpInfoOnce->op_.inputAddr = dfxOpInfo.inputMemAddr;
27 0 : dfxOpInfoOnce->op_.inputSize = dfxOpInfo.inputMemSize;
28 0 : dfxOpInfoOnce->op_.outputAddr = dfxOpInfo.outputMemAddr;
29 0 : dfxOpInfoOnce->op_.outputSize = dfxOpInfo.outputMemSize;
30 :
31 0 : dfxOpInfoOnce->algTag_ = dfxOpInfo.algTag;
32 0 : dfxOpInfoOnce->beginTime_ = dfxOpInfo.beginTime;
33 0 : dfxOpInfoOnce->cpuWaitAicpuNotifyId_ = dfxOpInfo.cpuWaitAicpuNotifyId;
34 :
35 0 : return dfxOpInfoOnce;
36 0 : }
37 :
38 : } // namespace hccl
|