From db717a72c20ab37974ec9076c8e406345c8776be Mon Sep 17 00:00:00 2001 From: AG Ramesh Date: Fri, 8 Jun 2018 15:06:47 -0700 Subject: [INTEL MKL] Enable compilation of TF without MKL ML dependency Closes #19808. PiperOrigin-RevId: 199857219 --- tensorflow/core/common_runtime/mkl_cpu_allocator.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tensorflow/core/common_runtime/mkl_cpu_allocator.h') diff --git a/tensorflow/core/common_runtime/mkl_cpu_allocator.h b/tensorflow/core/common_runtime/mkl_cpu_allocator.h index 245320c896..29f702699f 100644 --- a/tensorflow/core/common_runtime/mkl_cpu_allocator.h +++ b/tensorflow/core/common_runtime/mkl_cpu_allocator.h @@ -29,7 +29,9 @@ limitations under the License. #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/mem.h" +#ifndef DO_NOT_USE_ML #include "i_malloc.h" +#endif #ifdef _WIN32 typedef unsigned int uint; @@ -97,14 +99,14 @@ class MklCPUAllocator : public VisitableAllocator { VLOG(1) << "MklCPUAllocator: Setting max_mem_bytes: " << max_mem_bytes; allocator_ = new BFCAllocator(new MklSubAllocator, max_mem_bytes, kAllowGrowth, kName); - +#ifndef DO_NOT_USE_ML // For redirecting all allocations from MKL to this allocator // From: http://software.intel.com/en-us/node/528565 i_malloc = MallocHook; i_calloc = CallocHook; i_realloc = ReallocHook; i_free = FreeHook; - +#endif return Status::OK(); } -- cgit v1.2.3