Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ struct NvTensorRtRtxEpFactory : OrtEpFactory {
GetSupportedDevices = GetSupportedDevicesImpl;
CreateEp = CreateEpImpl;
ReleaseEp = ReleaseEpImpl;

CreateAllocator = CreateAllocatorImpl;
ReleaseAllocator = ReleaseAllocatorImpl;
CreateDataTransfer = CreateDataTransferImpl;

IsStreamAware = IsStreamAwareImpl;
CreateSyncStreamForDevice = CreateSyncStreamForDeviceImpl;
}

// Returns the name for the EP. Each unique factory configuration must have a unique name.
Expand Down Expand Up @@ -233,6 +240,43 @@ struct NvTensorRtRtxEpFactory : OrtEpFactory {
// no-op as we never create an EP here.
}

static OrtStatus* ORT_API_CALL CreateAllocatorImpl(OrtEpFactory* this_ptr,
const OrtMemoryInfo* /*memory_info*/,
const OrtKeyValuePairs* /*allocator_options*/,
OrtAllocator** allocator) noexcept {
auto* factory = static_cast<NvTensorRtRtxEpFactory*>(this_ptr);

*allocator = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT,
"CreateAllocator should not be called as we did not add OrtMemoryInfo to our OrtEpDevice.");
}

static void ORT_API_CALL ReleaseAllocatorImpl(OrtEpFactory* /*this_ptr*/, OrtAllocator* /*allocator*/) noexcept {
// should never be called as we don't implement CreateAllocator
}

static OrtStatus* ORT_API_CALL CreateDataTransferImpl(OrtEpFactory* /*this_ptr*/,
OrtDataTransferImpl** data_transfer) noexcept {
*data_transfer = nullptr; // not implemented
return nullptr;
}

static bool ORT_API_CALL IsStreamAwareImpl(const OrtEpFactory* /*this_ptr*/) noexcept {
return false;
}

static OrtStatus* ORT_API_CALL CreateSyncStreamForDeviceImpl(OrtEpFactory* this_ptr,
const OrtMemoryDevice* /*memory_device*/,
const OrtKeyValuePairs* /*stream_options*/,
OrtSyncStreamImpl** stream) noexcept {
auto* factory = static_cast<NvTensorRtRtxEpFactory*>(this_ptr);

*stream = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT, "CreateSyncStreamForDevice should not be called as IsStreamAware returned false.");
}

const OrtApi& ort_api;
const OrtLogger& default_logger;
const std::string ep_name{kNvTensorRTRTXExecutionProvider};
Expand Down
9 changes: 8 additions & 1 deletion onnxruntime/core/providers/openvino/ov_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ OpenVINOEpPluginFactory::OpenVINOEpPluginFactory(ApiPtrs apis, const std::string
OrtEpFactory::GetName = GetNameImpl;
OrtEpFactory::GetVendor = GetVendorImpl;
OrtEpFactory::GetVendorId = GetVendorIdImpl;
OrtEpFactory::GetSupportedDevices = GetSupportedDevicesImpl;
OrtEpFactory::GetVersion = GetVersionImpl;

OrtEpFactory::GetSupportedDevices = GetSupportedDevicesImpl;

OrtEpFactory::CreateAllocator = CreateAllocatorImpl;
OrtEpFactory::ReleaseAllocator = ReleaseAllocatorImpl;
OrtEpFactory::CreateDataTransfer = CreateDataTransferImpl;

OrtEpFactory::IsStreamAware = IsStreamAwareImpl;
OrtEpFactory::CreateSyncStreamForDevice = CreateSyncStreamForDeviceImpl;

ort_version_supported = ORT_API_VERSION; // Set to the ORT version we were compiled with.
}

Expand Down
35 changes: 33 additions & 2 deletions onnxruntime/core/providers/openvino/ov_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class OpenVINOEpPluginFactory : public OrtEpFactory, public ApiPtrs {
return OpenVINOEpPluginFactory::vendor_id_;
}

static const char* ORT_API_CALL GetVersionImpl(const OrtEpFactory*) noexcept {
return ORT_VERSION;
}

