diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc index 1696bf572e4c..495a7ac101e7 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -627,7 +627,7 @@ int MXNDArrayGetData(NDArrayHandle handle, void **out_pdata) { API_BEGIN(); NDArray *arr = static_cast(handle); -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 if (arr->IsMKLDNNData()) { arr->Reorder2DefaultAsync(); arr->WaitToRead(); diff --git a/src/common/utils.h b/src/common/utils.h index fbecc8b4e955..a2fdb9b6df83 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -47,7 +47,7 @@ #include #include "../operator/mxnet_op.h" -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 #include "../operator/nn/mkldnn/mkldnn_base-inl.h" #endif @@ -484,7 +484,7 @@ inline void LogStorageFallback(const nnvm::NodeAttrs& attrs, "0 to suppress this warning."; os << "\nStorage type fallback detected:\n" << op_str << warning; LogOnce(os.str()); -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 if (!MKLDNNEnvSet()) common::LogOnce("MXNET_MKLDNN_ENABLED flag is off. " "You can re-enable by setting MXNET_MKLDNN_ENABLED=1"); if (GetMKLDNNCacheSize() != -1) common::LogOnce("MXNET_MKLDNN_CACHE_NUM is set." diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc index 7d878bafe5e0..2ace00f83cc7 100644 --- a/src/ndarray/ndarray.cc +++ b/src/ndarray/ndarray.cc @@ -1617,7 +1617,7 @@ void NDArray::Save(dmlc::Stream *strm) const { } else { this->WaitToRead(); nd_cpu = *this; -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 if (nd_cpu.IsMKLDNNData()) { nd_cpu = nd_cpu.Reorder2Default(); } diff --git a/src/operator/tensor/matrix_op-inl.h b/src/operator/tensor/matrix_op-inl.h index 801e4e7126b4..76a325610deb 100644 --- a/src/operator/tensor/matrix_op-inl.h +++ b/src/operator/tensor/matrix_op-inl.h @@ -541,7 +541,7 @@ inline bool SliceForwardInferStorageType(const nnvm::NodeAttrs& attrs, } if (in_stype == kDefaultStorage) { -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 if (dev_mask == Context::kCPU && MKLDNNEnvSet() && SupportMKLDNNSlice(param)) { dispatched = storage_type_assign(&out_stype, kDefaultStorage, diff --git a/src/operator/tensor/matrix_op.cc b/src/operator/tensor/matrix_op.cc index bd683c90aede..283d4cabbe67 100644 --- a/src/operator/tensor/matrix_op.cc +++ b/src/operator/tensor/matrix_op.cc @@ -425,7 +425,7 @@ void SliceExCPU(const nnvm::NodeAttrs& attrs, auto in_stype = inputs[0].storage_type(); if (in_stype == kCSRStorage) { SliceCsrImpl(param, ctx, inputs[0], req[0], outputs[0]); -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 } else if (in_stype == kDefaultStorage) { if (SupportMKLDNN(inputs[0])) { MKLDNNSlice(param, ctx, inputs[0], req[0], outputs[0]); @@ -488,7 +488,7 @@ Example:: .set_attr("FGradient", ElemwiseGradUseNone{"_backward_slice"}) .set_attr("FCompute", SliceOpForward) .set_attr("FComputeEx", SliceExCPU) -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 .set_attr("TIsMKLDNN", true) #endif .add_argument("data", "NDArray-or-Symbol", "Source input") diff --git a/src/storage/cpu_device_storage.h b/src/storage/cpu_device_storage.h index f6b296a9643f..f3ccde24d7cd 100644 --- a/src/storage/cpu_device_storage.h +++ b/src/storage/cpu_device_storage.h @@ -53,7 +53,7 @@ class CPUDeviceStorage { /*! * \brief Alignment of allocation. */ -#if MXNET_USE_MKLDNN == 1 +#if MXNET_USE_MKLDNN == 100 // MKLDNN requires special alignment. 64 is used by the MKLDNN library in // memory allocation. static constexpr size_t alignment_ = kMKLDNNAlign;