• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020 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 
17 #ifndef MINDSPORE_NNACL_ERRORCODE_H_
18 #define MINDSPORE_NNACL_ERRORCODE_H_
19 
20 typedef enum ErrorCodeCommonEnum {
21   NNACL_OK = 0,
22   NNACL_ERR = 1,
23   NNACL_NULL_PTR,
24   NNACL_PARAM_INVALID,
25   NNACL_INFER_INVALID,
26   NNACL_INPUT_TENSOR_ERROR,
27   NNACL_FORMAT_ERROR,
28   NNACL_COMMON_END = 9999
29 } ErrorCodeCommonEnum;
30 
31 typedef enum ErrorCodeFp32OpEnum {
32   NNACL_ERRCODE_OP_FP32_START = 10000,
33   NNACL_ERRCODE_STRASSEN_RECURSION_MALLOC,
34   NNACL_ERRCODE_REVERSE_MALLOC,
35   NNACL_ERRCODE_SQRT_NEGATIVE,
36   NNACL_ERRCODE_RSQRT_NEGATIVE,
37   NNACL_ERRCODE_RSQRT_NEGATIVE_OR_ZERO,
38   NNACL_ERRCODE_LOG_NEGATIVE_OR_ZERO,
39   NNACL_ERRCODE_DIVISOR_ZERO,
40   NNACL_ERRCODE_INDEX_OUT_OF_RANGE,
41   NNACL_ERRCODE_WINOGRAD_GENERATOR_ERROR,
42   NNACL_ERRCODE_OP_FP32_END = 19999
43 } ErrorCodeFp32OpEnum;
44 
45 typedef enum ErrorCodeFp16OpEnum {
46   NNACL_ERRCODE_OP_FP16_START = 20000,
47   NNACL_ERRCODE_OP_FP16_WINOGRAD_GENERATOR,
48   NNACL_ERRCODE_OP_FP16_END = 29999
49 } ErrorCodeFp16OpEnum;
50 
51 typedef enum ErrorCodeUint8OpEnum {
52   NNACL_ERRCODE_OP_UINT8_START = 30000,
53   NNACL_ERRCODE_OP_UINT8_END = 39999
54 } ErrorCodeUint8OpEnum;
55 
56 typedef enum ErrorCodeInt8OpEnum {
57   NNACL_ERRCODE_OP_INT8_START = 40000,
58   NNACL_ERRCODE_ADD_OVERFLOW,
59   NNACL_ERRCODE_MUL_OVERFLOW,
60   NNACL_ERRCODE_OP_INT8_END = 49999
61 } ErrorCodeInt8OpEnums;
62 
63 #endif  // MINDSPORE_NNACL_ERRORCODE_H_
64