vs2022.patch 728 B

123456789101112131415
  1. diff --git a/aten/src/ATen/cpu/vec/vec_base.h b/aten/src/ATen/cpu/vec/vec_base.h
  2. index 3bf1010efd..640c0ed109 100644
  3. --- a/aten/src/ATen/cpu/vec/vec_base.h
  4. +++ b/aten/src/ATen/cpu/vec/vec_base.h
  5. @@ -131,8 +131,9 @@ public:
  6. // versions GCC/Clang have buggy determinations on whether or not an
  7. // identifier is odr-used or not, and in any case it's hard to tell if
  8. // a variable is odr-used or not. So best to just cut the problem at the root.
  9. + static constexpr size_type size_T = sizeof(T); // Workaround to compile with VS2022.
  10. static constexpr size_type size() {
  11. - return VECTOR_WIDTH / sizeof(T);
  12. + return VECTOR_WIDTH / size_T;
  13. }
  14. Vectorized() : values{static_cast<T>(0)} {}
  15. Vectorized(T val) {