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 HCCL_CCU_REPRESENTATION_ARG_H
12 : #define HCCL_CCU_REPRESENTATION_ARG_H
13 :
14 : #include <vector>
15 : #include <memory>
16 :
17 : #include "ccu_datatype.h"
18 :
19 : namespace Hccl {
20 : namespace CcuRep {
21 :
22 : enum class CcuArgType {
23 : VARIABLE,
24 : MEMORY,
25 : VARIABLE_LIST,
26 : MEMORY_LIST,
27 : };
28 :
29 : struct CcuRepArg {
30 164 : explicit CcuRepArg(const Variable& var) : type(CcuArgType::VARIABLE), var(var) {}
31 95 : explicit CcuRepArg(const Memory& mem) : type(CcuArgType::MEMORY), mem(mem) {}
32 1 : explicit CcuRepArg(const std::vector<Variable>& varList) : type(CcuArgType::VARIABLE_LIST), varList(varList) {}
33 75 : explicit CcuRepArg(const std::vector<Memory>& memList) : type(CcuArgType::MEMORY_LIST), memList(memList) {}
34 :
35 : CcuArgType type;
36 : Variable var;
37 : Memory mem;
38 : std::vector<Variable> varList;
39 : std::vector<Memory> memList;
40 : };
41 :
42 : }; // namespace CcuRep
43 : }; // namespace Hccl
44 : #endif // HCCL_CCU_REPRESENTATION_ARG_H
|