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

Configuration for thread pool work callbacks. More...

#include <onnxruntime_c_api.h>

Public Attributes

uint32_t version
 
OrtThreadPoolWorkEnqueueFn on_enqueue
 
OrtThreadPoolWorkStartFn on_start_work
 
OrtThreadPoolWorkStopFn on_stop_work
 
OrtThreadPoolWorkAbandonFn on_abandon
 
void * user_context
 

Detailed Description

Configuration for thread pool work callbacks.

A versioned struct that bundles all thread pool callback function pointers and a user context. Pass to OrtApi::SetPerSessionThreadPoolCallbacks.

Note
The version field must be set to ORT_API_VERSION.
New fields MUST only be appended at the end of this struct.
Since
Version 1.25.

Member Data Documentation

◆ on_abandon

OrtThreadPoolWorkAbandonFn OrtThreadPoolCallbacksConfig::on_abandon

Called when work is abandoned. May be NULL.

◆ on_enqueue

OrtThreadPoolWorkEnqueueFn OrtThreadPoolCallbacksConfig::on_enqueue

Called when work is enqueued. May be NULL.

◆ on_start_work

OrtThreadPoolWorkStartFn OrtThreadPoolCallbacksConfig::on_start_work

Called when work starts. May be NULL.

◆ on_stop_work

OrtThreadPoolWorkStopFn OrtThreadPoolCallbacksConfig::on_stop_work

Called when work completes. May be NULL.

◆ user_context

void* OrtThreadPoolCallbacksConfig::user_context

User-provided context passed to all callbacks. May be NULL. Must remain valid for the lifetime of the session. Subject to concurrent invocations from multiple threads and must be thread-safe. May affect inference performance.

◆ version

uint32_t OrtThreadPoolCallbacksConfig::version

Must be ORT_API_VERSION