Unverified Commit 505a0c3d authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Merge pull request #3182 from NervanaSystems/pruthvi/fix_segfautl_mem_allocator

Fix Onnx CI seg fault 
parents 68d4d196 ae0c80e9
...@@ -49,7 +49,8 @@ public: ...@@ -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 ...@@ -30,7 +30,7 @@ namespace ngraph
class DefaultAllocator; class DefaultAllocator;
/// \brief Create a default allocator that calls into system /// \brief Create a default allocator that calls into system
/// allocation libraries /// 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() ...@@ -185,7 +185,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator()
{ {
if (!m_allocator) if (!m_allocator)
{ {
m_allocator = create_default_allocator(); return runtime::get_default_allocator();
} }
return m_allocator.get(); 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