Commit 63c6ce10 authored by pruthvi's avatar pruthvi

-fix onnx ci seg fault

parent e090c6aa
......@@ -49,7 +49,8 @@ public:
}
};
std::unique_ptr<ngraph::runtime::Allocator> ngraph::runtime::create_default_allocator()
ngraph::runtime::Allocator* ngraph::runtime::get_default_allocator()
{
return std::unique_ptr<DefaultAllocator>(new DefaultAllocator());
static std::unique_ptr<DefaultAllocator> allocator(new DefaultAllocator());
return allocator.get();
}
......@@ -30,7 +30,7 @@ namespace ngraph
class DefaultAllocator;
/// \brief Create a default allocator that calls into system
/// allocation libraries
std::unique_ptr<Allocator> create_default_allocator();
ngraph::runtime::Allocator* get_default_allocator();
}
}
......
......@@ -185,7 +185,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator()
{
if (!m_allocator)
{
m_allocator = create_default_allocator();
return runtime::get_default_allocator();
}
return m_allocator.get();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment