vcpkg/ports/libtorch/pytorch-pr-85958.patch

16 lines
744 B
Diff

diff --git a/aten/src/ATen/cpu/vec/vec_base.h b/aten/src/ATen/cpu/vec/vec_base.h
index 635ec8c82e5d..1974d55943b3 100644
--- a/aten/src/ATen/cpu/vec/vec_base.h
+++ b/aten/src/ATen/cpu/vec/vec_base.h
@@ -132,8 +132,9 @@ struct Vectorized {
// versions GCC/Clang have buggy determinations on whether or not an
// identifier is odr-used or not, and in any case it's hard to tell if
// a variable is odr-used or not. So best to just cut the problem at the root.
+ static constexpr size_type size_T = sizeof(T); // Workaround to compile with VS2022.
static constexpr size_type size() {
- return VECTOR_WIDTH / sizeof(T);
+ return VECTOR_WIDTH / size_T;
}
Vectorized() : values{static_cast<T>(0)} {}
Vectorized(T val) {