Commit 00f79586 authored by pruthvi's avatar pruthvi

use unique_ptr to hold m_allocator in the cpu backend

parent f305f60d
...@@ -161,7 +161,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator() ...@@ -161,7 +161,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator()
{ {
if (m_allocator) if (m_allocator)
{ {
return m_allocator; return m_allocator.get();
} }
else else
{ {
...@@ -172,7 +172,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator() ...@@ -172,7 +172,7 @@ runtime::Allocator* runtime::cpu::CPU_Backend::get_host_memory_allocator()
void runtime::cpu::CPU_Backend::set_host_memory_allocator( void runtime::cpu::CPU_Backend::set_host_memory_allocator(
std::unique_ptr<runtime::Allocator> allocator) std::unique_ptr<runtime::Allocator> allocator)
{ {
m_allocator = allocator.get(); m_allocator = std::move(allocator);
} }
vector<runtime::PerformanceCounter> runtime::cpu::CPU_Executable::get_performance_data() const vector<runtime::PerformanceCounter> runtime::cpu::CPU_Executable::get_performance_data() const
......
...@@ -70,7 +70,7 @@ namespace ngraph ...@@ -70,7 +70,7 @@ namespace ngraph
private: private:
std::unordered_map<std::shared_ptr<Function>, std::shared_ptr<Executable>> std::unordered_map<std::shared_ptr<Function>, std::shared_ptr<Executable>>
m_exec_map; m_exec_map;
Allocator* m_allocator; std::unique_ptr<Allocator> m_allocator;
}; };
class CPU_BACKEND_API CPU_Executable : public runtime::Executable class CPU_BACKEND_API CPU_Executable : public runtime::Executable
......
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