From e4bda354eeb843823bfa8a598336588fd9e9cab8 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Wed, 15 Aug 2018 15:03:16 -0700 Subject: [PATCH] move logonce inside fallback --- src/common/utils.h | 7 +++++++ src/executor/attach_op_execs_pass.cc | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/utils.h b/src/common/utils.h index 96949a047fba..78a1acf07f5a 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -46,6 +46,9 @@ #include #include "../operator/mxnet_op.h" +#if MXNET_USE_MKLDNN == 1 +#include "./mkldnn/mkldnn_base-inl.h" +#endif namespace mxnet { namespace common { @@ -468,6 +471,10 @@ 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 (!MKLDNNEnvSet()) common::LogOnce("MXNET_MKLDNN_ENABLED flag is off. " + "You can re-enable by setting MXNET_MKLDNN_ENABLED=1"); +#endif } // heuristic to dermine number of threads per GPU diff --git a/src/executor/attach_op_execs_pass.cc b/src/executor/attach_op_execs_pass.cc index 5c974fe4edfd..c011c1d9ce03 100644 --- a/src/executor/attach_op_execs_pass.cc +++ b/src/executor/attach_op_execs_pass.cc @@ -261,13 +261,6 @@ void CreateOpExecs(const Graph& g, OpExecVector* p_ret, size_t i) { const auto& vshape = g.GetAttr("shape"); const auto& vctx = g.GetAttr("context"); const auto& dispatch_modes = g.GetAttr("dispatch_mode"); - -#if MXNET_USE_MKLDNN == 1 - if (!MKLDNNEnvSet()) common::LogOnce("MXNET_MKLDNN_ENABLED flag is off. " - "You can re-enable by setting MXNET_MKLDNN_ENABLED=1"); -#endif - - // get the graph const auto& idx = g.indexed_graph(); OpExecVector& ret = *p_ret;