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