From commits-return-67745-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Wed Dec 12 06:25:16 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 544A4180778 for ; Wed, 12 Dec 2018 06:25:15 +0100 (CET) Received: (qmail 11850 invoked by uid 500); 12 Dec 2018 05:25:14 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 11762 invoked by uid 99); 12 Dec 2018 05:25:14 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2018 05:25:14 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] TaoLv commented on a change in pull request #13150: support mkl log when dtype is fp32 or fp64 Message-ID: <154459231380.19318.16749195175512683510.gitbox@gitbox.apache.org> Date: Wed, 12 Dec 2018 05:25:13 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit TaoLv commented on a change in pull request #13150: support mkl log when dtype is fp32 or fp64 URL: https://github.com/apache/incubator-mxnet/pull/13150#discussion_r240885436 ########## File path: src/operator/tensor/elemwise_unary_op.h ########## @@ -348,6 +352,42 @@ class UnaryOp : public OpBase { LogUnimplementedOp(attrs, ctx, inputs, req, outputs); } } + +#if MSHADOW_USE_MKL == 1 + static inline void MKLLog(MKL_INT size, const float* pIn, float* pOut) { + vsLn(size, pIn, pOut); + } + + static inline void MKLLog(MKL_INT size, const double* pIn, double* pOut) { + vdLn(size, pIn, pOut); + } +#endif + + template + static void LogCompute(const nnvm::NodeAttrs& attrs, + const OpContext& ctx, + const std::vector& inputs, + const std::vector& req, + const std::vector& outputs) { + if (req[0] == kNullOp) return; + // if defined MSHADOW_USE_MKL then call mkl log when req is KWriteTo, type_flag is + // mshadow::kFloat32 or mshadow::kFloat64 and data size less than or equal MKL_INT_MAX +#if MSHADOW_USE_MKL == 1 + auto type_flag = inputs[0].type_flag_; + const size_t MKL_INT_MAX = (sizeof(MKL_INT) == sizeof(int)) ? INT_MAX : LLONG_MAX; + size_t input_size = inputs[0].Size(); + if (req[0] == kWriteTo && (type_flag == mshadow::kFloat32 + || type_flag == mshadow::kFloat64) && input_size <= MKL_INT_MAX) { Review comment: fix indent. ---------------------------------------------------------------- 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