mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
Fix allocator bug (#5042)
This commit is contained in:
parent
3268717615
commit
e0d1cf19a6
1 changed files with 7 additions and 0 deletions
|
|
@ -187,6 +187,13 @@ struct Provider_IExecutionProvider_Router_Impl : Provider_IExecutionProvider_Rou
|
|||
return std::make_shared<Provider_IAllocator_Impl>(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<Provider_IAllocator_Impl*>(allocator.get())->p_;
|
||||
}
|
||||
|
||||
std::unique_ptr<Provider_IDataTransfer> Provider_GetDataTransfer() const override {
|
||||
return std::unique_ptr<Provider_IDataTransfer>(reinterpret_cast<Provider_IDataTransfer*>(IExecutionProvider::GetDataTransfer().release()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue