diff --git a/lib/simd/Grid_avx.h b/lib/simd/Grid_avx.h index 73792f84..61bf0dfe 100644 --- a/lib/simd/Grid_avx.h +++ b/lib/simd/Grid_avx.h @@ -470,13 +470,14 @@ namespace Optimization { return in; }; }; - +#define USE_FP16 struct PrecisionChange { static inline __m256i StoH (__m256 a,__m256 b) { + __m256 h ; #ifdef USE_FP16 __m128i ha = _mm256_cvtps_ph(a,0); __m128i hb = _mm256_cvtps_ph(b,0); - __m256 h = _mm256_castps128_ps256(ha); + h = _mm256_castps128_ps256(ha); h = _mm256_insertf128_ps(h,hb,1); #else assert(0); diff --git a/lib/simd/Grid_avx512.h b/lib/simd/Grid_avx512.h index dae3c1c7..a15edeb3 100644 --- a/lib/simd/Grid_avx512.h +++ b/lib/simd/Grid_avx512.h @@ -340,13 +340,14 @@ namespace Optimization { }; }; - +#define USE_FP16 struct PrecisionChange { static inline __m512i StoH (__m512 a,__m512 b) { + __m512 h ; #ifdef USE_FP16 __m256i ha = _mm512_cvtps_ph(a,0); __m256i hb = _mm512_cvtps_ph(b,0); - __m512 h = _mm512_castps256_ps512(ha); + h = _mm512_castps256_ps512(ha); h = _mm512_insertf256_ps(h,hb,1); #else assert(0);