libclc: Force assuming fast float fma for AMDGPU (#188245) Currently the build uses the default dummy target, which assumes FMA is slow. Force this to assume fast fma, which is the case on any remotely new hardware. In the future if we want better support for older targets, there should be a separate build of the math functions for the slow fma case. GitOrigin-RevId: 0e49be0d985e30592b400961e77e2582082ed196
diff --git a/clc/include/clc/math/math.h b/clc/include/clc/math/math.h index 22ed3f9..950e805 100644 --- a/clc/include/clc/math/math.h +++ b/clc/include/clc/math/math.h
@@ -30,7 +30,9 @@ #define __CLC_FAST_FMA_F16 0 #endif -#ifdef FP_FAST_FMAF +// TODO: Stop forcing this for AMDGPU, and use a separate build for slow-fma +// case. +#if defined(FP_FAST_FMAF) || defined(__AMDGPU__) #define __CLC_FAST_FMA_F32 1 #else #define __CLC_FAST_FMA_F32 0