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(
22 0 : u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, 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(
31 0 : u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, 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(
40 : u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, void* signal, u32 userRank, u32 remoteUserRank,
41 0 : s32 stage)
42 : {
43 0 : taskLogicCmd.taskLogicType = taskLogicType;
44 0 : taskLogicCmd.index = index;
45 0 : taskFuncType = funcType;
46 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.signal = signal;
47 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.userRank = userRank;
48 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.remoteRank = remoteUserRank;
49 0 : taskLogicPara.dispatcherTaskLogicPara.signalWait.stage = stage;
50 0 : }
51 :
52 0 : TaskLogicInfo::TaskLogicInfo(
53 : u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, void* signal, u32 userRank, u64 offset,
54 0 : s32 stage)
55 : {
56 0 : taskLogicCmd.taskLogicType = taskLogicType;
57 0 : taskLogicCmd.index = index;
58 0 : taskFuncType = funcType;
59 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.signal = signal;
60 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.userRank = userRank;
61 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.offset = offset;
62 0 : taskLogicPara.dispatcherTaskLogicPara.signalRecord.stage = stage;
63 0 : }
64 :
65 0 : TaskLogicInfo::TaskLogicInfo(
66 : u32 index, TaskLogicType taskLogicType, TaskLogicFuncType funcType, void* dst, uint64_t destMax, void* src,
67 0 : u64 count, HcclRtMemcpyKind kind)
68 : {
69 0 : taskLogicCmd.index = index;
70 0 : taskLogicCmd.taskLogicType = taskLogicType;
71 0 : taskFuncType = funcType;
72 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.dst = dst;
73 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.destMax = destMax;
74 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.src = src;
75 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.count = count;
76 0 : taskLogicPara.dispatcherTaskLogicPara.memAsync.kind = kind;
77 0 : }
78 : } // namespace hccl
|