diff --git a/onnxruntime/core/framework/provider_bridge_ort.cc b/onnxruntime/core/framework/provider_bridge_ort.cc index 0fe2a7cba1..0ed4288368 100644 --- a/onnxruntime/core/framework/provider_bridge_ort.cc +++ b/onnxruntime/core/framework/provider_bridge_ort.cc @@ -187,6 +187,13 @@ struct Provider_IExecutionProvider_Router_Impl : Provider_IExecutionProvider_Rou return std::make_shared(IExecutionProvider::GetAllocator(id, mem_type)); } + AllocatorPtr GetAllocator(int id, OrtMemType mem_type) const override { + auto allocator = outer_->Provider_GetAllocator(id, mem_type); + if (!allocator) + return nullptr; + return static_cast(allocator.get())->p_; + } + std::unique_ptr Provider_GetDataTransfer() const override { return std::unique_ptr(reinterpret_cast(IExecutionProvider::GetDataTransfer().release())); }