onnxruntime/cmake/patches/ngraph/mkldnn_constexpr.patch
Tomasz Socha f93be8af90 Update nGraph to version 0.26 (#1965)
* Adjust ngraph cmake files to onnx 1.5.0

* Enable LSTM reverse direction mode in nGraph EP

* Enable full support for the Split op in nGraph EP

* Revert "Disable the unsigned input Shrink op tests for nGraph until the next update"

This reverts commit 257b42a55bdd98f804d4846868542b8e3aeb4b4e.

* Enable Gather and remove unused subgraph attribute

* Remove the unused param from AppendClusterToSubGraph

* Fix for the incorrect onnx opset version

* Use the r0.26 release branch before the tag is created

* Enable the quantizelinear and dequantizelinear for NGEP

* Use the v0.26.0-rc.2 tag in ngraph.cmake

* Add skip for modes others than default in Pad operator

* Reenable negative axis tests for ngraph

* Use temporary ngraph version

* Use branch name instead of SHA for temporary ngraph branch

* Use ngraph v0.26.0-rc.4

* Remove patch for missing symbol in MKLDNN

* Use MKLDNN 1.0 in ngraph

* Exclude the Pad op for opsets greater than 10

* Disable quantizelinear and dequantizelinear tests for ONNX 1.5.0

* Fix the onnx-headers related compilation errors

* ONNX libs linking fix

* Use a tag for ngraph and support more Pad modes

* Use the v0.26.0 release tag for nGraph

* Update ngraph to RC8 - bigobj flag for Windows builds

* Fix the MKLDNN constexpr error on Windows
2019-10-14 10:37:48 -07:00

61 lines
2.4 KiB
Diff

diff --git a/cmake/external_mkldnn_v1.cmake b/cmake/external_mkldnn_v1.cmake
index fb77250c..d72d1b6c 100644
--- a/cmake/external_mkldnn_v1.cmake
+++ b/cmake/external_mkldnn_v1.cmake
@@ -200,6 +200,7 @@ if (WIN32)
CONFIGURE_COMMAND
PATCH_COMMAND ${MKLDNN_PATCH_REVERT_COMMAND}
COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_SOURCE_DIR}/cmake/${MKLDNN_PATCH_FILE}
+ COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_SOURCE_DIR}/cmake/mkldnn_constexpr.patch
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
diff --git a/cmake/mkldnn_constexpr.patch b/cmake/mkldnn_constexpr.patch
new file mode 100644
index 00000000..86e99cc8
--- /dev/null
+++ b/cmake/mkldnn_constexpr.patch
@@ -0,0 +1,43 @@
+diff --git a/src/cpu/rnn/rnn_reorders.hpp b/src/cpu/rnn/rnn_reorders.hpp
+index fbfedd01..786d4f8f 100644
+--- a/src/cpu/rnn/rnn_reorders.hpp
++++ b/src/cpu/rnn/rnn_reorders.hpp
+@@ -128,7 +128,7 @@ struct rnn_weights_reorder_t : public cpu_primitive_t {
+ return status::success;
+ }
+
+- format_tag_t itag_;
++ format_tag_t itag_ = mkldnn_format_tag_undef;
+
+ private:
+ void init_scratchpad() {
+diff --git a/src/cpu/simple_concat.hpp b/src/cpu/simple_concat.hpp
+index fe84eb14..f1b2bd17 100644
+--- a/src/cpu/simple_concat.hpp
++++ b/src/cpu/simple_concat.hpp
+@@ -98,9 +98,9 @@ struct simple_concat_t: public cpu_primitive_t {
+ return status::success;
+ }
+
+- int perm_[MKLDNN_MAX_NDIMS];
+- int iperm_[MKLDNN_MAX_NDIMS];
+- dims_t blocks_;
++ int perm_[MKLDNN_MAX_NDIMS] {};
++ int iperm_[MKLDNN_MAX_NDIMS] {};
++ dims_t blocks_ {};
+
+ dim_t nelems_to_concat(const memory_desc_wrapper &data_d) const {
+ const int ndims = data_d.ndims();
+diff --git a/src/cpu/simple_sum.hpp b/src/cpu/simple_sum.hpp
+index 46a24810..c5376eab 100644
+--- a/src/cpu/simple_sum.hpp
++++ b/src/cpu/simple_sum.hpp
+@@ -71,7 +71,7 @@ struct simple_sum_t: public cpu_primitive_t {
+ }
+
+ sum_bf16_params_t bf16_p_;
+- dim_t block_size_, nelems_, blocks_number_, tail_;
++ dim_t block_size_ = 0, nelems_ = 0, blocks_number_ = 0, tail_ = 0;
+
+ private:
+ const dim_t cacheline_size_ = 64; // bytes