‘unique_ptr’ in namespace ‘std’ does not name a type
Created by: luotao1
Building from commit 1808f888 , there is compiler error:
/home/luotao/Paddle/paddle/memory/memory.cc: In function ‘paddle::memory::BuddyAllocator* paddle::memory::GetCPUBuddyAllocator()’:
/home/luotao/Paddle/paddle/memory/memory.cc:33:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
static std::unique_ptr<BuddyAllocator> a{nullptr};
^
/home/luotao/Paddle/paddle/memory/memory.cc: In lambda function:
/home/luotao/Paddle/paddle/memory/memory.cc:36:5: error: ‘a’ was not declared in this scope
a.reset(new BuddyAllocator(new detail::CPUAllocator,
^
/home/luotao/Paddle/paddle/memory/memory.cc: In function ‘paddle::memory::BuddyAllocator* paddle::memory::GetCPUBuddyAllocator()’:
/home/luotao/Paddle/paddle/memory/memory.cc:41:10: error: ‘a’ was not declared in this scope
return a.get();
^
/home/luotao/Paddle/paddle/memory/memory.cc: In function ‘paddle::memory::BuddyAllocator* paddle::memory::GetGPUBuddyAllocator(int)’:
/home/luotao/Paddle/paddle/memory/memory.cc:63:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
static std::unique_ptr<BuddyAllocVec, void (*)(BuddyAllocVec * p)> as{
^
/home/luotao/Paddle/paddle/memory/memory.cc:70:23: error: ‘as’ was not declared in this scope
auto& allocators = *as.get();
^
/home/luotao/Paddle/paddle/memory/memory.cc: In function ‘paddle::memory::BuddyAllocator* paddle::memory::GetCPUBuddyAllocator()’:
/home/luotao/Paddle/paddle/memory/memory.cc:42:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
/home/luotao/Paddle/paddle/memory/memory.cc: In function ‘paddle::memory::BuddyAllocator* paddle::memory::GetGPUBuddyAllocator(int)’:
/home/luotao/Paddle/paddle/memory/memory.cc:86:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1plus: all warnings being treated as errors
make[2]: *** [paddle/memory/CMakeFiles/memory.dir/memory.cc.o] Error 1
make[1]: *** [paddle/memory/CMakeFiles/memory.dir/all] Error 2
make: *** [all] Error 2