diff options
Diffstat (limited to 'tensorflow/core/common_runtime/threadpool_device.cc')
-rw-r--r-- | tensorflow/core/common_runtime/threadpool_device.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tensorflow/core/common_runtime/threadpool_device.cc b/tensorflow/core/common_runtime/threadpool_device.cc index 74a87215e1..7406ecf4f8 100644 --- a/tensorflow/core/common_runtime/threadpool_device.cc +++ b/tensorflow/core/common_runtime/threadpool_device.cc @@ -111,7 +111,21 @@ Status ThreadPoolDevice::MakeTensorFromProto( } #ifdef INTEL_MKL -REGISTER_MEM_ALLOCATOR("MklCPUAllocator", 200, MklCPUAllocator); +namespace { +class MklCPUAllocatorFactory : public AllocatorFactory { + public: + bool NumaEnabled() override { return false; } + + Allocator* CreateAllocator() override { return new MklCPUAllocator; } + + // Note: Ignores numa_node, for now. + virtual SubAllocator* CreateSubAllocator(int numa_node) { + return new MklSubAllocator; + } +}; + +REGISTER_MEM_ALLOCATOR("MklCPUAllocator", 200, MklCPUAllocatorFactory); +} // namespace #endif } // namespace tensorflow |