ONNX Runtime integration.
More...
|
| static COOPSYNC_TBB_ONNX_NODISCARDinline ::OrtStatus * | wait_for (const ::OrtApi *api, ::OrtSession *session, const ::OrtRunOptions *run_options, const char *const *input_names, const ::OrtValue *const *input_values, std::size_t input_count, const char *const *output_names, std::size_t output_count, ::OrtValue **output_values) |
| | Suspends the current TBB task until an ORT session RunAsync is complete. Accepts ONXX Runtime C API arguments.
|
| static void | wait_for (::Ort::Session &session, const ::Ort::RunOptions &run_options, const char *const *input_names, const ::Ort::Value *input_values, std::size_t input_count, const char *const *output_names, ::Ort::Value *output_values, std::size_t output_count) |
| | Suspends the current TBB task until an ORT session RunAsync is complete. Accepts ONXX Runtime C++ API arguments.
|
ONNX Runtime integration.
◆ wait_for() [1/2]
| void coopsync_tbb::onnx::wait_for |
( |
::Ort::Session & | session, |
|
|
const ::Ort::RunOptions & | run_options, |
|
|
const char *const * | input_names, |
|
|
const ::Ort::Value * | input_values, |
|
|
std::size_t | input_count, |
|
|
const char *const * | output_names, |
|
|
::Ort::Value * | output_values, |
|
|
std::size_t | output_count ) |
|
inlinestatic |
Suspends the current TBB task until an ORT session RunAsync is complete. Accepts ONXX Runtime C++ API arguments.
- Parameters
-
| [in] | session | The Ort::Session to run. |
| [in] | run_options | The Ort::RunOptions to use for the RunAsync call. |
| [in] | input_names | Array of null terminated UTF8 encoded strings of the input names. |
| [in] | input_values | Array of Ort::Values of the input values. |
| [in] | input_count | Number of elements in the input_names and inputs arrays. |
| [in] | output_names | Array of null terminated UTF8 encoded strings of the output names. |
| [out] | output_values | Array of provided Values to be filled with outputs. On calling, output_values[i] could either be initialized by a null pointer or a preallocated Ort::Value*. It is caller's duty to finally release output_values and each of its member, regardless of whether the member (Ort::Value) is allocated by onnxruntime or preallocated by the caller. |
| [in] | output_count | Number of elements in the output_names and outputs array. |
- Exceptions
-
| Ort::Exception | on error. The exception will contain the status message from the ORT callback. |
Calls the session.RunAsync with the provided arguments and a callback that resumes the current TBB task. The task is suspended until the callback is invoked, at which point the status from the callback is checked and an exception is thrown if it indicates an error. The arguments follow the same semantics as the Ort::Session::RunAsync.
- Note
- In case of error during callback setup, the task is resumed immediately.
◆ wait_for() [2/2]
| COOPSYNC_TBB_ONNX_NODISCARDinline ::OrtStatus * coopsync_tbb::onnx::wait_for |
( |
const ::OrtApi * | api, |
|
|
::OrtSession * | session, |
|
|
const ::OrtRunOptions * | run_options, |
|
|
const char *const * | input_names, |
|
|
const ::OrtValue *const * | input_values, |
|
|
std::size_t | input_count, |
|
|
const char *const * | output_names, |
|
|
std::size_t | output_count, |
|
|
::OrtValue ** | output_values ) |
|
static |
Suspends the current TBB task until an ORT session RunAsync is complete. Accepts ONXX Runtime C API arguments.
- Parameters
-
| [in] | api | The OrtApi to use for the RunAsync call. |
| [in] | session | The OrtSession to run. |
| [in] | run_options | If nullptr, will use a default OrtRunOptions. |
| [in] | input_names | Array of null terminated UTF8 encoded strings of the input names. |
| [in] | input_values | Array of OrtValue of the input values |
| [in] | input_count | Number of elements in the input_names and inputs arrays. |
| [in] | output_names | Array of null terminated UTF8 encoded strings of the output names. |
| [in] | output_count | Number of elements in the output_names and outputs array. |
| [out] | output_values | OrtValue* array of size output_count. On calling, output_values[i] could either be a null or a pointer to a preallocated OrtValue. It is caller's duty to finally release the output array and each of its member, regardless of whether the member (OrtValue*) is allocated by onnxruntime or preallocated by the caller. |
- Returns
- The
OrtStatus* passed by ORT to the callback. On success, this is nullptr. The caller owns the returned status and must release it via OrtApi::ReleaseStatus when non-null.
Calls the api->RunAsync with the provided arguments and a callback that resumes the current TBB task. The task is suspended until the callback is invoked. The arguments follow the same semantics as the OrtApi::RunAsync.
- Note
- In case of error during callback setup, the task is resumed immediately.