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 "task_logic_info.h"
12 :
13 : namespace hccl {
14 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType)
15 : {
16 0 : taskLogicCmd.taskLogicType = taskLogicType;
17 0 : taskLogicCmd.index = index;
18 0 : taskFuncType = funcType;
19 0 : }
20 :
21 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType,
22 0 : std::vector<TxMemoryInfo> &txMems)
23 : {
24 0 : taskLogicCmd.taskLogicType = taskLogicType;
25 0 : taskLogicCmd.index = index;
26 0 : taskFuncType = funcType;
27 0 : txAsync.txMems = txMems;
28 0 : }
29 :
30 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType,
31 0 : std::vector<RxMemoryInfo> &rxMems)
32 : {
33 0 : taskLogicCmd.taskLogicType = taskLogicType;
34 0 : taskLogicCmd.index = index;
35 0 : taskFuncType = funcType;
36 0 : rxAsync.rxMems = rxMems;
37 0 : }
38 :
39 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType,
40 0 : void *signal, u32 userRank, u32 remoteUserRank, s32 stage)
41 : {
42 0 : taskLogicCmd.taskLogicType = taskLogicType;
43 0 : taskLogicCmd.index = index;
44 0 : taskFuncType = funcType;
45 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.signal = signal;
46 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.userRank = userRank;
47 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.remoteRank = remoteUserRank;
48 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.stage = stage;
49 0 : }
50 :
51 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType,
52 0 : void *signal, u32 userRank, u64 offset, s32 stage)
53 : {
54 0 : taskLogicCmd.taskLogicType = taskLogicType;
55 0 : taskLogicCmd.index = index;
56 0 : taskFuncType = funcType;
57 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.signal = signal;
58 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.userRank = userRank;
59 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.offset = offset;
60 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.stage = stage;
61 0 : }
62 :
63 0 : TaskLogicInfo::TaskLogicInfo(u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, void *dst,
64 0 : uint64_t destMax, void *src, u64 count, HcclRtMemcpyKind kind)
65 : {
66 0 : taskLogicCmd.index = index;
67 0 : taskLogicCmd.taskLogicType = taskLogicType;
68 0 : taskFuncType = funcType;
69 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.dst = dst;
70 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.destMax = destMax;
71 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.src = src;
72 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.count = count;
73 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.kind = kind;
74 0 : }
75 : } // namespace hccl
|