diff --git a/arch/dotproductavx.cpp b/arch/dotproductavx.cpp index 11517f8dec2faa2f5ef625f535a31d0eaf77cd4b..dca1ec5037d3e1419e55b361023c6320b3c4e3e1 100644 --- a/arch/dotproductavx.cpp +++ b/arch/dotproductavx.cpp @@ -90,6 +90,8 @@ double DotProductAVX(const double* u, const double* v, int n) { // instruction, as that introduces a 70 cycle delay. All this casting is to // fool the intrinsics into thinking we are extracting the bottom int64. auto cast_sum = _mm256_castpd_si256(sum); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing") *(reinterpret_cast(&result)) = #if defined(_WIN32) || defined(__i386__) // This is a very simple workaround that is activated @@ -100,6 +102,7 @@ double DotProductAVX(const double* u, const double* v, int n) { _mm256_extract_epi64(cast_sum, 0) #endif ; +#pragma GCC diagnostic pop while (offset < n) { result += u[offset] * v[offset]; ++offset;