You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2018/05/04 20:44:30 UTC
[incubator-mxnet] branch master updated: Fix a mem error. (#10812)
This is an automated email from the ASF dual-hosted git repository.
jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new e49fdae Fix a mem error. (#10812)
e49fdae is described below
commit e49fdaefd7017005aaed968f66413a0e2ef4a3b9
Author: Da Zheng <zh...@gmail.com>
AuthorDate: Fri May 4 13:44:26 2018 -0700
Fix a mem error. (#10812)
---
include/mxnet/ndarray.h | 5 +----
src/ndarray/ndarray.cc | 6 ++++++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/mxnet/ndarray.h b/include/mxnet/ndarray.h
index 6fda8c3..e243eb7 100644
--- a/include/mxnet/ndarray.h
+++ b/include/mxnet/ndarray.h
@@ -678,10 +678,7 @@ class NDArray {
*/
NDArray Reorder2Default() const;
- void InvalidateMKLDNNData() {
- // Removing mkl_mem_ means the NDArray will store data in the default format.
- ptr_->mkl_mem_ = nullptr;
- }
+ void InvalidateMKLDNNData();
/*
* This function is used inside operators to reshape an array.
diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc
index 82de094..a28a907 100644
--- a/src/ndarray/ndarray.cc
+++ b/src/ndarray/ndarray.cc
@@ -620,6 +620,12 @@ const mkldnn::memory *NDArray::GetMKLDNNData() const {
}
}
+void NDArray::InvalidateMKLDNNData() {
+ // Removing mkl_mem_ means the NDArray will store data in the default format.
+ if (ptr_->mkl_mem_ && ptr_->mkl_mem_->IsMKLDNN())
+ ptr_->mkl_mem_ = nullptr;
+}
+
void NDArray::CopyFrom(const mkldnn::memory &mem) {
CHECK(ptr_ != nullptr) << "The NDArray hasn't been initialized";
if (ptr_->mkl_mem_ && ptr_->mkl_mem_->GetRaw() == &mem)
--
To stop receiving notification emails like this one, please contact
jxie@apache.org.