diff --git a/paddle/math/PoolAllocator.h b/paddle/math/PoolAllocator.h index 22af0eb893753490767297329194185c23c69be6..a50deece3a85359754c7f2b265c8f7013f66c5e5 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_;