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

Contains helper functions for a Loop OrtKernelImpl created via OrtEpApi::CreateLoopKernel. More...

#include <onnxruntime_ep_c_api.h>

Public Member Functions

OrtStatusConcatOutput (OrtLoopKernelHelper *this_ptr, void *stream_handle, const OrtValue *const *per_iteration_outputs, size_t num_per_iteration_outputs, void *output, size_t output_size_in_bytes)
 Helper function that concatenates OrtValue instances from each loop iteration into a single pre-allocated output buffer.
 

Public Attributes

uint32_t ort_version_supported
 Must be initialized to ORT_API_VERSION.
 
void(* Release )(OrtLoopKernelHelper *this_ptr)
 Called by ORT to release the OrtLoopKernelHelper instance and its resources.
 

Detailed Description

Contains helper functions for a Loop OrtKernelImpl created via OrtEpApi::CreateLoopKernel.

Since
Version 1.24.

Member Function Documentation

◆ ConcatOutput()

OrtStatus * OrtLoopKernelHelper::ConcatOutput ( OrtLoopKernelHelper this_ptr,
void *  stream_handle,
const OrtValue *const *  per_iteration_outputs,
size_t  num_per_iteration_outputs,
void *  output,
size_t  output_size_in_bytes 
)

Helper function that concatenates OrtValue instances from each loop iteration into a single pre-allocated output buffer.

Note
Implementing this function is required for all Loop opset versions.
Parameters
[in]this_ptrThe OrtLoopKernelHelper instance.
[in]stream_handleOptional native stream handle that enables asynchronous operations. May be NULL.
[in]per_iteration_outputsArray of OrtValue instances from each iteration. All OrtValue elements have the same shape.
[in]num_per_iteration_outputsThe number of OrtValue* elements in the per_iteration_outputs array.
[out]outputThe pre-allocated output buffer. Memory is allocated on the device for the EP running the Loop node.
[in]output_size_in_bytesThe size in bytes of the output buffer. It is guaranteed to be large enough to hold the concatenated data of each element in per_iteration_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.24.

Member Data Documentation

◆ ort_version_supported

uint32_t OrtLoopKernelHelper::ort_version_supported

Must be initialized to ORT_API_VERSION.

◆ Release

void( * OrtLoopKernelHelper::Release) (OrtLoopKernelHelper *this_ptr)

Called by ORT to release the OrtLoopKernelHelper instance and its resources.

Parameters
[in]this_ptrThe OrtLoopKernelHelper instance.
Since
Version 1.24.