Skip to content

Commit

Permalink
Change size_t to int within for loop to fix windows build error (apac…
Browse files Browse the repository at this point in the history
…he#14740)

* change size_t to int for supporting OpenMp 2.0 windows build

* change int to index_t
  • Loading branch information
ciyongch authored and haohuw committed Jun 23, 2019
1 parent 818cec3 commit 7f42eee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/operator/subgraph/mkldnn/mkldnn_fc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7f42eee

Please sign in to comment.