You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/10/06 00:02:11 UTC
[GitHub] ashokei commented on a change in pull request #7931: MKL-DNN integration: request for reviews
ashokei commented on a change in pull request #7931: MKL-DNN integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143085544
##########
File path: include/mxnet/ndarray.h
##########
@@ -512,7 +512,7 @@ class NDArray {
CHECK_GE(shape_.Size() * mshadow::mshadow_sizeof(dtype_),
shape.Size() * mshadow::mshadow_sizeof(dtype))
<< "NDArray.AsArray: target memory size is bigger";
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
if (Mkl_mem_ != nullptr) {
// convert prv to cpu
Mkl_mem_->check_and_prv_to_cpu(ptr_->shandle.dptr);
Review comment:
we create layout conversion (cpu->prv) in each operator code transparently, this allows us to avoid layout conversions if the next (or preceding) operators are also mkldnn operators. we convert back to cpu here:
https://github.com/apache/incubator-mxnet/pull/7931/files#diff-91ec751a29892f182cd05ff8de7c5755R135
check_and_prv_to_cpu can be used to convert to cpu layout, outside of the operator code, on an as needed basis.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services