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