summaryrefslogtreecommitdiff
path: root/thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-06-06 20:44:16 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-06-06 21:27:32 +0200
commit38a200f1e327c516f785ba5db598a4638fd73cd5 (patch)
treee6c88a6cf4d14c8e28e0002c19cb3adb45aac750 /thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch
parentd838a4473589797264a1f9f5cd4de95604709d30 (diff)
oidn: Fix build for VS 2017
Backporting this upstream patch: https://github.com/OpenImageDenoise/mkl-dnn/commit/1e42e6db81e1a5270ecc0191c5385ce7e7d978e9 Fixes #39186.
Diffstat (limited to 'thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch')
-rw-r--r--thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch b/thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch
new file mode 100644
index 0000000000..50d94ebffa
--- /dev/null
+++ b/thirdparty/oidn/patches/mkl-dnn-fix-vs2017-build.patch
@@ -0,0 +1,45 @@
+Rediffed by @akien-mga to match oidn 1.1.0 source.
+
+From 1e42e6db81e1a5270ecc0191c5385ce7e7d978e9 Mon Sep 17 00:00:00 2001
+From: Jeremy Wong <jmw@netvigator.com>
+Date: Wed, 11 Sep 2019 04:46:53 +0800
+Subject: [PATCH] src: initialize members in some structures to prevent compile
+ errors with VS2017
+
+addresses "error C3615: constexpr function '...' cannot result in a constant expression" with VS2017
+---
+ src/cpu/rnn/rnn_reorders.hpp | 2 +-
+ src/cpu/simple_concat.hpp | 6 +++---
+ src/cpu/simple_sum.hpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp b/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
+index 597c63e3f8..ae1551390a 100644
+--- a/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
++++ b/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
+@@ -131,7 +131,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/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp b/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
+index 5177275452..057cc3c4c7 100644
+--- a/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
++++ b/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
+@@ -96,9 +96,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();