![]() |
ONNX Runtime
|
The OrtEpApi struct provides functions that are relevant to the implementation of an execution provider. More...
#include <onnxruntime_ep_c_api.h>
Public Member Functions | |
| 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. | |
| void | ReleaseEpDevice (OrtEpDevice *input) |
| 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. | |
| 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 * | EpDevice_AddAllocatorInfo (OrtEpDevice *ep_device, const OrtMemoryInfo *allocator_memory_info) |
| Register an allocator with the OrtEpDevice. | |
| 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. | |
| void | ReleaseHardwareDevice (OrtHardwareDevice *input) |
| OrtStatus * | CreateKernelRegistry (OrtKernelRegistry **kernel_registry) |
| Creates an empty kernel registry. A kernel registry contains kernel creation information for every operator kernel supported by an EP. | |
| void | ReleaseKernelRegistry (OrtKernelRegistry *input) |
| OrtStatus * | KernelRegistry_AddKernel (OrtKernelRegistry *kernel_registry, const OrtKernelDef *kernel_def, OrtKernelCreateFunc kernel_create_func, void *kernel_create_func_state) |
| Adds kernel creation information for a supported operator kernel to the given kernel registry. | |
| OrtStatus * | CreateKernelDefBuilder (OrtKernelDefBuilder **kernel_def_builder_out) |
| Creates a kernel definition builder used to create instances of OrtKernelDef. | |
| void | ReleaseKernelDefBuilder (OrtKernelDefBuilder *input) |
| OrtStatus * | KernelDefBuilder_SetOperatorType (OrtKernelDefBuilder *kernel_def_builder, const char *op_type) |
| Sets the kernel's operator type. | |
| OrtStatus * | KernelDefBuilder_SetDomain (OrtKernelDefBuilder *kernel_def_builder, const char *domain) |
| Sets the kernel's domain. | |
| OrtStatus * | KernelDefBuilder_SetSinceVersion (OrtKernelDefBuilder *kernel_def_builder, int since_version_start, int since_version_end) |
| Sets the kernel's opset version range that is supported. | |
| OrtStatus * | KernelDefBuilder_SetExecutionProvider (OrtKernelDefBuilder *kernel_def_builder, const char *ep_name) |
| Sets the name of the kernel's intended execution provider. | |
| OrtStatus * | KernelDefBuilder_SetInputMemType (OrtKernelDefBuilder *kernel_def_builder, size_t input_index, OrtMemType mem_type) |
| Sets the memory type for a kernel input. | |
| OrtStatus * | KernelDefBuilder_SetOutputMemType (OrtKernelDefBuilder *kernel_def_builder, size_t output_index, OrtMemType mem_type) |
| Sets the memory type for a kernel output. | |
| OrtStatus * | KernelDefBuilder_AddTypeConstraint (OrtKernelDefBuilder *kernel_def_builder, const char *arg_name, const OrtDataType *const *types, size_t num_types) |
| Adds type constraints for a kernel argument represented as a string (e.g., "T"). | |
| OrtStatus * | KernelDefBuilder_AddInputOutputAliases (OrtKernelDefBuilder *kernel_def_builder, int const *input_indices, int const *output_indices, size_t num_io_indices) |
| Adds aliases for the given input and output pairs. | |
| OrtStatus * | KernelDefBuilder_AddInputOutputMutableAliases (OrtKernelDefBuilder *kernel_def_builder, int const *input_indices, int const *output_indices, size_t num_io_indices) |
| Adds mutable aliases for the given input and output pairs. | |
| OrtStatus * | KernelDefBuilder_Build (OrtKernelDefBuilder *kernel_def_builder, OrtKernelDef **kernel_def_out) |
| Creates a OrtKernelDef instance from the given kernel definition builder. | |
| void | ReleaseKernelDef (OrtKernelDef *input) |
| OrtStatus * | KernelDef_GetSinceVersion (const OrtKernelDef *kernel_def, int *start_version, int *end_version) |
| Gets the kernel's opset version range that is supported. | |
| OrtStatus * | KernelDef_GetInputMemType (const OrtKernelDef *kernel_def, size_t input_index, OrtMemType *mem_type) |
| Gets the memory type for a kernel input. | |
| OrtStatus * | KernelDef_GetOutputMemType (const OrtKernelDef *kernel_def, size_t output_index, OrtMemType *mem_type) |
| Gets the memory type for a kernel output. | |
| OrtStatus * | GetTensorDataType (ONNXTensorElementDataType elem_type, const OrtDataType **out) |
| Gets the OrtDataType that represents the data type for a tensor of the given element type. | |
| OrtStatus * | EpGraphSupportInfo_LookUpKernel (OrtEpGraphSupportInfo *graph_support_info, const OrtNode *node, const OrtKernelDef **out_kernel_def) |
| Gets the kernel definition for a given node, if any exists for the calling execution provider. | |
| OrtStatus * | SharedPrePackedWeightCache_StoreWeightData (OrtSharedPrePackedWeightCache *prepacked_weight_cache, void **buffer_data_ptrs, size_t *buffer_data_sizes, size_t num_buffers) |
| Sets one or more data buffers that collectively hold the pre-packed data for a single shared weight. | |
| OrtStatus * | KernelInfo_GetEp (const OrtKernelInfo *info, const OrtEp **ep) |
| Get the OrtEp instance to which the node is assigned from the OrtKernelInfo. | |
| OrtStatus * | DeviceEpIncompatibilityDetails_SetDetails (OrtDeviceEpIncompatibilityDetails *details, uint32_t reasons_bitmask, int32_t error_code, const char *notes) |
| Set the details of an OrtDeviceEpIncompatibilityDetails instance. | |
| OrtStatus * | CreateIfKernel (const OrtKernelInfo *kernel_info, OrtKernelImpl **kernel_out) |
| Creates an OrtKernelImpl instance for an If operator. | |
| OrtStatus * | CreateLoopKernel (const OrtKernelInfo *kernel_info, OrtLoopKernelHelper *helper, OrtKernelImpl **kernel_out) |
| Creates an OrtKernelImpl instance for a Loop operator. | |
| OrtStatus * | CreateScanKernel (const OrtKernelInfo *kernel_info, OrtScanKernelHelper *helper, OrtKernelImpl **kernel_out) |
| Creates an OrtKernelImpl instance for a Scan operator. Does not support opset versions older than 9. | |
| void | ReleaseKernelImpl (OrtKernelImpl *input) |
| OrtStatus * | GetEnvConfigEntries (OrtKeyValuePairs **config_entries) |
| Gets a new OrtKeyValuePairs instance containing a copy of all configuration entries set on the environment. | |
| OrtStatus * | GetOpSchema (const char *name, int max_inclusive_version, const char *domain, OrtOpSchema **out_schema) |
| Get an operator schema from the global schema registry. | |
| void | ReleaseOpSchema (OrtOpSchema *input) |
| OrtStatus * | OpSchema_GetSinceVersion (const OrtOpSchema *schema, int *out) |
| Get the first ONNX opset version that introduced this operator schema. | |
| OrtStatus * | OpSchema_GetNumInputs (const OrtOpSchema *schema, size_t *out) |
| Get the number of inputs defined by the operator schema. | |
| OrtStatus * | OpSchema_GetInputName (const OrtOpSchema *schema, size_t index, const char **out) |
| Get the name of the i-th input formal parameter from an operator schema. | |
| OrtStatus * | OpSchema_GetInputTypeConstraint (const OrtOpSchema *schema, size_t index, const OrtOpSchemaTypeConstraint **out) |
| Get the type constraint for the i-th input formal parameter from an operator schema. | |
| OrtStatus * | OpSchema_GetNumOutputs (const OrtOpSchema *schema, size_t *out) |
| Get the number of outputs defined by the operator schema. | |
| OrtStatus * | OpSchema_GetOutputName (const OrtOpSchema *schema, size_t index, const char **out) |
| Get the name of the i-th output formal parameter from an operator schema. | |
| OrtStatus * | OpSchema_GetOutputTypeConstraint (const OrtOpSchema *schema, size_t index, const OrtOpSchemaTypeConstraint **out) |
| Get the type constraint for the i-th output formal parameter from an operator schema. | |
| OrtStatus * | OpSchema_GetTypeConstraintCount (const OrtOpSchema *schema, size_t *out) |
| Get the number of unique type constraints in the operator schema. | |
| OrtStatus * | OpSchema_GetTypeConstraint (const OrtOpSchema *schema, size_t index, const OrtOpSchemaTypeConstraint **out) |
| Get the i-th type constraint from the operator schema. | |
| OrtStatus * | OpSchemaTypeConstraint_GetTypeParamName (const OrtOpSchemaTypeConstraint *type_constraint, const char **out) |
| Get the type parameter name of a type constraint (e.g., "T", "T1"). | |
| OrtStatus * | OpSchemaTypeConstraint_GetAllowedTypes (const OrtOpSchemaTypeConstraint *type_constraint, const char *const **out_types, size_t *num_types) |
| Get the allowed type strings for a type constraint. | |
| OrtStatus * | OpSchemaTypeConstraint_GetInputIndices (const OrtOpSchemaTypeConstraint *type_constraint, const size_t **out_indices, size_t *count) |
| Get the input indices that use a type constraint. | |
| OrtStatus * | OpSchemaTypeConstraint_GetOutputIndices (const OrtOpSchemaTypeConstraint *type_constraint, const size_t **out_indices, size_t *count) |
| Get the output indices that use a type constraint. | |
| OrtStatus * | CreateProfilingEvent (OrtProfilingEventCategory category, int32_t process_id, int32_t thread_id, const char *event_name, int64_t timestamp_us, int64_t duration_us, const char *const *arg_keys, const char *const *arg_values, size_t num_args, OrtProfilingEvent **out) |
| Create a profiling event. | |
| void | ReleaseProfilingEvent (OrtProfilingEvent *input) |
| Release an opaque profiling event created via CreateProfilingEvent. | |
| OrtStatus * | ProfilingEvent_GetCategory (const OrtProfilingEvent *event, OrtProfilingEventCategory *out) |
| Get the event category of a profiling event. | |
| OrtStatus * | ProfilingEvent_GetName (const OrtProfilingEvent *event, const char **out) |
| Get the event name of a profiling event. | |
| OrtStatus * | ProfilingEvent_GetTimestampUs (const OrtProfilingEvent *event, int64_t *out) |
| Get the start timestamp of a profiling event in microseconds. | |
| OrtStatus * | ProfilingEvent_GetDurationUs (const OrtProfilingEvent *event, int64_t *out) |
| Get the duration of a profiling event in microseconds. | |
| OrtStatus * | ProfilingEvent_GetArgValue (const OrtProfilingEvent *event, const char *key, const char **out) |
| Get the value of an event argument by its key. | |
| OrtStatus * | ProfilingEventsContainer_AddEvents (OrtProfilingEventsContainer *events_container, const OrtProfilingEvent *const *events, size_t num_events) |
| Add EP profiling events to an events container. | |
Public Attributes | |
| const char *(* | NodeComputeContext_NodeName )(const OrtNodeComputeContext *context) |
| Query a OrtNodeComputeContext for the name of the node that encapsulates the compiled/fused node. | |
| const OrtMemoryDevice *(* | MemoryInfo_GetMemoryDevice )(const OrtMemoryInfo *memory_info) |
| Get the OrtMemoryDevice from an OrtMemoryInfo instance. | |
| const OrtMemoryDevice *(* | Value_GetMemoryDevice )(const OrtValue *value) |
| Get the OrtMemoryDevice from an OrtValue instance if it contains a Tensor. | |
| bool(* | MemoryDevice_AreEqual )(const OrtMemoryDevice *a, const OrtMemoryDevice *b) |
| Compare two OrtMemoryDevice instances for equality. | |
| OrtMemoryInfoDeviceType(* | MemoryDevice_GetDeviceType )(const OrtMemoryDevice *memory_device) |
| Get the OrtMemoryInfoDeviceType value from an OrtMemoryDevice instance. | |
| OrtDeviceMemoryType(* | MemoryDevice_GetMemoryType )(const OrtMemoryDevice *memory_device) |
| Get the OrtDeviceMemoryType value from an OrtMemoryDevice instance. | |
| uint32_t(* | MemoryDevice_GetVendorId )(const OrtMemoryDevice *memory_device) |
| Get the vendor ID from an OrtMemoryDevice instance. | |
| uint32_t(* | MemoryDevice_GetDeviceId )(const OrtMemoryDevice *memory_device) |
| Get the device ID from an OrtMemoryDevice instance. | |
| const OrtSyncStreamImpl *(* | SyncStream_GetImpl )(const OrtSyncStream *stream) |
| Get the OrtSyncStreamImpl associated with an OrtSyncStream instance. | |
| uint64_t(* | SyncStream_GetSyncId )(const OrtSyncStream *stream) |
| Get the current sync ID for a stream. | |
| 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. | |
| const char *(* | KernelDef_GetOperatorType )(const OrtKernelDef *kernel_def) |
| Returns the operator type from the kernel definition. | |
| const char *(* | KernelDef_GetDomain )(const OrtKernelDef *kernel_def) |
| Returns the operator's domain from the kernel definition. | |
| const char *(* | KernelDef_GetExecutionProvider )(const OrtKernelDef *kernel_def) |
| Returns the name of the kernel's intended execution provider. | |
The OrtEpApi struct provides functions that are relevant to the implementation of an execution provider.
| OrtStatus * OrtEpApi::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.
| [in] | ep_factory | Execution provider factory that is creating the instance. |
| [in] | hardware_device | Hardware device that the EP can utilize. |
| [in] | ep_metadata | Optional OrtKeyValuePairs instance for execution provider metadata that may be used during execution provider selection and passed to CreateEp. ep_device will copy this instance and the user should call ReleaseKeyValuePairs. |
| [in] | ep_options | Optional OrtKeyValuePairs instance for execution provider options that will be added to the Session configuration options if the execution provider is selected. ep_device will copy this instance and the user should call ReleaseKeyValuePairs. |
| ep_device | OrtExecutionDevice that is created. |
| OrtStatus * OrtEpApi::CreateHardwareDevice | ( | OrtHardwareDeviceType | type, |
| uint32_t | vendor_id, | ||
| uint32_t | device_id, | ||
| const char * | vendor_name, | ||
| const OrtKeyValuePairs * | metadata, | ||
| OrtHardwareDevice ** | hardware_device | ||
| ) |
Create an OrtHardwareDevice.
| [in] | type | The hardware device type. |
| [in] | vendor_id | The hardware device's vendor identifier. |
| [in] | device_id | The hardware device's identifier. |
| [in] | vendor_name | The hardware device's vendor name as a null-terminated string. Copied by ORT. |
| [in] | metadata | Optional OrtKeyValuePairs instance for hardware device metadata that may be queried by applications via OrtApi::GetEpDevices(). Refer to onnxruntime_ep_device_ep_metadata_keys.h for common OrtHardwareDevice metadata keys. |
| [out] | hardware_device | Output parameter set to the new OrtHardwareDevice instance that is created. Must be release with ReleaseHardwareDevice(). |
| OrtStatus * OrtEpApi::CreateIfKernel | ( | const OrtKernelInfo * | kernel_info, |
| OrtKernelImpl ** | kernel_out | ||
| ) |
Creates an OrtKernelImpl instance for an If operator.
Control flow operators require access to ORT session internals to orchestrate subgraph operations. This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that the EP can add to its kernel registry.
An EP is required to create an OrtKernelDef that keeps input[0] ('cond') on the CPU (i.e., OrtMemTypeCPUInput) as this input is used by CPU logic. The output should remain on the device (i.e., OrtMemTypeDefault), which is the default setting, to avoid copying to/from CPU.
Example kernel definition (CXX API): Ort::KernelDef kernel_def = Ort::KernelDefBuilder() .SetDomain("").SetOperatorType("If").SetSinceVersion(21, 22) .SetExecutionProvider("MyEp") .SetInputMemType(0, OrtMemTypeCPUInput) // 'cond' on CPU .SetOutputMemType(0, OrtMemTypeDefault) // output on EP device .AddTypeConstraint("B", ...) .AddTypeConstraint("V", ...).Build();
| [in] | kernel_info | The OrtKernelInfo instance for an If node. This function returns error ORT_FAIL if the opset version specified by kernel_info is unsupported. |
| [out] | kernel_out | Output parameter set to the OrtKernelImpl instance for the If node. Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). |
| OrtStatus * OrtEpApi::CreateKernelDefBuilder | ( | OrtKernelDefBuilder ** | kernel_def_builder_out | ) |
Creates a kernel definition builder used to create instances of OrtKernelDef.
| [out] | kernel_def_builder_out | Output parameter set to the new OrtKernelDefBuilder instance. Must be released with OrtEpApi::ReleaseKernelDefBuilder(). |
| OrtStatus * OrtEpApi::CreateKernelRegistry | ( | OrtKernelRegistry ** | kernel_registry | ) |
Creates an empty kernel registry. A kernel registry contains kernel creation information for every operator kernel supported by an EP.
| [out] | kernel_registry | Output parameter set to the new OrtKernelRegistry instance. Must be released with OrtEpApi::ReleaseKernelRegistry. |
| OrtStatus * OrtEpApi::CreateLoopKernel | ( | const OrtKernelInfo * | kernel_info, |
| OrtLoopKernelHelper * | helper, | ||
| OrtKernelImpl ** | kernel_out | ||
| ) |
Creates an OrtKernelImpl instance for a Loop operator.
Control flow operators require access to ORT session internals to orchestrate subgraph operations. This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that the EP can add to its kernel registry.
An EP is required to create an OrtKernelDef that keeps input[0] ('M') and input[1] ('cond') on the CPU (i.e., OrtMemTypeCPUInput) as these inputs are used by CPU logic. Input[2] ('v_initial') and the output should remain on the device (i.e., OrtMemTypeDefault), which is the default setting, to avoid copying to/from CPU.
Example kernel definition (CXX API): Ort::KernelDef kernel_def = Ort::KernelDefBuilder() .SetDomain("").SetOperatorType("Loop").SetSinceVersion(21, 22) .SetExecutionProvider("MyEp") .SetInputMemType(0, OrtMemTypeCPUInput) // 'M' on CPU .SetInputMemType(1, OrtMemTypeCPUInput) // 'cond' on CPU .SetInputMemType(2, OrtMemTypeDefault) // 'v_initial' on EP device .SetOutputMemType(0, OrtMemTypeDefault) // output on EP device .AddTypeConstraint("I", ...) .AddTypeConstraint("B", ...) .AddTypeConstraint("V", ...).Build();
| [in] | kernel_info | The OrtKernelInfo instance for a Loop node. This function returns error ORT_FAIL if the opset version specified by kernel_info is unsupported. |
| [in] | helper | A OrtLoopKernelHelper instance that contains helper functions that ORT calls during kernel execution to operate on tensors allocated with the EP's device memory. ORT will call OrtLoopKernelHelper::Release() to release the helper and its resources. |
| [out] | kernel_out | Output parameter set to the OrtKernelImpl instance for the Loop node. Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). |
| OrtStatus * OrtEpApi::CreateProfilingEvent | ( | OrtProfilingEventCategory | category, |
| int32_t | process_id, | ||
| int32_t | thread_id, | ||
| const char * | event_name, | ||
| int64_t | timestamp_us, | ||
| int64_t | duration_us, | ||
| const char *const * | arg_keys, | ||
| const char *const * | arg_values, | ||
| size_t | num_args, | ||
| OrtProfilingEvent ** | out | ||
| ) |
Create a profiling event.
An EP profiler calls this to create an event to pass to OrtEpApi::ProfilingEventsContainer_AddEvents. The returned event must be released via OrtEpApi::ReleaseProfilingEvent after it has been added.
| [in] | category | The event category (e.g., session, node, kernel, or API). |
| [in] | process_id | Process ID. Set to -1 if does not apply. |
| [in] | thread_id | Thread ID. Set to -1 if does not apply. |
| [in] | event_name | Null-terminated string representing the event name. ORT copies this string. |
| [in] | timestamp_us | Starting timestamp in microseconds relative to the profiling start time. An OrtEpProfilerImpl should record its own clock's profiling start time and use the ep_profiling_start_offset_ns value passed to OrtEpProfilerImpl::StartProfiling to compute this value as: timestamp_us = (ep_profiling_start_offset_ns + (ep_event_time_ns - ep_profiling_start_time_ns)) / 1000 |
| [in] | duration_us | Duration in microseconds. |
| [in] | arg_keys | Array of null-terminated argument key strings. Can be NULL if num_args is 0. ORT copies these strings. |
| [in] | arg_values | Array of null-terminated argument value strings. Can be NULL if num_args is 0. ORT copies these strings. |
| [in] | num_args | Number of key-value argument pairs. |
| [out] | out | Output parameter set to the created profiling event. |
| OrtStatus * OrtEpApi::CreateScanKernel | ( | const OrtKernelInfo * | kernel_info, |
| OrtScanKernelHelper * | helper, | ||
| OrtKernelImpl ** | kernel_out | ||
| ) |
Creates an OrtKernelImpl instance for a Scan operator. Does not support opset versions older than 9.
Control flow operators require access to ORT session internals to orchestrate subgraph operations. This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that the EP can add to its kernel registry.
It is recommended that an EP create an OrtKernelDef that keeps the inputs and outputs on the EP's device (i.e., OrtMemTypeDefault), which is the default setting, to avoid copying to/from CPU.
Example kernel definition (CXX API): Ort::KernelDef kernel_def = Ort::KernelDefBuilder() .SetDomain("").SetOperatorType("Scan").SetSinceVersion(21, 22) .SetExecutionProvider("MyEp") .SetInputMemType(0, OrtMemTypeDefault) // input[0] on EP device .SetOutputMemType(0, OrtMemTypeDefault) // output[0] on EP device .AddTypeConstraint("V", ...).Build();
| [in] | kernel_info | The OrtKernelInfo instance for a Scan node. This function returns error ORT_FAIL if the opset version specified by kernel_info is unsupported. |
| [in] | helper | A OrtScanKernelHelper instance that contains helper functions that ORT calls during kernel execution to operate on tensors allocated with the EP's device memory. ORT will call OrtScanKernelHelper::Release() to release the helper and its resources. |
| [out] | kernel_out | Output parameter set to the OrtKernelImpl instance for the Scan node. Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). |
| OrtStatus * OrtEpApi::DeviceEpIncompatibilityDetails_SetDetails | ( | OrtDeviceEpIncompatibilityDetails * | details, |
| uint32_t | reasons_bitmask, | ||
| int32_t | error_code, | ||
| const char * | notes | ||
| ) |
Set the details of an OrtDeviceEpIncompatibilityDetails instance.
Used by execution provider factories to set incompatibility details in their GetHardwareDeviceIncompatibilityDetails implementation. ORT creates and initializes the object before passing it to the EP, so calling this function is optional. The EP uses this function to set incompatibility information when the device is not compatible.
| [in,out] | details | The OrtDeviceEpIncompatibilityDetails instance to update. |
| [in] | reasons_bitmask | Bitmask of OrtDeviceEpIncompatibilityReason values. (0 = no incompatibility). |
| [in] | error_code | Optional EP-specific error code (0 = no error). |
| [in] | notes | Optional human-readable notes. Can be null. |
| OrtStatus * OrtEpApi::EpDevice_AddAllocatorInfo | ( | OrtEpDevice * | ep_device, |
| const OrtMemoryInfo * | allocator_memory_info | ||
| ) |
Register an allocator with the OrtEpDevice.
This allows an EP to provide OrtMemoryInfo for DEFAULT and HOST_ACCESSIBLE memory type as needed. The registered values will be used in calls to OrtEpFactory::CreateAllocator to ensure the required allocator/s are available for EP usage.
Multiple calls for the same entry type will replace a previous entry.
Available entries:
| [in] | ep_device | The OrtEpDevice instance to register the OrtMemoryInfo with. |
| [in] | allocator_memory_info | The OrtMemoryInfo information for the allocator. |
| OrtStatus * OrtEpApi::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.
Because the nodes will be fused into one "fused node", there must not exist an unsupported node in a path between two of the provided nodes. Otherwise, the graph will become invalid.
This function can be called multiple times. A subsequent call to this function will force the next set of nodes to be fused into a different node.
| [in] | graph_support_info | OrtEpGraphSupportInfo instance to which to add the supported nodes. |
| [in] | nodes | Array of nodes supported by the EP that should be fused/compiled. |
| [in] | num_nodes | The number of supported nodes. |
| [in] | node_fusion_options | Optional node fusion options. Ignored if set to NULL. |
| OrtStatus * OrtEpApi::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.
| [in] | graph_support_info | OrtEpGraphSupportInfo instance to which to add the supported node. |
| [in] | node | The supported OrtNode instance. |
| OrtStatus * OrtEpApi::EpGraphSupportInfo_LookUpKernel | ( | OrtEpGraphSupportInfo * | graph_support_info, |
| const OrtNode * | node, | ||
| const OrtKernelDef ** | out_kernel_def | ||
| ) |
Gets the kernel definition for a given node, if any exists for the calling execution provider.
Used within OrtEp::GetCapability() to get the registered kernel definition for the given node. The kernel definition is set to NULL if there is no registered kernel definition for the node and execution provider.
| [in] | graph_support_info | The OrtEpGraphSupportInfo instance to query. |
| [in] | node | The node for which to look up a kernel definition. |
| [out] | out_kernel_def | Output parameter set to the OrtKernelDef or NULL. Owned by ORT and must not be released. |
| OrtStatus * OrtEpApi::GetEnvConfigEntries | ( | OrtKeyValuePairs ** | config_entries | ) |
Gets a new OrtKeyValuePairs instance containing a copy of all configuration entries set on the environment.
| [out] | config_entries | Output parameter set to the OrtKeyValuePairs instance containing all configuration entries. Must be released via OrtApi::ReleaseKeyValuePairs. |
| OrtStatus * OrtEpApi::GetOpSchema | ( | const char * | name, |
| int | max_inclusive_version, | ||
| const char * | domain, | ||
| OrtOpSchema ** | out_schema | ||
| ) |
Get an operator schema from the global schema registry.
Looks up a schema by name, maximum inclusive version, and domain. The returned pointer is owned by the caller and must be released via ReleaseOpSchema. If the schema is not found, *out_schema is set to nullptr (no allocation occurs).
Available schemas include standard ONNX operators (domain "" or "ai.onnx"), ONNX ML operators (domain "ai.onnx.ml"), and ORT contrib operators (domain "com.microsoft").
| [in] | name | A null-terminated string for the operator name. |
| [in] | max_inclusive_version | The maximum inclusive opset version. |
| [in] | domain | A null-terminated string for the operator domain. |
| [out] | out_schema | Output parameter set to the schema pointer, or nullptr if not found. Must be released via OrtEpApi::ReleaseOpSchema. |
| OrtStatus * OrtEpApi::GetTensorDataType | ( | ONNXTensorElementDataType | elem_type, |
| const OrtDataType ** | out | ||
| ) |
Gets the OrtDataType that represents the data type for a tensor of the given element type.
| [in] | elem_type | The tensor's element type. |
| [out] | out | Output parameter set to the OrtDataType. Owned by ORT and must not be released. |
| OrtStatus * OrtEpApi::KernelDef_GetInputMemType | ( | const OrtKernelDef * | kernel_def, |
| size_t | input_index, | ||
| OrtMemType * | mem_type | ||
| ) |
Gets the memory type for a kernel input.
| [in] | kernel_def | The OrtKernelDef instance. |
| [in] | input_index | The index of the input. |
| [out] | mem_type | Output parameter set to the input's memory type. |
| OrtStatus * OrtEpApi::KernelDef_GetOutputMemType | ( | const OrtKernelDef * | kernel_def, |
| size_t | output_index, | ||
| OrtMemType * | mem_type | ||
| ) |
Gets the memory type for a kernel output.
| [in] | kernel_def | The OrtKernelDef instance. |
| [in] | output_index | The index of the output. |
| [out] | mem_type | Output parameter set to the output's memory type. |
| OrtStatus * OrtEpApi::KernelDef_GetSinceVersion | ( | const OrtKernelDef * | kernel_def, |
| int * | start_version, | ||
| int * | end_version | ||
| ) |
Gets the kernel's opset version range that is supported.
| [in] | kernel_def | The OrtKernelDef instance. |
| [out] | start_version | Output parameter set to the starting opset version that is supported. |
| [out] | end_version | Output parameter set to the ending opset version (inclusive) that is supported. |
| OrtStatus * OrtEpApi::KernelDefBuilder_AddInputOutputAliases | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| int const * | input_indices, | ||
| int const * | output_indices, | ||
| size_t | num_io_indices | ||
| ) |
Adds aliases for the given input and output pairs.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | input_indices | Array of input indices. Array must contain num_io_indices elements. |
| [in] | output_indices | Array of output indices. Each output index is aliased with a corresponding input index in input_indices. Array must contain num_io_indices elements. |
| [in] | num_io_indices | The number of input/output index pairs to alias. |
| OrtStatus * OrtEpApi::KernelDefBuilder_AddInputOutputMutableAliases | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| int const * | input_indices, | ||
| int const * | output_indices, | ||
| size_t | num_io_indices | ||
| ) |
Adds mutable aliases for the given input and output pairs.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | input_indices | Array of input indices. Array must contain num_io_indices elements. |
| [in] | output_indices | Array of output indices. Each output index is aliased with a corresponding input index in input_indices. Array must contain num_io_indices elements. |
| [in] | num_io_indices | The number of input/output index pairs to alias. |
| OrtStatus * OrtEpApi::KernelDefBuilder_AddTypeConstraint | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| const char * | arg_name, | ||
| const OrtDataType *const * | types, | ||
| size_t | num_types | ||
| ) |
Adds type constraints for a kernel argument represented as a string (e.g., "T").
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | arg_name | A null-terminated string representing the argument to constrain (e.g., "T"). |
| [in] | types | Array of OrtDataType instances representing allowed types for the argument. Must contain num_types elements. |
| [in] | num_types | The number of OrtDataType elements in the types array. |
| OrtStatus * OrtEpApi::KernelDefBuilder_Build | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| OrtKernelDef ** | kernel_def_out | ||
| ) |
Creates a OrtKernelDef instance from the given kernel definition builder.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [out] | kernel_def_out | The new OrtKernelDef instance. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetDomain | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| const char * | domain | ||
| ) |
Sets the kernel's domain.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | domain | A null-terminated string representing the operator's domain. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetExecutionProvider | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| const char * | ep_name | ||
| ) |
Sets the name of the kernel's intended execution provider.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | ep_name | A null-terminated string representing the execution provider's name. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetInputMemType | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| size_t | input_index, | ||
| OrtMemType | mem_type | ||
| ) |
Sets the memory type for a kernel input.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | input_index | The index of the input. |
| [in] | mem_type | The input's memory type. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetOperatorType | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| const char * | op_type | ||
| ) |
Sets the kernel's operator type.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | op_type | A null-terminated string representing the operator type. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetOutputMemType | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| size_t | output_index, | ||
| OrtMemType | mem_type | ||
| ) |
Sets the memory type for a kernel output.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | output_index | The index of the output. |
| [in] | mem_type | The output's memory type. |
| OrtStatus * OrtEpApi::KernelDefBuilder_SetSinceVersion | ( | OrtKernelDefBuilder * | kernel_def_builder, |
| int | since_version_start, | ||
| int | since_version_end | ||
| ) |
Sets the kernel's opset version range that is supported.
| [in] | kernel_def_builder | The OrtKernelDefBuilder instance. |
| [in] | since_version_start | The starting opset version that is supported. |
| [in] | since_version_end | The ending opset version (inclusive) that is supported. Can be set equal to the starting version to indicate that only one version is supported. |
| OrtStatus * OrtEpApi::KernelInfo_GetEp | ( | const OrtKernelInfo * | info, |
| const OrtEp ** | ep | ||
| ) |
Get the OrtEp instance to which the node is assigned from the OrtKernelInfo.
| [in] | info | The OrtKernelInfo instance. |
| [out] | ep | Output parameter set to the OrtEp instance associated with the OrtKernelInfo. |
| OrtStatus * OrtEpApi::KernelRegistry_AddKernel | ( | OrtKernelRegistry * | kernel_registry, |
| const OrtKernelDef * | kernel_def, | ||
| OrtKernelCreateFunc | kernel_create_func, | ||
| void * | kernel_create_func_state | ||
| ) |
Adds kernel creation information for a supported operator kernel to the given kernel registry.
| [in] | kernel_registry | The OrtKernelRegistry instance. |
| [in] | kernel_def | The kernel definition, which includes operator type, version, EP name, type constraints, etc. |
| [in] | kernel_create_func | Function that creates an instance of the operator kernel as a OrtKernelImpl instance. |
| [in] | kernel_create_func_state | Custom state passed to the kernel creation function. Can be null. |
| OrtStatus * OrtEpApi::OpSchema_GetInputName | ( | const OrtOpSchema * | schema, |
| size_t | index, | ||
| const char ** | out | ||
| ) |
Get the name of the i-th input formal parameter from an operator schema.
| [in] | schema | The OrtOpSchema instance. |
| [in] | index | Zero-based index of the input parameter. |
| [out] | out | Output parameter set to the name of the input parameter (null-terminated UTF8 string). Valid as long as the OrtOpSchema exists. |
| OrtStatus * OrtEpApi::OpSchema_GetInputTypeConstraint | ( | const OrtOpSchema * | schema, |
| size_t | index, | ||
| const OrtOpSchemaTypeConstraint ** | out | ||
| ) |
Get the type constraint for the i-th input formal parameter from an operator schema.
Returns a non-owning pointer to the OrtOpSchemaTypeConstraint associated with the given input. The returned pointer is valid as long as the parent OrtOpSchema is alive. If the input has no type constraint, *out is set to nullptr.
Multiple inputs sharing the same type constraint (e.g., both using "T") return the same pointer.
| [in] | schema | The OrtOpSchema instance. |
| [in] | index | Zero-based index of the input parameter. |
| [out] | out | Output parameter set to the type constraint, or NULL if the input has no type constraint. Valid as long as the OrtOpSchema exists. |
| OrtStatus * OrtEpApi::OpSchema_GetNumInputs | ( | const OrtOpSchema * | schema, |
| size_t * | out | ||
| ) |
Get the number of inputs defined by the operator schema.
| [in] | schema | The OrtOpSchema instance. |
| [out] | out | Output parameter set to the number of inputs. |
| OrtStatus * OrtEpApi::OpSchema_GetNumOutputs | ( | const OrtOpSchema * | schema, |
| size_t * | out | ||
| ) |
Get the number of outputs defined by the operator schema.
| [in] | schema | The OrtOpSchema instance. |
| [out] | out | Output parameter set to the number of outputs. |
| OrtStatus * OrtEpApi::OpSchema_GetOutputName | ( | const OrtOpSchema * | schema, |
| size_t | index, | ||
| const char ** | out | ||
| ) |
Get the name of the i-th output formal parameter from an operator schema.
| [in] | schema | The OrtOpSchema instance. |
| [in] | index | Zero-based index of the output parameter. |
| [out] | out | Output parameter set to the name of the output parameter (null-terminated UTF8 string). Valid as long as the OrtOpSchema exists. |
| OrtStatus * OrtEpApi::OpSchema_GetOutputTypeConstraint | ( | const OrtOpSchema * | schema, |
| size_t | index, | ||
| const OrtOpSchemaTypeConstraint ** | out | ||
| ) |
Get the type constraint for the i-th output formal parameter from an operator schema.
Returns a non-owning pointer to the OrtOpSchemaTypeConstraint associated with the given output. The returned pointer is valid as long as the parent OrtOpSchema is alive. If the output has no type constraint, *out is set to nullptr.
Multiple outputs sharing the same type constraint return the same pointer. Pointer equality can be used to check if two outputs share a type constraint.
| [in] | schema | The OrtOpSchema instance. |
| [in] | index | Zero-based index of the output parameter. |
| [out] | out | Output parameter set to the type constraint, or NULL if the output has no type constraint. Valid as long as the OrtOpSchema exists. |
| OrtStatus * OrtEpApi::OpSchema_GetSinceVersion | ( | const OrtOpSchema * | schema, |
| int * | out | ||
| ) |
Get the first ONNX opset version that introduced this operator schema.
If an operator has had no changes that break backwards compatibility, the since_version is just the first opset version that introduced the operator. However, if the operator has had breaking changes, then since_version corresponds to the opset version that introduced the breaking change.
For example, suppose operator "Foo" was added in version 3 and had a breaking change in version 6. Then, there will be an operator schema entry for "Foo" with a since_version of 3 and another updated operator schema entry for "Foo" with a since_version of 6.
| [in] | schema | The OrtOpSchema instance. |
| [out] | out | Output parameter set to the ONNX opset version. |
| OrtStatus * OrtEpApi::OpSchema_GetTypeConstraint | ( | const OrtOpSchema * | schema, |
| size_t | index, | ||
| const OrtOpSchemaTypeConstraint ** | out | ||
| ) |
Get the i-th type constraint from the operator schema.
Returns a non-owning pointer to the OrtOpSchemaTypeConstraint at the given index. The returned pointer is valid as long as the parent OrtOpSchema is alive.
Constraints are returned in the order they are declared in the ONNX operator schema definition. The order is stable but has no semantic significance.
Use this API to iterate all type constraints (e.g., to register allowed types for each constraint). Use OpSchema_GetInputTypeConstraint / OpSchema_GetOutputTypeConstraint to look up the constraint for a specific input or output.
| [in] | schema | The OrtOpSchema instance. |
| [in] | index | Zero-based index of the type constraint. |
| [out] | out | Output parameter set to the type constraint. Valid as long as the OrtOpSchema exists. |
| OrtStatus * OrtEpApi::OpSchema_GetTypeConstraintCount | ( | const OrtOpSchema * | schema, |
| size_t * | out | ||
| ) |
Get the number of unique type constraints in the operator schema.
| [in] | schema | The OrtOpSchema instance. |
| [out] | out | Output set to the number of type constraints. |
| OrtStatus * OrtEpApi::OpSchemaTypeConstraint_GetAllowedTypes | ( | const OrtOpSchemaTypeConstraint * | type_constraint, |
| const char *const ** | out_types, | ||
| size_t * | num_types | ||
| ) |
Get the allowed type strings for a type constraint.
Returns an array of null-terminated strings representing the allowed data types (e.g., "tensor(float)", "tensor(double)"). The array and its contents are valid as long as the parent OrtOpSchema exists.
| [in] | type_constraint | The OrtOpSchemaTypeConstraint instance. |
| [out] | out_types | Output parameter set to the output array of type strings. Valid as long as the parent OrtOpSchema exists. |
| [out] | num_types | Output parameter set to the number of elements in the output array. |
| OrtStatus * OrtEpApi::OpSchemaTypeConstraint_GetInputIndices | ( | const OrtOpSchemaTypeConstraint * | type_constraint, |
| const size_t ** | out_indices, | ||
| size_t * | count | ||
| ) |
Get the input indices that use a type constraint.
Returns an array of zero-based input indices whose formal parameter type string matches this type constraint. The array is valid as long as the parent OrtOpSchema exists.
| [in] | type_constraint | The OrtOpSchemaTypeConstraint instance. |
| [out] | out_indices | Output parameter set to the output array of input indices. |
| [out] | count | Output parameter set to the number of elements in the output array. |
| OrtStatus * OrtEpApi::OpSchemaTypeConstraint_GetOutputIndices | ( | const OrtOpSchemaTypeConstraint * | type_constraint, |
| const size_t ** | out_indices, | ||
| size_t * | count | ||
| ) |
Get the output indices that use a type constraint.
Returns an array of zero-based output indices whose formal parameter type string matches this type constraint. The array is valid as long as the parent OrtOpSchema exists.
| [in] | type_constraint | The OrtOpSchemaTypeConstraint instance. |
| [out] | out_indices | Output parameter set to the output array of output indices. |
| [out] | count | Output parameter set to the number of elements in the output array. |
| OrtStatus * OrtEpApi::OpSchemaTypeConstraint_GetTypeParamName | ( | const OrtOpSchemaTypeConstraint * | type_constraint, |
| const char ** | out | ||
| ) |
Get the type parameter name of a type constraint (e.g., "T", "T1").
| [in] | type_constraint | The OrtOpSchemaTypeConstraint instance. |
| [out] | out | Output parameter set to the type parameter name. Valid as long as the parent OrtOpSchema exists. |
| OrtStatus * OrtEpApi::ProfilingEvent_GetArgValue | ( | const OrtProfilingEvent * | event, |
| const char * | key, | ||
| const char ** | out | ||
| ) |
Get the value of an event argument by its key.
The value is set to NULL if the key is not found.
| [in] | event | The OrtProfilingEvent instance. |
| [in] | key | Null-terminated argument key to look up. |
| [out] | out | Output parameter set to the argument value string, or NULL if not found. The value is a null-terminated UTF-8 string. Do not free as the string is owned by the OrtProfilingEvent instance. |
| OrtStatus * OrtEpApi::ProfilingEvent_GetCategory | ( | const OrtProfilingEvent * | event, |
| OrtProfilingEventCategory * | out | ||
| ) |
Get the event category of a profiling event.
| [in] | event | The OrtProfilingEvent instance. |
| [out] | out | Output parameter set to the event category. |
| OrtStatus * OrtEpApi::ProfilingEvent_GetDurationUs | ( | const OrtProfilingEvent * | event, |
| int64_t * | out | ||
| ) |
Get the duration of a profiling event in microseconds.
| [in] | event | The OrtProfilingEvent instance. |
| [out] | out | Output parameter set to the event duration in microseconds. |
| OrtStatus * OrtEpApi::ProfilingEvent_GetName | ( | const OrtProfilingEvent * | event, |
| const char ** | out | ||
| ) |
Get the event name of a profiling event.
| [in] | event | The OrtProfilingEvent instance. |
| [out] | out | Output parameter set to the event name as a null-terminated UTF-8 string. Do not free as it is owned by the OrtProfilingEvent instance. |
| OrtStatus * OrtEpApi::ProfilingEvent_GetTimestampUs | ( | const OrtProfilingEvent * | event, |
| int64_t * | out | ||
| ) |
Get the start timestamp of a profiling event in microseconds.
| [in] | event | The OrtProfilingEvent instance. |
| [out] | out | Output parameter set to the start timestamp of the profiling event in microseconds relative to the profiling start time. |
| OrtStatus * OrtEpApi::ProfilingEventsContainer_AddEvents | ( | OrtProfilingEventsContainer * | events_container, |
| const OrtProfilingEvent *const * | events, | ||
| size_t | num_events | ||
| ) |
Add EP profiling events to an events container.
An EP profiler calls this function to report new EP profiling events (e.g., GPU kernel timings) during OrtEpProfilerImpl::EndProfiling(). ORT copies the EP event data during this call. The EP retains ownership of the OrtProfilingEvent instances and must release them via ReleaseProfilingEvent after this call returns. This function may be called multiple times within a single EndProfiling call to add EP events in batches.
| [in] | events_container | The OrtProfilingEventsContainer instance provided by ORT to OrtEpProfilerImpl::EndProfiling(). |
| [in] | events | Array of pointers to opaque OrtProfilingEvent instances. |
| [in] | num_events | Number of events in the events array. Must be greater than 0. |
| void OrtEpApi::ReleaseEpDevice | ( | OrtEpDevice * | input | ) |
| void OrtEpApi::ReleaseHardwareDevice | ( | OrtHardwareDevice * | input | ) |
| void OrtEpApi::ReleaseKernelDef | ( | OrtKernelDef * | input | ) |
| void OrtEpApi::ReleaseKernelDefBuilder | ( | OrtKernelDefBuilder * | input | ) |
| void OrtEpApi::ReleaseKernelImpl | ( | OrtKernelImpl * | input | ) |
| void OrtEpApi::ReleaseKernelRegistry | ( | OrtKernelRegistry * | input | ) |
| void OrtEpApi::ReleaseOpSchema | ( | OrtOpSchema * | input | ) |
| void OrtEpApi::ReleaseProfilingEvent | ( | OrtProfilingEvent * | input | ) |
Release an opaque profiling event created via CreateProfilingEvent.
| OrtStatus * OrtEpApi::SharedPrePackedWeightCache_StoreWeightData | ( | OrtSharedPrePackedWeightCache * | prepacked_weight_cache, |
| void ** | buffer_data_ptrs, | ||
| size_t * | buffer_data_sizes, | ||
| size_t | num_buffers | ||
| ) |
Sets one or more data buffers that collectively hold the pre-packed data for a single shared weight.
| [in] | prepacked_weight_cache | The OrtSharedPrePackedWeightCache instance. |
| [in] | buffer_data_ptrs | An array of buffer data pointers that collectively hold the pre-packed data for a single shared weight. Note that sometimes a single weight may have multiple pre-packed buffers and it is up to the kernel implementation to determine how to split the data into multiple buffers (if desired). |
| [in] | buffer_data_sizes | An array of buffer byte sizes, one per element in buffer_data_ptrs. |
| [in] | num_buffers | The number of buffers used to store the data for the shared pre-packed weight. Specifies the number of elements in the buffer_data_ptrs and buffer_data_sizes arrays. |
| uint64_t( * OrtEpApi::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.
When two streams are synchronized, the sync id represents the event used in that synchronization.
| [in] | producer_stream | The OrtSyncStream that produced the data. |
| [in] | consumer_stream | The OrtSyncStream that waited on the producer_stream. |
| const char *( * OrtEpApi::KernelDef_GetDomain) (const OrtKernelDef *kernel_def) |
Returns the operator's domain from the kernel definition.
| [in] | kernel_def | The OrtKernelDef instance. |
| const char *( * OrtEpApi::KernelDef_GetExecutionProvider) (const OrtKernelDef *kernel_def) |
Returns the name of the kernel's intended execution provider.
| [in] | kernel_def | The OrtKernelDef instance. |
| const char *( * OrtEpApi::KernelDef_GetOperatorType) (const OrtKernelDef *kernel_def) |
Returns the operator type from the kernel definition.
| [in] | kernel_def | The OrtKernelDef instance. |
| bool( * OrtEpApi::MemoryDevice_AreEqual) (const OrtMemoryDevice *a, const OrtMemoryDevice *b) |
Compare two OrtMemoryDevice instances for equality.
This is used to check if two memory devices are the same. Used to implement DataTransferImpl::CanCopy.
| [in] | a | The first OrtMemoryDevice instance to compare. |
| [in] | b | The second OrtMemoryDevice instance to compare. |
| uint32_t( * OrtEpApi::MemoryDevice_GetDeviceId) (const OrtMemoryDevice *memory_device) |
Get the device ID from an OrtMemoryDevice instance.
| [in] | memory_device | OrtMemoryDevice instance. |
| OrtMemoryInfoDeviceType( * OrtEpApi::MemoryDevice_GetDeviceType) (const OrtMemoryDevice *memory_device) |
Get the OrtMemoryInfoDeviceType value from an OrtMemoryDevice instance.
| [in] | memory_device | OrtMemoryDevice instance. |
| OrtDeviceMemoryType( * OrtEpApi::MemoryDevice_GetMemoryType) (const OrtMemoryDevice *memory_device) |
Get the OrtDeviceMemoryType value from an OrtMemoryDevice instance.
| [in] | memory_device | OrtMemoryDevice instance. |
| uint32_t( * OrtEpApi::MemoryDevice_GetVendorId) (const OrtMemoryDevice *memory_device) |
Get the vendor ID from an OrtMemoryDevice instance.
The vendor ID is used to identify the vendor of the device, and is typically set to the PCI vendor ID.
If the device is not vendor specific (e.g. CPU memory) the vendor ID is set to 0.
| [in] | memory_device | OrtMemoryDevice instance. |
| const OrtMemoryDevice *( * OrtEpApi::MemoryInfo_GetMemoryDevice) (const OrtMemoryInfo *memory_info) |
Get the OrtMemoryDevice from an OrtMemoryInfo instance.
This is required for OrtDataTransferImpl (which implements onnxruntime::IDataTransfer) where the OrtMemoryDevice is used in the CanCopy and CopyTensors functions.
| [in] | memory_info | The OrtMemoryInfo instance to get the memory device from. |
| const char *( * OrtEpApi::NodeComputeContext_NodeName) (const OrtNodeComputeContext *context) |
Query a OrtNodeComputeContext for the name of the node that encapsulates the compiled/fused node.
Used in OrtNodeComputeInfo::CreateComputeState().
| [in] | context | The OrtNodeComputeContext instance to query. |
| const OrtSyncStreamImpl *( * OrtEpApi::SyncStream_GetImpl) (const OrtSyncStream *stream) |
Get the OrtSyncStreamImpl associated with an OrtSyncStream instance.
This allows an the plugin library to connect its OrtSyncStreamImpl instance with an OrtSyncStream if needed.
| [in] | stream | The OrtSyncStream instance to find an OrtSyncStreamImpl for. |
| uint64_t( * OrtEpApi::SyncStream_GetSyncId) (const OrtSyncStream *stream) |
Get the current sync ID for a stream.
| [in] | stream | The OrtSyncStream to get the sync ID for. |
| const OrtMemoryDevice *( * OrtEpApi::Value_GetMemoryDevice) (const OrtValue *value) |
Get the OrtMemoryDevice from an OrtValue instance if it contains a Tensor.
| [in] | value | The OrtValue instance to get the memory device from. |