From 536bf7d87f22ba2dbc84288a35341af523c9169d Mon Sep 17 00:00:00 2001 From: liaogang Date: Tue, 20 Sep 2016 20:23:58 +0800 Subject: [PATCH] fix poolAllocator unordered_map bug on Mac OS X * using map to replace unordered_map on Mac --- paddle/math/PoolAllocator.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/math/PoolAllocator.h b/paddle/math/PoolAllocator.h index 22af0eb893..a50deece3a 100644 --- a/paddle/math/PoolAllocator.h +++ b/paddle/math/PoolAllocator.h @@ -19,6 +19,7 @@ limitations under the License. */ #include #include #include +#include #include "Allocator.h" namespace paddle { @@ -52,7 +53,11 @@ private: void printAll(); std::unique_ptr allocator_; std::mutex mutex_; +#if defined(__APPLE__) || defined(__OSX__) + std::map> pool_; +#else std::unordered_map> pool_; +#endif size_t sizeLimit_; size_t poolMemorySize_; std::string name_; -- GitLab