File size: 2,775 Bytes
89565fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

/** \addtogroup Global
 * ONNX Runtime C API
 * @{
 */

#ifdef __cplusplus
extern "C" {
#endif

/** \brief Error codes reported by ONNX Runtime.
 *
 * The error code associated with an ::OrtStatus.
 */
typedef enum OrtErrorCode {
  /**
   * Success. No error occurred.
   */
  ORT_OK,
  /**
   * Generic failure that does not map to a more specific error code. Consult the error message for details.
   */
  ORT_FAIL,
  /**
   * A caller-supplied argument was invalid (e.g. NULL pointer, out-of-range value, mismatched shape/rank, or bad
   * configuration).
   */
  ORT_INVALID_ARGUMENT,
  /**
   * A required file (such as a model file) does not exist.
   */
  ORT_NO_SUCHFILE,
  /**
   * Legacy/unused but retained for ABI compatibility. Historically returned when a model could not be found by name in
   * the ONNX Runtime Server (removed in 2022).
   */
  ORT_NO_MODEL,
  /**
   * A hardware accelerator or backend engine reported a failure (e.g. a device crash or other device-level error).
   */
  ORT_ENGINE_ERROR,
  /**
   * A generic runtime exception was caught. The error message is the primary source of detail.
   */
  ORT_RUNTIME_EXCEPTION,
  /**
   * Protobuf parsing or serialization failed.
   */
  ORT_INVALID_PROTOBUF,
  /**
   * Invalid session state for the requested operation. Despite the name, this code does not mean "success, model
   * loaded"; it is returned when the session is in the wrong state for the requested call (e.g. a model is already
   * loaded, the session is already initialized, or no model has been loaded yet). The name is historical and is
   * retained for ABI compatibility; consult the error message for the specific condition.
   */
  ORT_MODEL_LOADED,
  /**
   * The requested functionality is not implemented in this build.
   */
  ORT_NOT_IMPLEMENTED,
  /**
   * The model graph is structurally invalid (e.g. recursive function definitions, invalid tensor dimensions, or
   * malformed nodes).
   */
  ORT_INVALID_GRAPH,
  /**
   * An execution provider reported a generic failure.
   */
  ORT_EP_FAIL,
  /**
   * Model loading or session initialization was canceled at the caller's request.
   */
  ORT_MODEL_LOAD_CANCELED,
  /**
   * The model requires compilation by an execution provider, but compilation was disabled via session options.
   */
  ORT_MODEL_REQUIRES_COMPILATION,
  /**
   * A requested resource could not be found.
   */
  ORT_NOT_FOUND,
  /**
   * The execution provider's hardware device has been reset.
   *
   * The caller should stop using the existing session (and release it) and create a new session.
   */
  ORT_DEVICE_RESET,
} OrtErrorCode;

#ifdef __cplusplus
}
#endif

/// @}