You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

errorcode.h 2.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef MINDSPORE_LITE_INTERNAL_INCLUDE_ERRORCODE_H_
  17. #define MINDSPORE_LITE_INTERNAL_INCLUDE_ERRORCODE_H_
  18. /// \brief STATUS defined for holding error code in MindSpore Lite.
  19. using STATUS = int;
  20. /* Success */
  21. constexpr int RET_OK = 0; /**< No error occurs. */
  22. /* Common error code, range: [-1, -100]*/
  23. constexpr int RET_ERROR = -1; /**< Common error code. */
  24. constexpr int RET_NULL_PTR = -2; /**< NULL pointer returned.*/
  25. constexpr int RET_PARAM_INVALID = -3; /**< Invalid parameter.*/
  26. constexpr int RET_NO_CHANGE = -4; /**< No change. */
  27. constexpr int RET_SUCCESS_EXIT = -5; /**< No error but exit. */
  28. constexpr int RET_MEMORY_FAILED = -6; /**< Fail to create memory. */
  29. /* Executor error code, range: [-101,-200] */
  30. constexpr int RET_OUT_OF_TENSOR_RANGE = -101; /**< Failed to check range. */
  31. constexpr int RET_INPUT_TENSOR_ERROR = -102; /**< Failed to check input tensor. */
  32. constexpr int RET_REENTRANT_ERROR = -103; /**< Exist executor running. */
  33. /* Graph error code, range: [-201,-300] */
  34. constexpr int RET_GRAPH_FILE_ERR = -201; /**< Failed to verify graph file. */
  35. /* Node error code, range: [-301,-400] */
  36. constexpr int RET_NOT_FIND_OP = -301; /**< Failed to find operator. */
  37. constexpr int RET_INVALID_OP_NAME = -302; /**< Invalid operator name. */
  38. constexpr int RET_INVALID_OP_ATTR = -303; /**< Invalid operator attr. */
  39. constexpr int RET_OP_EXECUTE_FAILURE = -304; /**< Failed to execution operator. */
  40. /* Tensor error code, range: [-401,-500] */
  41. constexpr int RET_FORMAT_ERR = -401; /**< Failed to checking tensor format. */
  42. /* InferShape error code, range: [-501,-600] */
  43. constexpr int RET_INFER_ERR = -501; /**< Failed to infer shape. */
  44. constexpr int RET_INFER_INVALID = -502; /**< Invalid infer shape before runtime. */
  45. #endif // MINDSPORE_LITE_INCLUDE_ERRORCODE_H_