ONNX Runtime
Loading...
Searching...
No Matches
OrtNodeComputeInfo Struct Reference

The OrtNodeComputeInfo struct provides functions that an OrtEp implements to specify the compute function for a compiled OrtGraph instance. More...

#include <onnxruntime_ep_c_api.h>

Public Attributes

uint32_t ort_version_supported
 The ONNX Runtime version the OrtNodeComputeInfo was compiled with.
 
OrtStatus *(* CreateState )(OrtNodeComputeInfo *this_ptr, OrtNodeComputeContext *compute_context, void **compute_state)
 Creates an opaque compute state object that is then passed to the Compute() function during inference.
 
OrtStatus *(* Compute )(OrtNodeComputeInfo *this_ptr, void *compute_state, OrtKernelContext *kernel_context)
 Computation function called to execute the fused node compiled by an OrtEp instance.
 
void(* ReleaseState )(OrtNodeComputeInfo *this_ptr, void *compute_state)
 Releases the compute state returned by CreateState().
 

Detailed Description

The OrtNodeComputeInfo struct provides functions that an OrtEp implements to specify the compute function for a compiled OrtGraph instance.

Since
Version 1.23.

Member Data Documentation

◆ Compute

OrtStatus *( * OrtNodeComputeInfo::Compute) (OrtNodeComputeInfo *this_ptr, void *compute_state, OrtKernelContext *kernel_context)

Computation function called to execute the fused node compiled by an OrtEp instance.

Parameters
[in]this_ptrThe OrtNodeComputeInfo instance.
[in]compute_stateThe opaque computation state returned by CreateState().
[in]kernel_contextThe OrtKernelContext instance used to access inputs/outputs.

Returns
If no error, nullptr will be returned. If there is an error, a pointer to an OrtStatus that contains error details will be returned. Use OrtApi::ReleaseStatus to free this pointer.

Since
Version 1.23.

◆ CreateState

OrtStatus *( * OrtNodeComputeInfo::CreateState) (OrtNodeComputeInfo *this_ptr, OrtNodeComputeContext *compute_context, void **compute_state)

Creates an opaque compute state object that is then passed to the Compute() function during inference.

Parameters
[in]this_ptrThe OrtNodeComputeInfo instance.
[in]compute_contextOrtNodeComputeContext instance that contains compiled/fused node's name and host memory allocation functions. Can optionally be used to build the compute state.
[out]compute_stateOutput parameter that is assigned the opaque computation state. ONNX Runtime calls ReleaseState() (after calling Compute()) to allow the implementer to release the compute state.

Returns
If no error, nullptr will be returned. If there is an error, a pointer to an OrtStatus that contains error details will be returned. Use OrtApi::ReleaseStatus to free this pointer.

Since
Version 1.23.

◆ ort_version_supported

uint32_t OrtNodeComputeInfo::ort_version_supported

The ONNX Runtime version the OrtNodeComputeInfo was compiled with.

Implementation should set to ORT_API_VERSION. ORT will use this to ensure it does not call functions that were not available when the EP library was compiled.

Since
Version 1.23.

◆ ReleaseState

void( * OrtNodeComputeInfo::ReleaseState) (OrtNodeComputeInfo *this_ptr, void *compute_state)

Releases the compute state returned by CreateState().

Parameters
[in]this_ptrThe OrtNodeComputeInfo instance.
[in,out]compute_stateThe opaque compute state returned by CreateState().
Since
Version 1.23.