You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by bg...@apache.org on 2022/03/22 13:17:03 UTC
[incubator-mxnet] branch master updated: Rename SetMKLMem func to SetDNNLMem to avoid confusion (#20948)
This is an automated email from the ASF dual-hosted git repository.
bgawrych 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 83c875d Rename SetMKLMem func to SetDNNLMem to avoid confusion (#20948)
83c875d is described below
commit 83c875d2077b87ef0f61a9122f1649cd896aac21
Author: bartekkuncer <ba...@intel.com>
AuthorDate: Tue Mar 22 14:15:27 2022 +0100
Rename SetMKLMem func to SetDNNLMem to avoid confusion (#20948)
---
include/mxnet/ndarray.h | 4 ++--
src/ndarray/ndarray.cc | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/mxnet/ndarray.h b/include/mxnet/ndarray.h
index d42f005..ec48984 100644
--- a/include/mxnet/ndarray.h
+++ b/include/mxnet/ndarray.h
@@ -1104,9 +1104,9 @@ class NDArray {
void CheckAndAllocData(const mxnet::TShape& shape, int dtype);
#if MXNET_USE_ONEDNN == 1
- // Have MKL memory reference to the data in the default storage
+ // Have DNNL memory reference to the data in the default storage
// or create memory for DNNL.
- void SetMKLMem(const mxnet::TShape& shape, int dtype);
+ void SetDNNLMem(const mxnet::TShape& shape, int dtype);
// If the data is stored in DNNL layout, we reorder data in dnnl_mem_ and
// save the result in shandle.
void Reorder2Default();
diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc
index 3baa29c..66870da 100644
--- a/src/ndarray/ndarray.cc
+++ b/src/ndarray/ndarray.cc
@@ -594,9 +594,9 @@ void NDArray::Chunk::DNNLDataReorder(const dnnl::memory::desc& md) {
dnnl_mem_.reset(new DNNLMemory(md, shandle.dptr));
}
-void NDArray::Chunk::SetMKLMem(const mxnet::TShape& shape, int dtype) {
- // The shape of the array and the one of the MKL memory may mismatch.
- // For example, if the array stores parameters, the MKL memory may store data
+void NDArray::Chunk::SetDNNLMem(const mxnet::TShape& shape, int dtype) {
+ // The shape of the array and the one of the DNNL memory may mismatch.
+ // For example, if the array stores parameters, the DNNL memory may store data
// in 5 dimensions while the NDArray stores data in 4 dimensions.
if (dnnl_mem_ && dnnl_mem_->GetDataHandle() == shandle.dptr &&
dnnl_mem_->SameFormat(shape, dtype)) {
@@ -630,8 +630,8 @@ const dnnl::memory* NDArray::GetDNNLData(const dnnl::memory::desc& desc) const {
}
const dnnl::memory* mem = GetDNNLData();
dnnl::memory::desc desc1 = mem->get_desc();
- // The MKL memory has the same format and shape as required,
- // or both use the default format, we can return the MKL memory.
+ // The DNNL memory has the same format and shape as required,
+ // or both use the default format, we can return the DNNL memory.
if (desc1 == desc || ((!mxnet::IsDNNL(desc1)) && (!mxnet::IsDNNL(desc)))) {
return GetDNNLExact(mem, desc);
} else {
@@ -808,7 +808,7 @@ const dnnl::memory* NDArray::GetDNNLData() const {
CHECK(!is_view);
DNNLStream::Get()->RegisterMem(ptr_->dnnl_mem_->GetMem());
// If this array uses DNNL format, we should return now. Otherwise,
- // SetMKLMem may mess up dnnl_mem_.
+ // SetDNNLMem may mess up dnnl_mem_.
return ptr_->dnnl_mem_->GetRaw();
}
@@ -832,7 +832,7 @@ const dnnl::memory* NDArray::GetDNNLData() const {
}
// If this isn't a view, we can create a DNNL memory and store it in the chunk
- ptr_->SetMKLMem(shape_, dtype_);
+ ptr_->SetDNNLMem(shape_, dtype_);
DNNLStream::Get()->RegisterMem(ptr_->dnnl_mem_->GetMem());
return ptr_->dnnl_mem_->GetRaw();
}
@@ -869,7 +869,7 @@ dnnl::memory* NDArray::CreateDNNLData(const dnnl::memory::desc& desc) {
}
bool isDefaultFormat = IsDefaultFormat(desc);
if (isDefaultFormat && !IsView()) {
- ptr_->SetMKLMem(shape_, dtype_);
+ ptr_->SetDNNLMem(shape_, dtype_);
DNNLStream::Get()->RegisterMem(ptr_->dnnl_mem_->GetMem());
return GetDNNLExact(ptr_->dnnl_mem_->GetRaw(), desc);
} else if (isDefaultFormat) {