The OrtEpFactory provides functions to create and manage execution providers.
More...
#include <onnxruntime_c_api.h>
|
uint32_t | ort_version_supported |
| The ONNX Runtime version the execution provider was compiled with.
|
|
const char *(* | GetName )(const OrtEpFactory *this_ptr) |
| Get the name the of the execution provider that the factory creates.
|
|
const char *(* | GetVendor )(const OrtEpFactory *this_ptr) |
| Get the name of vendor who owns the execution provider that the factory creates.
|
|
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 if it supports the OrtHardwareDevice.
|
|
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.
|
|
void(* | ReleaseEp )(OrtEpFactory *this_ptr, struct OrtEp *ep) |
| Release the OrtEp instance.
|
|
The OrtEpFactory provides functions to create and manage execution providers.
- Since
- Version 1.22.
◆ CreateEp
Function to create an OrtEp instance for use in a Session.
ORT will call ReleaseEp to release the instance when it is no longer needed.
- Parameters
-
[in] | this_ptr | The OrtEpFactory instance. |
[in] | devices | The OrtHardwareDevice instances that the execution provider was selected to use. |
[in] | ep_metadata_pairs | Execution provider metadata that was provided to OrtEpApi::CreateEpDevice, for each device. |
[in] | num_devices | The number of devices the execution provider was selected for. |
[in] | session_options | The OrtSessionOptions instance that contains the configuration options for the session. This will include ep_options from GetSupportedDevices as well as any user provided overrides. Execution provider options will have been added with a prefix of 'ep.[ep name].'. The OrtSessionOptions instance will NOT be valid after this call and should not be stored for later use. |
[in] | logger | The OrtLogger instance for the session that the execution provider should use for logging. |
[out] | ep | The OrtEp instance created by the factory. |
- 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 [coming soon]. This is a placeholder.
◆ GetName
const char *( * OrtEpFactory::GetName) (const OrtEpFactory *this_ptr) |
Get the name the of the execution provider that the factory creates.
- Parameters
-
- Returns
- The name of the execution provider the factory creates.
- Since
- Version 1.22.
◆ GetSupportedDevices
Get information from the execution provider if it supports the OrtHardwareDevice.
- Parameters
-
[in] | this_ptr | The OrtEpFactory instance. Non-const as the factory is passed through to the CreateEp call via the OrtEpDevice. |
[in] | devices | The OrtHardwareDevice instances that are available. |
[in] | num_devices | The number of OrtHardwareDevice instances. |
[out] | ep_devices | OrtEpDevice instances for each OrtHardwareDevice that the EP can use. The implementation should call OrtEpApi::CreateEpDevice to create, and add the OrtEpDevice instances to this pre-allocated array. ORT will take ownership of the values returned. i.e. usage is ep_devices[0] = <ptr to OrtEpDevice created with OrtEpApi::CreateEpDevice>; |
[in] | max_ep_devices | The maximum number of OrtEpDevices that can be added to ep_devices. Current default is 8. This can be increased if needed. |
[out] | num_ep_devices | The number of EP devices added to ep_devices. |
- Returns
- true if the factory can create an execution provider that uses
device
.
- Note
- ORT will take ownership or ep_metadata and/or ep_options if they are not null.
- Since
- Version 1.22.
◆ GetVendor
const char *( * OrtEpFactory::GetVendor) (const OrtEpFactory *this_ptr) |
Get the name of vendor who owns the execution provider that the factory creates.
- Parameters
-
- Returns
- vendor The vendor name of the execution provider the factory creates.
- Since
- Version 1.22.
◆ ort_version_supported
uint32_t OrtEpFactory::ort_version_supported |
The ONNX Runtime version the execution provider 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 library was compiled.
- Since
- Version 1.22.
◆ ReleaseEp
Release the OrtEp instance.
- Parameters
-
- Since
- Version [coming soon]. This is a placeholder.