Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
change mxnet_option behavior
Browse files Browse the repository at this point in the history
fix omp with msvc with mkldnn
  • Loading branch information
yajiedesign committed Apr 19, 2019
1 parent 93238a2 commit 619de98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mxnet_option(USE_SSE "Build with x86 SSE instruction support" ON IF
mxnet_option(USE_F16C "Build with x86 F16C instruction support" ON) # autodetects support if ON
mxnet_option(USE_LAPACK "Build with lapack support" ON)
mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON)
mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE))
mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) )
mxnet_option(USE_MKLDNN "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING))
mxnet_option(USE_OPERATOR_TUNING "Enable auto-tuning of operators" ON IF NOT MSVC)
mxnet_option(USE_GPERFTOOLS "Build with GPerfTools support" OFF)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function(mxnet_option variable description value)
option(${variable} "${description}" ${__value})
endif()
else()
unset(${variable} CACHE)
option(${variable} "${description}" OFF)
endif()
endfunction()

Expand Down
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 (int i = 0; i < 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 (int i = 0; i < bias_size; ++i) {
quantized_bias_ptr[i] = bias_ptr[i] * bias_int32_rescale;
}
}
Expand Down

0 comments on commit 619de98

Please sign in to comment.