This is an automated email from the ASF dual-hosted git repository.

taolv 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 100586a  Change size_t to int within for loop to fix windows build 
error (#14740)
100586a is described below

commit 100586af09fc7190639729d92656b720523ec9cd
Author: ciyong <[email protected]>
AuthorDate: Sun Apr 21 20:52:49 2019 +0800

    Change size_t to int within for loop to fix windows build error (#14740)
    
    * change size_t to int for supporting OpenMp 2.0 windows build
    
    * change int to index_t
---
 src/operator/quantization/mkldnn/mkldnn_quantized_fully_connected.cc | 2 +-
 src/operator/subgraph/mkldnn/mkldnn_fc.cc                            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/operator/quantization/mkldnn/mkldnn_quantized_fully_connected.cc 
b/src/operator/quantization/mkldnn/mkldnn_quantized_fully_connected.cc
index 71daf2e..cf3d789 100644
--- a/src/operator/quantization/mkldnn/mkldnn_quantized_fully_connected.cc
+++ b/src/operator/quantization/mkldnn/mkldnn_quantized_fully_connected.cc
@@ -74,7 +74,7 @@ void MKLDNNQuantizedFullyConnectedForward(const 
nnvm::NodeAttrs &attrs,
     int32_t *quantized_bias_ptr = quantized_bias.data().dptr<int32_t>();
     size_t bias_size = bias.shape().Size();
     #pragma omp parallel for 
num_threads(engine::OpenMP::Get()->GetRecommendedOMPThreadCount())
-    for (size_t i = 0; i < bias_size; ++i) {
+    for (index_t i = 0; i < static_cast<index_t>(bias_size); ++i) {
       quantized_bias_ptr[i] = bias_ptr[i] * bias_int32_rescale;
     }
   }
diff --git a/src/operator/subgraph/mkldnn/mkldnn_fc.cc 
b/src/operator/subgraph/mkldnn/mkldnn_fc.cc
index 0ec05a2..857a27d 100644
--- a/src/operator/subgraph/mkldnn/mkldnn_fc.cc
+++ b/src/operator/subgraph/mkldnn/mkldnn_fc.cc
@@ -156,7 +156,7 @@ void SgMKLDNNFCOp::Forward(const OpContext &ctx,
         int32_t *quantized_bias_ptr = cached_bias_.data().dptr<int32_t>();
         size_t bias_size = bias.shape().Size();
         #pragma omp parallel for 
num_threads(engine::OpenMP::Get()->GetRecommendedOMPThreadCount())
-        for (size_t i = 0; i < bias_size; ++i) {
+        for (index_t i = 0; i < static_cast<index_t>(bias_size); ++i) {
           quantized_bias_ptr[i] = bias_ptr[i] * bias_int32_rescale;
         }
       }

Reply via email to