• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2022 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_OPTIMIZER_REG_CPU_CONST_INPUT_TO_ATTR_H_
17 #define MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_OPTIMIZER_REG_CPU_CONST_INPUT_TO_ATTR_H_
18 
19 #include "include/backend/optimizer/op_adaptation_info_factory.h"
20 #include "ops/sparse_op_name.h"
21 #include "ops/sequence_op_name.h"
22 #include "ops/array_op_name.h"
23 #include "ops/arithmetic_op_name.h"
24 
25 // Do not add operators here, the input to attribute function has been abandoned
26 namespace mindspore::opt {
27 #define RER_CPU_STATIC_CONST_TO_ATTR(op_name, ...) RER_CONST_TO_ATTR_LIST(op_name, kCPUDevice, false, __VA_ARGS__)
28 #define RER_CPU_DYNAMIC_CONST_TO_ATTR(op_name, ...) RER_CONST_TO_ATTR_LIST(op_name, kCPUDevice, true, __VA_ARGS__)
29 
30 RER_CPU_DYNAMIC_CONST_TO_ATTR(kCastOpName, 1);
31 RER_CPU_DYNAMIC_CONST_TO_ATTR(kFillOpName, 0);
32 RER_CPU_DYNAMIC_CONST_TO_ATTR(kListToTensorOpName, 1);
33 
34 RER_CPU_STATIC_CONST_TO_ATTR(kCastOpName, 1);
35 RER_CPU_STATIC_CONST_TO_ATTR(kCOO2CSROpName, 1);
36 RER_CPU_STATIC_CONST_TO_ATTR(kCSR2COOOpName, 1);
37 RER_CPU_STATIC_CONST_TO_ATTR(kCSRDivOpName, 3);
38 RER_CPU_STATIC_CONST_TO_ATTR(kCSRGatherOpName, 3);
39 RER_CPU_STATIC_CONST_TO_ATTR(kCSRMMOpName, 3);
40 RER_CPU_STATIC_CONST_TO_ATTR(kCSRMulOpName, 3);
41 RER_CPU_STATIC_CONST_TO_ATTR(kCSRMVOpName, 3);
42 RER_CPU_STATIC_CONST_TO_ATTR(kCSRReduceSumOpName, 3, 4);
43 RER_CPU_STATIC_CONST_TO_ATTR(kFillOpName, 0);
44 RER_CPU_STATIC_CONST_TO_ATTR(kListToTensorOpName, 1);
45 }  // namespace mindspore::opt
46 
47 #endif  // MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_OPTIMIZER_REG_CPU_CONST_INPUT_TO_ATTR_H_
48