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 : #ifndef MC2_DATA_TYPE_H
12 : #define MC2_DATA_TYPE_H
13 : #include "hccl_types.h"
14 :
15 : enum HcclTaskStatus {
16 : HCCL_NORMAL_STATUS,
17 : HCCL_CQE_ERROR,
18 : HCCL_END_STATUS
19 : };
20 :
21 : struct HcclOpData {
22 21 : HcclOpData(){
23 21 : dataDes = {0, HcclDataType::HCCL_DATA_TYPE_RESERVED, 0};
24 21 : }
25 : HcclCMDType opType = HcclCMDType::HCCL_CMD_MAX;
26 : HcclReduceOp reduceOp = HcclReduceOp::HCCL_REDUCE_RESERVED;
27 : HcclDataType dataType = HcclDataType::HCCL_DATA_TYPE_RESERVED;
28 : HcclDataType outputDataType = HcclDataType::HCCL_DATA_TYPE_RESERVED;
29 : uint64_t dataCount{0};
30 : uint32_t root{0};
31 : uint32_t sendRecvRemoteRank{0};
32 : uint64_t input{0};
33 : uint64_t output{0};
34 : uint64_t rev[10] = {0};
35 :
36 : union {
37 : struct {
38 : uint64_t dataCount;
39 : HcclDataType dataType;
40 : uint64_t strideCount;
41 : } dataDes;
42 : struct {
43 : void *counts;
44 : void *displs;
45 : HcclDataType dataType;
46 : } vDataDes;
47 : struct {
48 : HcclDataType sendType;
49 : HcclDataType recvType;
50 : uint64_t sendCount;
51 : uint64_t recvCount;
52 : } all2AllDataDes;
53 : struct {
54 : HcclDataType sendType;
55 : HcclDataType recvType;
56 : void *sendCounts;
57 : void *recvCounts;
58 : void *sdispls;
59 : void *rdispls;
60 : } all2AllVDataDes;
61 : struct {
62 : HcclDataType sendType;
63 : HcclDataType recvType;
64 : void *sendCountMatrix;
65 : } all2AllVCDataDes;
66 : struct {
67 : void *sendRecvItemsPtr;
68 : uint32_t itemNum;
69 : } batchSendRecvDataDes;
70 : };
71 : };
72 :
73 : #endif
|