mkl-dnn-fix-vs2017-build.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Rediffed by @akien-mga to match oidn 1.1.0 source.
  2. From 1e42e6db81e1a5270ecc0191c5385ce7e7d978e9 Mon Sep 17 00:00:00 2001
  3. From: Jeremy Wong <jmw@netvigator.com>
  4. Date: Wed, 11 Sep 2019 04:46:53 +0800
  5. Subject: [PATCH] src: initialize members in some structures to prevent compile
  6. errors with VS2017
  7. addresses "error C3615: constexpr function '...' cannot result in a constant expression" with VS2017
  8. ---
  9. src/cpu/rnn/rnn_reorders.hpp | 2 +-
  10. src/cpu/simple_concat.hpp | 6 +++---
  11. src/cpu/simple_sum.hpp | 2 +-
  12. 3 files changed, 5 insertions(+), 5 deletions(-)
  13. diff --git a/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp b/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
  14. index 597c63e3f8..ae1551390a 100644
  15. --- a/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
  16. +++ b/thirdparty/oidn/mkl-dnn/src/cpu/rnn/rnn_reorders.hpp
  17. @@ -131,7 +131,7 @@ struct rnn_weights_reorder_t : public cpu_primitive_t {
  18. return status::success;
  19. }
  20. - format_tag_t itag_;
  21. + format_tag_t itag_ = mkldnn_format_tag_undef;
  22. private:
  23. void init_scratchpad() {
  24. diff --git a/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp b/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
  25. index 5177275452..057cc3c4c7 100644
  26. --- a/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
  27. +++ b/thirdparty/oidn/mkl-dnn/src/cpu/simple_concat.hpp
  28. @@ -96,9 +96,9 @@ struct simple_concat_t: public cpu_primitive_t {
  29. return status::success;
  30. }
  31. - int perm_[MKLDNN_MAX_NDIMS];
  32. - int iperm_[MKLDNN_MAX_NDIMS];
  33. - dims_t blocks_;
  34. + int perm_[MKLDNN_MAX_NDIMS] {};
  35. + int iperm_[MKLDNN_MAX_NDIMS] {};
  36. + dims_t blocks_ {};
  37. dim_t nelems_to_concat(const memory_desc_wrapper &data_d) const {
  38. const int ndims = data_d.ndims();