static OrtStatus* ORT_API_CALL GetSupportedDevicesImpl(OrtEpFactory* this_ptr,
const OrtHardwareDevice* const* devices,
size_t num_devices,
Expand All @@ -141,14 +145,41 @@ class OpenVINOEpPluginFactory : public OrtEpFactory, public ApiPtrs {
return ApiEntry([&]() { return factory->GetSupportedDevices(devices, num_devices, ep_devices, max_ep_devices, p_num_ep_devices); });
}

static OrtStatus* ORT_API_CALL CreateAllocatorImpl(OrtEpFactory* this_ptr,
const OrtMemoryInfo* /*memory_info*/,
const OrtKeyValuePairs* /*allocator_options*/,
OrtAllocator** allocator) noexcept {
auto* factory = static_cast<OpenVINOEpPluginFactory*>(this_ptr);

*allocator = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT,
"CreateAllocator should not be called as we did not add OrtMemoryInfo to our OrtEpDevice.");
}

static void ORT_API_CALL ReleaseAllocatorImpl(OrtEpFactory* /*this_ptr*/, OrtAllocator* /*allocator*/) noexcept {
// should never be called as we don't implement CreateAllocator
}

static OrtStatus* ORT_API_CALL CreateDataTransferImpl(OrtEpFactory* /*this_ptr*/,
OrtDataTransferImpl** data_transfer) noexcept {
*data_transfer = nullptr; // return nullptr to indicate that this EP does not support data transfer.
return nullptr;
}

static const char* ORT_API_CALL GetVersionImpl(const OrtEpFactory*) noexcept {
return ORT_VERSION;
static bool ORT_API_CALL IsStreamAwareImpl(const OrtEpFactory* /*this_ptr*/) noexcept {
return false;
}

static OrtStatus* ORT_API_CALL CreateSyncStreamForDeviceImpl(OrtEpFactory* this_ptr,
const OrtMemoryDevice* /*memory_device*/,
const OrtKeyValuePairs* /*stream_options*/,
OrtSyncStreamImpl** stream) noexcept {
auto* factory = static_cast<OpenVINOEpPluginFactory*>(this_ptr);

*stream = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT, "CreateSyncStreamForDevice should not be called as IsStreamAware returned false.");
}
};

Expand Down
44 changes: 44 additions & 0 deletions onnxruntime/core/providers/vitisai/vitisai_provider_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ struct VitisAIEpFactory : OrtEpFactory {
GetSupportedDevices = GetSupportedDevicesImpl;
CreateEp = CreateEpImpl;
ReleaseEp = ReleaseEpImpl;

CreateAllocator = CreateAllocatorImpl;
ReleaseAllocator = ReleaseAllocatorImpl;
CreateDataTransfer = CreateDataTransferImpl;

IsStreamAware = IsStreamAwareImpl;
CreateSyncStreamForDevice = CreateSyncStreamForDeviceImpl;
}

static const char* GetNameImpl(const OrtEpFactory* /*this_ptr*/) noexcept {
Expand Down Expand Up @@ -175,6 +182,43 @@ struct VitisAIEpFactory : OrtEpFactory {
// no-op as we never create an EP here.
}

static OrtStatus* ORT_API_CALL CreateAllocatorImpl(OrtEpFactory* this_ptr,
const OrtMemoryInfo* /*memory_info*/,
const OrtKeyValuePairs* /*allocator_options*/,
OrtAllocator** allocator) noexcept {
auto* factory = static_cast<VitisAIEpFactory*>(this_ptr);

*allocator = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT,
"CreateAllocator should not be called as we did not add OrtMemoryInfo to our OrtEpDevice.");
}

static void ORT_API_CALL ReleaseAllocatorImpl(OrtEpFactory* /*this_ptr*/, OrtAllocator* /*allocator*/) noexcept {
// should never be called as we don't implement CreateAllocator
}

static OrtStatus* ORT_API_CALL CreateDataTransferImpl(OrtEpFactory* /*this_ptr*/,
OrtDataTransferImpl** data_transfer) noexcept {
*data_transfer = nullptr; // not implemented
return nullptr;
}

static bool ORT_API_CALL IsStreamAwareImpl(const OrtEpFactory* /*this_ptr*/) noexcept {
return false;
}

static OrtStatus* ORT_API_CALL CreateSyncStreamForDeviceImpl(OrtEpFactory* this_ptr,
const OrtMemoryDevice* /*memory_device*/,
const OrtKeyValuePairs* /*stream_options*/,
OrtSyncStreamImpl** stream) noexcept {
auto* factory = static_cast<VitisAIEpFactory*>(this_ptr);

*stream = nullptr;
return factory->ort_api.CreateStatus(
ORT_INVALID_ARGUMENT, "CreateSyncStreamForDevice should not be called as IsStreamAware returned false.");
}

const OrtApi& ort_api;
const OrtLogger& default_logger;
static constexpr const char* const ep_name{kVitisAIExecutionProvider};
Expand Down
Loading