Process-wide runtime ownership shared by independent model sessions. More...
#include <stdbool.h>#include <stddef.h>

Go to the source code of this file.
Functions | |
| bool | onnx_runtime_open (const char *library_directory, char *error, size_t capacity) |
| Initialize one process-lifetime runtime/environment using explicit local search roots. | |
| const struct OrtApi * | onnx_runtime_api (void) |
| Borrow the initialized API, without transferring release ownership. | |
| struct OrtEnv * | onnx_runtime_environment (void) |
| Borrow the environment retained until process exit. | |
Detailed Description
Process-wide runtime ownership shared by independent model sessions.
Definition in file onnx_runtime.h.
Function Documentation
◆ onnx_runtime_api()
| const struct OrtApi * onnx_runtime_api | ( | void | ) |
Borrow the initialized API, without transferring release ownership.
- Returns
- Process-lifetime API, or NULL before successful open.
Definition at line 169 of file onnx_runtime.c.
◆ onnx_runtime_environment()
| struct OrtEnv * onnx_runtime_environment | ( | void | ) |
Borrow the environment retained until process exit.
- Returns
- Shared environment, or NULL before successful open.
Definition at line 177 of file onnx_runtime.c.
◆ onnx_runtime_open()
| bool onnx_runtime_open | ( | const char * | library_directory, |
| char * | error, | ||
| size_t | capacity ) |
Initialize one process-lifetime runtime/environment using explicit local search roots.
- Parameters
-
library_directory Optional final search directory; NULL/empty omits it. error Writable diagnostic buffer, cleared on success. capacity Available bytes in error, including its terminator.
- Returns
- True after initialization or when this process already owns a runtime.
The first existing candidate must work; falling back would hide broken packages. The library and environment stay alive so sessions never retain unloaded API pointers.
- Note
- Concurrent initialization is serialized; later calls reuse the selected runtime.
Definition at line 38 of file onnx_runtime.c.