aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/common_runtime/mkl_cpu_allocator.h
diff options
context:
space:
mode:
authorGravatar AG Ramesh <ag.ramesh@intel.com>2018-06-08 15:06:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-08 15:09:15 -0700
commitdb717a72c20ab37974ec9076c8e406345c8776be (patch)
treec66d715479275dbf3cb51f553b44f202777b7643 /tensorflow/core/common_runtime/mkl_cpu_allocator.h
parentbc65583b2b4e3f48b6a724832ef96ab176666d33 (diff)
[INTEL MKL] Enable compilation of TF without MKL ML dependency
Closes #19808. PiperOrigin-RevId: 199857219
Diffstat (limited to 'tensorflow/core/common_runtime/mkl_cpu_allocator.h')
-rw-r--r--tensorflow/core/common_runtime/mkl_cpu_allocator.h6
1 files changed, 4 insertions, 2 deletions
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();
}