ONNX Runtime
Loading...
Searching...
No Matches
onnxruntime_ep_c_api.h
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4// Do not include this file directly. Please include "onnxruntime_c_api.h" instead.
5
6#if defined(__DOXYGEN__)
7// When running a Doxygen build, include onnxruntime_c_api.h. Doxygen expects header files to be self-contained.
8#include "onnxruntime_c_api.h"
9#else
10// In normal usage, do not include onnxruntime_c_api.h. This file is explicitly included in onnxruntime_c_api.h.
11#endif
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17ORT_RUNTIME_CLASS(Ep);
18ORT_RUNTIME_CLASS(EpFactory);
19ORT_RUNTIME_CLASS(EpGraphSupportInfo);
20ORT_RUNTIME_CLASS(MemoryDevice); // opaque class to wrap onnxruntime::OrtDevice
21ORT_RUNTIME_CLASS(NodeComputeContext);
22
23ORT_RUNTIME_CLASS(DataTransferImpl);
24ORT_RUNTIME_CLASS(SyncNotificationImpl);
25ORT_RUNTIME_CLASS(SyncStreamImpl);
26
33
43 ORT_API_T(void, Release, _In_ OrtDataTransferImpl* this_ptr);
44
54 ORT_API_T(bool, CanCopy, _In_ const OrtDataTransferImpl* this_ptr,
55 _In_ const OrtMemoryDevice* src_memory_device, _In_ const OrtMemoryDevice* dst_memory_device);
56
73 ORT_API2_STATUS(CopyTensors, _In_ OrtDataTransferImpl* this_ptr,
74 _In_reads_(num_tensors) const OrtValue** src_tensors,
75 _In_reads_(num_tensors) OrtValue** dst_tensors,
76 _In_reads_(num_tensors) OrtSyncStream** streams,
77 _In_ size_t num_tensors);
78};
79
86
96 ORT_API_T(void, Release, _In_ OrtSyncNotificationImpl* this_ptr);
97
104 ORT_API2_STATUS(Activate, _In_ OrtSyncNotificationImpl* this_ptr);
105
113 ORT_API2_STATUS(WaitOnDevice, _In_ OrtSyncNotificationImpl* this_ptr, _In_ OrtSyncStream* consumer_stream);
114
121 ORT_API2_STATUS(WaitOnHost, _In_ OrtSyncNotificationImpl* this_ptr);
122};
123
132
142 ORT_API_T(void, Release, _In_ OrtSyncStreamImpl* this_ptr);
143
153 ORT_API_T(void*, GetHandle, _In_ OrtSyncStreamImpl* this_ptr);
154
162 ORT_API2_STATUS(CreateNotification, _In_ OrtSyncStreamImpl* this_ptr,
163 _Outptr_ OrtSyncNotificationImpl** notification);
164
173 ORT_API2_STATUS(Flush, _In_ OrtSyncStreamImpl* this_ptr);
174
184 ORT_API2_STATUS(OnSessionRunEnd, _In_ OrtSyncStreamImpl* this_ptr);
185};
186
189
190struct OrtNodeComputeInfo;
192
209
221
222 // const OrtNode* fused_node_schema;
223};
224
239
252 OrtStatus*(ORT_API_CALL* CreateState)(_In_ OrtNodeComputeInfo* this_ptr,
253 _In_ OrtNodeComputeContext* compute_context,
254 _Outptr_ void** compute_state);
255
265 OrtStatus*(ORT_API_CALL* Compute)(_In_ OrtNodeComputeInfo* this_ptr, _In_ void* compute_state,
266 _In_ OrtKernelContext* kernel_context);
267
274 void(ORT_API_CALL* ReleaseState)(_In_ OrtNodeComputeInfo* this_ptr, _Frees_ptr_opt_ void* compute_state);
275};
276
282struct OrtEpApi {
296 ORT_API2_STATUS(CreateEpDevice, _In_ OrtEpFactory* ep_factory,
297 _In_ const OrtHardwareDevice* hardware_device,
298 _In_opt_ const OrtKeyValuePairs* ep_metadata,
299 _In_opt_ const OrtKeyValuePairs* ep_options,
300 _Out_ OrtEpDevice** ep_device);
301
302 ORT_CLASS_RELEASE(EpDevice);
303
321 ORT_API2_STATUS(EpGraphSupportInfo_AddNodesToFuse, _In_ OrtEpGraphSupportInfo* graph_support_info,
322 _In_reads_(num_nodes) const OrtNode* const* nodes, _In_ size_t num_nodes,
323 _In_opt_ const OrtNodeFusionOptions* node_fusion_options);
324
334 ORT_API2_STATUS(EpGraphSupportInfo_AddSingleNode, _In_ OrtEpGraphSupportInfo* graph_support_info,
335 _In_ const OrtNode* node);
336
348 ORT_API_T(const char*, NodeComputeContext_NodeName, _In_ const OrtNodeComputeContext* context);
349
372 ORT_API2_STATUS(EpDevice_AddAllocatorInfo, _In_ OrtEpDevice* ep_device,
373 _In_ const OrtMemoryInfo* allocator_memory_info);
374
385 ORT_API_T(const OrtMemoryDevice*, MemoryInfo_GetMemoryDevice, _In_ const OrtMemoryInfo* memory_info);
386
394 ORT_API_T(const OrtMemoryDevice*, Value_GetMemoryDevice, _In_ const OrtValue* value);
395
407 ORT_API_T(bool, MemoryDevice_AreEqual, _In_ const OrtMemoryDevice* a, _In_ const OrtMemoryDevice* b);
408
416 ORT_API_T(OrtMemoryInfoDeviceType, MemoryDevice_GetDeviceType, _In_ const OrtMemoryDevice* memory_device);
417
425 ORT_API_T(OrtDeviceMemoryType, MemoryDevice_GetMemoryType, _In_ const OrtMemoryDevice* memory_device);
426
438 ORT_API_T(uint32_t, MemoryDevice_GetVendorId, _In_ const OrtMemoryDevice* memory_device);
439
447 ORT_API_T(uint32_t, MemoryDevice_GetDeviceId, _In_ const OrtMemoryDevice* memory_device);
448
460 ORT_API_T(const OrtSyncStreamImpl*, SyncStream_GetImpl, _In_ const OrtSyncStream* stream);
461
469 ORT_API_T(uint64_t, SyncStream_GetSyncId, _In_ const OrtSyncStream* stream);
470
481 ORT_API_T(uint64_t, GetSyncIdForLastWaitOnSyncStream,
482 _In_ const OrtSyncStream* producer_stream, _In_ const OrtSyncStream* consumer_stream);
483
502 ORT_API2_STATUS(CreateHardwareDevice, _In_ OrtHardwareDeviceType type,
503 _In_ uint32_t vendor_id,
504 _In_ uint32_t device_id,
505 _In_ const char* vendor_name,
506 _In_opt_ const OrtKeyValuePairs* metadata,
507 _Out_ OrtHardwareDevice** hardware_device);
508
509 ORT_CLASS_RELEASE(HardwareDevice);
510};
511
520typedef enum OrtEpDataLayout {
521 OrtEpDataLayout_NCHW = 0,
522 OrtEpDataLayout_NHWC,
523
524 OrtEpDataLayout_Default = OrtEpDataLayout_NCHW,
525} OrtEpDataLayout;
526
531struct OrtEp {
540
550 ORT_API_T(const char*, GetName, _In_ const OrtEp* this_ptr);
551
568 ORT_API2_STATUS(GetCapability, _In_ OrtEp* this_ptr, _In_ const OrtGraph* graph,
569 _Inout_ OrtEpGraphSupportInfo* graph_support_info);
570
608 ORT_API2_STATUS(Compile, _In_ OrtEp* this_ptr, _In_ const OrtGraph** graphs,
609 _In_ const OrtNode** fused_nodes, _In_ size_t count,
610 _Out_writes_all_(count) OrtNodeComputeInfo** node_compute_infos,
611 _Out_writes_(count) OrtNode** ep_context_nodes);
612
621 ORT_API_T(void, ReleaseNodeComputeInfos, _In_ OrtEp* this_ptr,
622 OrtNodeComputeInfo** node_compute_infos,
623 _In_ size_t num_node_compute_infos);
624
637 ORT_API2_STATUS(GetPreferredDataLayout, _In_ OrtEp* this_ptr, _Out_ OrtEpDataLayout* preferred_data_layout);
638
661 ORT_API2_STATUS(ShouldConvertDataLayoutForOp, _In_ OrtEp* this_ptr,
662 _In_z_ const char* domain, _In_z_ const char* op_type,
663 _In_ OrtEpDataLayout target_data_layout,
664 _Outptr_ int* should_convert);
665
682 ORT_API2_STATUS(SetDynamicOptions, _In_ OrtEp* this_ptr,
683 _In_reads_(num_options) const char* const* option_keys,
684 _In_reads_(num_options) const char* const* option_values,
685 _In_ size_t num_options);
686
698 ORT_API2_STATUS(OnRunStart, _In_ OrtEp* this_ptr, _In_ const OrtRunOptions* run_options);
699
713 ORT_API2_STATUS(OnRunEnd, _In_ OrtEp* this_ptr, _In_ const OrtRunOptions* run_options, _In_ bool sync_stream);
714
730 ORT_API2_STATUS(CreateAllocator, _In_ OrtEp* this_ptr,
731 _In_ const OrtMemoryInfo* memory_info,
732 _Outptr_result_maybenull_ OrtAllocator** allocator);
733
750 ORT_API2_STATUS(CreateSyncStreamForDevice, _In_ OrtEp* this_ptr,
751 _In_ const OrtMemoryDevice* memory_device,
752 _Outptr_ OrtSyncStreamImpl** stream);
753
769 ORT_API_T(const char*, GetCompiledModelCompatibilityInfo, _In_ OrtEp* this_ptr,
770 _In_ const OrtGraph* graph);
771};
772
792typedef OrtStatus* (*CreateEpApiFactoriesFn)(_In_ const char* registered_name, _In_ const OrtApiBase* ort_api_base,
793 _In_ const OrtLogger* default_logger,
794 _Inout_ OrtEpFactory** factories, _In_ size_t max_factories,
795 _Out_ size_t* num_factories);
796
807typedef OrtStatus* (*ReleaseEpApiFactoryFn)(_In_ OrtEpFactory* factory);
808
822
832 ORT_API_T(const char*, GetName, const OrtEpFactory* this_ptr);
833
843 ORT_API_T(const char*, GetVendor, const OrtEpFactory* this_ptr); // return EP vendor
844
862 ORT_API2_STATUS(GetSupportedDevices, _In_ OrtEpFactory* this_ptr,
863 _In_reads_(num_devices) const OrtHardwareDevice* const* devices,
864 _In_ size_t num_devices,
865 _Inout_ OrtEpDevice** ep_devices,
866 _In_ size_t max_ep_devices,
867 _Out_ size_t* num_ep_devices);
868
893 ORT_API2_STATUS(CreateEp, _In_ OrtEpFactory* this_ptr,
894 _In_reads_(num_devices) const OrtHardwareDevice* const* devices,
895 _In_reads_(num_devices) const OrtKeyValuePairs* const* ep_metadata_pairs,
896 _In_ size_t num_devices,
897 _In_ const OrtSessionOptions* session_options,
898 _In_ const OrtLogger* logger, _Outptr_ OrtEp** ep);
899
907 ORT_API_T(void, ReleaseEp, OrtEpFactory* this_ptr, struct OrtEp* ep);
908
918 ORT_API_T(uint32_t, GetVendorId, const OrtEpFactory* this_ptr);
919
932 ORT_API_T(const char*, GetVersion, _In_ const OrtEpFactory* this_ptr);
933
953 ORT_API2_STATUS(ValidateCompiledModelCompatibilityInfo, _In_ OrtEpFactory* this_ptr,
954 _In_reads_(num_devices) const OrtHardwareDevice* const* devices,
955 _In_ size_t num_devices,
956 _In_ const char* compatibility_info,
957 _Out_ OrtCompiledModelCompatibility* model_compatibility);
958
973 ORT_API2_STATUS(CreateAllocator, _In_ OrtEpFactory* this_ptr,
974 _In_ const OrtMemoryInfo* memory_info,
975 _In_opt_ const OrtKeyValuePairs* allocator_options,
976 _Outptr_result_maybenull_ OrtAllocator** allocator);
977
982 ORT_API_T(void, ReleaseAllocator, _In_ OrtEpFactory* this_ptr, _In_ OrtAllocator* allocator);
983
996 ORT_API2_STATUS(CreateDataTransfer, _In_ OrtEpFactory* this_ptr,
997 _Outptr_result_maybenull_ OrtDataTransferImpl** data_transfer);
998
1006 ORT_API_T(bool, IsStreamAware, _In_ const OrtEpFactory* this_ptr);
1007
1022 ORT_API2_STATUS(CreateSyncStreamForDevice, _In_ OrtEpFactory* this_ptr,
1023 _In_ const OrtMemoryDevice* memory_device,
1024 _In_opt_ const OrtKeyValuePairs* stream_options,
1025 _Outptr_ OrtSyncStreamImpl** stream);
1026
1054 ORT_API2_STATUS(SetEnvironmentOptions, _In_ OrtEpFactory* this_ptr, _In_ const OrtKeyValuePairs* options);
1055};
1056
1057#ifdef __cplusplus
1058}
1059#endif
struct OrtMemoryInfo OrtMemoryInfo
Definition onnxruntime_c_api.h:296
struct OrtHardwareDevice OrtHardwareDevice
Definition onnxruntime_c_api.h:328
struct OrtNode OrtNode
Definition onnxruntime_c_api.h:324
OrtMemoryInfoDeviceType
This mimics OrtDevice type constants so they can be returned in the API.
Definition onnxruntime_c_api.h:485
OrtCompiledModelCompatibility
The C API.
Definition onnxruntime_c_api.h:961
struct OrtKernelContext OrtKernelContext
Definition onnxruntime_c_api.h:452
struct OrtEpDevice OrtEpDevice
Definition onnxruntime_c_api.h:329
struct OrtRunOptions OrtRunOptions
Definition onnxruntime_c_api.h:300
OrtHardwareDeviceType
Definition onnxruntime_c_api.h:492
struct OrtGraph OrtGraph
Definition onnxruntime_c_api.h:325
struct OrtSyncStream OrtSyncStream
Definition onnxruntime_c_api.h:331
struct OrtSessionOptions OrtSessionOptions
Definition onnxruntime_c_api.h:306
OrtDeviceMemoryType
This matches OrtDevice::MemoryType values.
Definition onnxruntime_c_api.h:478
struct OrtValue OrtValue
Definition onnxruntime_c_api.h:299
struct OrtKeyValuePairs OrtKeyValuePairs
Definition onnxruntime_c_api.h:330
struct OrtStatus OrtStatus
Definition onnxruntime_c_api.h:295
struct OrtLogger OrtLogger
Definition onnxruntime_c_api.h:320
Memory allocation interface.
Definition onnxruntime_c_api.h:346
The helper interface to get the right version of OrtApi.
Definition onnxruntime_c_api.h:888
Struct that an EP implements for IDataTransfer to copy between devices it uses and CPU.
Definition onnxruntime_ep_c_api.h:31
OrtStatus * CopyTensors(OrtDataTransferImpl *this_ptr, const OrtValue **src_tensors, OrtValue **dst_tensors, OrtSyncStream **streams, size_t num_tensors)
Copy tensors from src_tensors to dst_tensors using the provided streams.
bool(* CanCopy)(const OrtDataTransferImpl *this_ptr, const OrtMemoryDevice *src_memory_device, const OrtMemoryDevice *dst_memory_device)
Check if the implementation can copy between the source and destination memory devices.
Definition onnxruntime_ep_c_api.h:55
uint32_t ort_version_supported
Must be initialized to ORT_API_VERSION.
Definition onnxruntime_ep_c_api.h:32
void(* Release)(OrtDataTransferImpl *this_ptr)
Release the OrtDataTransferImpl instance.
Definition onnxruntime_ep_c_api.h:43
The OrtEpApi struct provides functions that are relevant to the implementation of an execution provid...
Definition onnxruntime_ep_c_api.h:282
uint32_t(* MemoryDevice_GetVendorId)(const OrtMemoryDevice *memory_device)
Get the vendor ID from an OrtMemoryDevice instance.
Definition onnxruntime_ep_c_api.h:438
uint64_t(* GetSyncIdForLastWaitOnSyncStream)(const OrtSyncStream *producer_stream, const OrtSyncStream *consumer_stream)
Get the sync ID for the last time the consumer_stream waited on the producer_stream.
Definition onnxruntime_ep_c_api.h:482
OrtStatus * CreateHardwareDevice(OrtHardwareDeviceType type, uint32_t vendor_id, uint32_t device_id, const char *vendor_name, const OrtKeyValuePairs *metadata, OrtHardwareDevice **hardware_device)
Create an OrtHardwareDevice.
OrtMemoryInfoDeviceType(* MemoryDevice_GetDeviceType)(const OrtMemoryDevice *memory_device)
Get the OrtMemoryInfoDeviceType value from an OrtMemoryDevice instance.
Definition onnxruntime_ep_c_api.h:416
const char *(* NodeComputeContext_NodeName)(const OrtNodeComputeContext *context)
Query a OrtNodeComputeContext for the name of the node that encapsulates the compiled/fused node.
Definition onnxruntime_ep_c_api.h:348
bool(* MemoryDevice_AreEqual)(const OrtMemoryDevice *a, const OrtMemoryDevice *b)
Compare two OrtMemoryDevice instances for equality.
Definition onnxruntime_ep_c_api.h:407
const OrtMemoryDevice *(* MemoryInfo_GetMemoryDevice)(const OrtMemoryInfo *memory_info)
Get the OrtMemoryDevice from an OrtMemoryInfo instance.
Definition onnxruntime_ep_c_api.h:385
const OrtSyncStreamImpl *(* SyncStream_GetImpl)(const OrtSyncStream *stream)
Get the OrtSyncStreamImpl associated with an OrtSyncStream instance.
Definition onnxruntime_ep_c_api.h:460
OrtStatus * EpGraphSupportInfo_AddSingleNode(OrtEpGraphSupportInfo *graph_support_info, const OrtNode *node)
Specify a node that is supported by an OrtEp and should be run with a registered EP kernel.
OrtStatus * CreateEpDevice(OrtEpFactory *ep_factory, const OrtHardwareDevice *hardware_device, const OrtKeyValuePairs *ep_metadata, const OrtKeyValuePairs *ep_options, OrtEpDevice **ep_device)
Create an OrtEpDevice for the EP and an OrtHardwareDevice.
uint32_t(* MemoryDevice_GetDeviceId)(const OrtMemoryDevice *memory_device)
Get the device ID from an OrtMemoryDevice instance.
Definition onnxruntime_ep_c_api.h:447
OrtDeviceMemoryType(* MemoryDevice_GetMemoryType)(const OrtMemoryDevice *memory_device)
Get the OrtDeviceMemoryType value from an OrtMemoryDevice instance.
Definition onnxruntime_ep_c_api.h:425
OrtStatus * EpGraphSupportInfo_AddNodesToFuse(OrtEpGraphSupportInfo *graph_support_info, const OrtNode *const *nodes, size_t num_nodes, const OrtNodeFusionOptions *node_fusion_options)
Specify nodes that are supported by an OrtEp and should be fused into one node.
const OrtMemoryDevice *(* Value_GetMemoryDevice)(const OrtValue *value)
Get the OrtMemoryDevice from an OrtValue instance if it contains a Tensor.
Definition onnxruntime_ep_c_api.h:394
uint64_t(* SyncStream_GetSyncId)(const OrtSyncStream *stream)
Get the current sync ID for a stream.
Definition onnxruntime_ep_c_api.h:469
OrtStatus * EpDevice_AddAllocatorInfo(OrtEpDevice *ep_device, const OrtMemoryInfo *allocator_memory_info)
Register an allocator with the OrtEpDevice.
The OrtEpFactory provides functions to create and manage execution providers.
Definition onnxruntime_ep_c_api.h:813
OrtStatus * CreateEp(OrtEpFactory *this_ptr, const OrtHardwareDevice *const *devices, const OrtKeyValuePairs *const *ep_metadata_pairs, size_t num_devices, const OrtSessionOptions *session_options, const OrtLogger *logger, OrtEp **ep)
Function to create an OrtEp instance for use in a Session.
bool(* IsStreamAware)(const OrtEpFactory *this_ptr)
Check if execution providers created by the factory are stream aware.
Definition onnxruntime_ep_c_api.h:1006
uint32_t(* GetVendorId)(const OrtEpFactory *this_ptr)
Get the vendor id who owns the execution provider that the factory creates.
Definition onnxruntime_ep_c_api.h:918
OrtStatus * GetSupportedDevices(OrtEpFactory *this_ptr, const OrtHardwareDevice *const *devices, size_t num_devices, OrtEpDevice **ep_devices, size_t max_ep_devices, size_t *num_ep_devices)
Get information from the execution provider about OrtHardwareDevice support.
const char *(* GetVendor)(const OrtEpFactory *this_ptr)
Get the name of vendor who owns the execution provider that the factory creates.
Definition onnxruntime_ep_c_api.h:843
OrtStatus * SetEnvironmentOptions(OrtEpFactory *this_ptr, const OrtKeyValuePairs *options)
Set environment options on this EP factory.
OrtStatus * CreateSyncStreamForDevice(OrtEpFactory *this_ptr, const OrtMemoryDevice *memory_device, const OrtKeyValuePairs *stream_options, OrtSyncStreamImpl **stream)
Create a synchronization stream for the given memory device.
OrtStatus * CreateDataTransfer(OrtEpFactory *this_ptr, OrtDataTransferImpl **data_transfer)
Create an OrtDataTransferImpl instance for the factory.
OrtStatus * ValidateCompiledModelCompatibilityInfo(OrtEpFactory *this_ptr, const OrtHardwareDevice *const *devices, size_t num_devices, const char *compatibility_info, OrtCompiledModelCompatibility *model_compatibility)
Validate the compatibility of a compiled model with the execution provider factory for one or more de...
const char *(* GetVersion)(const OrtEpFactory *this_ptr)
Get the version of the execution provider that the factory creates.
Definition onnxruntime_ep_c_api.h:932
void(* ReleaseAllocator)(OrtEpFactory *this_ptr, OrtAllocator *allocator)
Release an OrtAllocator created by the factory.
Definition onnxruntime_ep_c_api.h:982
uint32_t ort_version_supported
The ONNX Runtime version the execution provider was compiled with.
Definition onnxruntime_ep_c_api.h:821
void(* ReleaseEp)(OrtEpFactory *this_ptr, struct OrtEp *ep)
Release the OrtEp instance.
Definition onnxruntime_ep_c_api.h:907
OrtStatus * CreateAllocator(OrtEpFactory *this_ptr, const OrtMemoryInfo *memory_info, const OrtKeyValuePairs *allocator_options, OrtAllocator **allocator)
Create an OrtAllocator that can be shared across sessions for the given OrtMemoryInfo.
const char *(* GetName)(const OrtEpFactory *this_ptr)
Get the name of the execution provider that the factory creates.
Definition onnxruntime_ep_c_api.h:832
The OrtEp struct provides functions to implement for an execution provider.
Definition onnxruntime_ep_c_api.h:531
void(* ReleaseNodeComputeInfos)(OrtEp *this_ptr, OrtNodeComputeInfo **node_compute_infos, size_t num_node_compute_infos)
Release OrtNodeComputeInfo instances.
Definition onnxruntime_ep_c_api.h:623
OrtStatus * GetPreferredDataLayout(OrtEp *this_ptr, OrtEpDataLayout *preferred_data_layout)
Get the EP's preferred data layout.
const char *(* GetCompiledModelCompatibilityInfo)(OrtEp *this_ptr, const OrtGraph *graph)
Get a string with details about the EP stack used to produce a compiled model.
Definition onnxruntime_ep_c_api.h:770
OrtStatus * CreateAllocator(OrtEp *this_ptr, const OrtMemoryInfo *memory_info, OrtAllocator **allocator)
Create an OrtAllocator for the given OrtMemoryInfo for an OrtSession.
OrtStatus * GetCapability(OrtEp *this_ptr, const OrtGraph *graph, OrtEpGraphSupportInfo *graph_support_info)
Get information about the nodes supported by the OrtEp instance.
OrtStatus * OnRunEnd(OrtEp *this_ptr, const OrtRunOptions *run_options, bool sync_stream)
Called by ORT to notify the EP of the end of a run.
OrtStatus * CreateSyncStreamForDevice(OrtEp *this_ptr, const OrtMemoryDevice *memory_device, OrtSyncStreamImpl **stream)
Create a synchronization stream for the given memory device for an OrtSession.
const char *(* GetName)(const OrtEp *this_ptr)
Get the execution provider name.
Definition onnxruntime_ep_c_api.h:550
OrtStatus * SetDynamicOptions(OrtEp *this_ptr, const char *const *option_keys, const char *const *option_values, size_t num_options)
Set dynamic options on this EP.
OrtStatus * Compile(OrtEp *this_ptr, const OrtGraph **graphs, const OrtNode **fused_nodes, size_t count, OrtNodeComputeInfo **node_compute_infos, OrtNode **ep_context_nodes)
Compile OrtGraph instances assigned to the OrtEp. Implementer must set a OrtNodeComputeInfo instance ...
uint32_t ort_version_supported
The ONNX Runtime version the execution provider was compiled with.
Definition onnxruntime_ep_c_api.h:539
OrtStatus * ShouldConvertDataLayoutForOp(OrtEp *this_ptr, const char *domain, const char *op_type, OrtEpDataLayout target_data_layout, int *should_convert)
Given an op with domain domain and type op_type, determine whether an associated node's data layout s...
OrtStatus * OnRunStart(OrtEp *this_ptr, const OrtRunOptions *run_options)
Called by ORT to notify the EP of the start of a run.
The OrtNodeComputeInfo struct provides functions that an OrtEp implements to specify the compute func...
Definition onnxruntime_ep_c_api.h:230
OrtStatus *(* Compute)(OrtNodeComputeInfo *this_ptr, void *compute_state, OrtKernelContext *kernel_context)
Computation function called to execute the fused node compiled by an OrtEp instance.
Definition onnxruntime_ep_c_api.h:265
uint32_t ort_version_supported
The ONNX Runtime version the OrtNodeComputeInfo was compiled with.
Definition onnxruntime_ep_c_api.h:238
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...
Definition onnxruntime_ep_c_api.h:252
void(* ReleaseState)(OrtNodeComputeInfo *this_ptr, void *compute_state)
Releases the compute state returned by CreateState().
Definition onnxruntime_ep_c_api.h:274
The OrtNodeFusionOptions struct specifies options for fusing nodes supported by an execution provider...
Definition onnxruntime_ep_c_api.h:200
uint32_t ort_version_supported
The ONNX Runtime version the OrtNodeFusionOptions was compiled with.
Definition onnxruntime_ep_c_api.h:208
bool drop_constant_initializers
If set to true, specify that the execution provider does not require ONNX Runtime to provide constant...
Definition onnxruntime_ep_c_api.h:220
Struct that an EP implements for Stream Notifications.
Definition onnxruntime_ep_c_api.h:84
OrtStatus * WaitOnDevice(OrtSyncNotificationImpl *this_ptr, OrtSyncStream *consumer_stream)
Wait for a device to device operation to complete.
uint32_t ort_version_supported
Must be initialized to ORT_API_VERSION.
Definition onnxruntime_ep_c_api.h:85
OrtStatus * Activate(OrtSyncNotificationImpl *this_ptr)
Called by ORT to activate the notification.
OrtStatus * WaitOnHost(OrtSyncNotificationImpl *this_ptr)
Wait for a device to host operation to complete.
void(* Release)(OrtSyncNotificationImpl *this_ptr)
Release the OrtSyncNotificationImpl instance.
Definition onnxruntime_ep_c_api.h:96
Struct that an EP implements if it wishes to implement Stream support.
Definition onnxruntime_ep_c_api.h:130
void *(* GetHandle)(OrtSyncStreamImpl *this_ptr)
Get the handle of the stream.
Definition onnxruntime_ep_c_api.h:153
uint32_t ort_version_supported
Must be initialized to ORT_API_VERSION.
Definition onnxruntime_ep_c_api.h:131
OrtStatus * Flush(OrtSyncStreamImpl *this_ptr)
Flush the stream.
OrtStatus * CreateNotification(OrtSyncStreamImpl *this_ptr, OrtSyncNotificationImpl **notification)
Create an OrtSyncNotificationImpl for the OrtSyncStreamImpl instance.
OrtStatus * OnSessionRunEnd(OrtSyncStreamImpl *this_ptr)
Notify the stream that a session run has ended.
void(* Release)(OrtSyncStreamImpl *this_ptr)
Release the OrtSyncStreamImpl instance.
Definition onnxruntime_ep_c_api.h:142