diff options
author | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-02 12:06:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-02 12:06:28 -0700 |
commit | d10cde885c4d364915f8e6252fa45cd8a5016711 (patch) | |
tree | 3985a36e7dd8fa23a09ca266f8e1e342ab9dbd56 /tensorflow/core/util | |
parent | 1a13c4f2a0b4491ae3003ff0a400d5d8cb521c4a (diff) | |
parent | 648eb490fad57e67ebc5fc3f00b12ff23b09643b (diff) |
Merge pull request #21011 from Intel-tensorflow:pr-upgrading-mkl-dnn-to-v0.15
PiperOrigin-RevId: 207140591
Diffstat (limited to 'tensorflow/core/util')
-rw-r--r-- | tensorflow/core/util/mkl_util.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tensorflow/core/util/mkl_util.h b/tensorflow/core/util/mkl_util.h index 566a42dbd5..d90f85e422 100644 --- a/tensorflow/core/util/mkl_util.h +++ b/tensorflow/core/util/mkl_util.h @@ -1882,9 +1882,8 @@ class MklPrimitive { public: virtual ~MklPrimitive() {} - // Dummy data. Its size, hard-coded as 256 here, does - // not matter since MKL should never operate on this buffer. - unsigned char DummyData[256]; + // Dummy data which MKL DNN never operates on + unsigned char* DummyData = nullptr; }; const mkldnn::memory::dims NONE_DIMS = {}; @@ -1896,8 +1895,9 @@ class MklPrimitiveFactory { ~MklPrimitiveFactory() {} MklPrimitive* GetOp(const string& key) { - auto stream_iter = MklPrimitiveFactory<T>::GetHashMap().find(key); - if (stream_iter == MklPrimitiveFactory<T>::GetHashMap().end()) { + auto& map = MklPrimitiveFactory<T>::GetHashMap(); + auto stream_iter = map.find(key); + if (stream_iter == map.end()) { return nullptr; } else { CHECK(stream_iter->second != nullptr) << "nullptr present in map"; @@ -1906,11 +1906,12 @@ class MklPrimitiveFactory { } void SetOp(const string& key, MklPrimitive* op) { - auto stream_iter = MklPrimitiveFactory<T>::GetHashMap().find(key); + auto& map = MklPrimitiveFactory<T>::GetHashMap(); + auto stream_iter = map.find(key); - CHECK(stream_iter == MklPrimitiveFactory<T>::GetHashMap().end()); + CHECK(stream_iter == map.end()); - MklPrimitiveFactory<T>::GetHashMap()[key] = op; + map[key] = op; } private: |