diff --git a/paddle/phi/common/float16.h b/paddle/phi/common/float16.h index 1597602648a673d93d86c5f1a578a4b40c6f8e62..c401d8c6575e59bf976528fd6505bb82331f5dd6 100644 --- a/paddle/phi/common/float16.h +++ b/paddle/phi/common/float16.h @@ -14,7 +14,11 @@ #pragma once +#if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || \ + defined(__i386__) +#define __PADDLE_x86__ #include +#endif #include #include @@ -109,7 +113,7 @@ struct PADDLE_ALIGN(2) float16 { float16_t res = vget_lane_f16(vcvt_f16_f32(tmp), 0); x = *reinterpret_cast(&res); -#elif defined(__F16C__) +#elif defined(__F16C__) and defined(__PADDLE_x86__) x = _cvtss_sh(val, 0); #else