zheng-da commented on a change in pull request #11262: [MXNET-542] Fix mkldnn 
performance regression + improve test logging
URL: https://github.com/apache/incubator-mxnet/pull/11262#discussion_r195910062
 
 

 ##########
 File path: src/operator/nn/mkldnn/mkldnn_base.cc
 ##########
 @@ -77,26 +77,36 @@ mkldnn::memory *TmpMemMgr::Alloc(const 
mkldnn::memory::primitive_desc &pd) {
   }
 }
 
-mkldnn_output_t CreateMKLDNNMem(const NDArray &arr,
-                                const mkldnn::memory::primitive_desc &desc,
-                                OpReqType req) {
+bool CanWriteTo(const NDArray &out_arr,
+                const NDArray &in_arr,
+                const mkldnn::memory::primitive_desc &desc) {
+  bool add_same = in_arr.GetMKLDNNData()->get_data_handle() ==
+      out_arr.GetMKLDNNData()->get_data_handle();
+  bool pdesc_same = out_arr.GetMKLDNNData()->get_primitive_desc() == desc;
 
 Review comment:
   but you are not comparing with the first input. `desc` can be different from 
`in_arr`'s descriptor, right?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to