提交 536bf7d8 编写于 作者: L liaogang

fix poolAllocator unordered_map bug on Mac OS X

* using map to replace unordered_map on Mac
上级 9795e016
...@@ -19,6 +19,7 @@ limitations under the License. */ ...@@ -19,6 +19,7 @@ limitations under the License. */
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#include <map>
#include "Allocator.h" #include "Allocator.h"
namespace paddle { namespace paddle {
...@@ -52,7 +53,11 @@ private: ...@@ -52,7 +53,11 @@ private:
void printAll(); void printAll();
std::unique_ptr<Allocator> allocator_; std::unique_ptr<Allocator> allocator_;
std::mutex mutex_; std::mutex mutex_;
#if defined(__APPLE__) || defined(__OSX__)
std::map<size_t, std::vector<void*>> pool_;
#else
std::unordered_map<size_t, std::vector<void*>> pool_; std::unordered_map<size_t, std::vector<void*>> pool_;
#endif
size_t sizeLimit_; size_t sizeLimit_;
size_t poolMemorySize_; size_t poolMemorySize_;
std::string name_; std::string name_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册