diff --git a/metal/include/metal_compat/cuda_fp16.h b/metal/include/metal_compat/cuda_fp16.h index e69de29b..d00a77a8 100644 --- a/metal/include/metal_compat/cuda_fp16.h +++ b/metal/include/metal_compat/cuda_fp16.h @@ -0,0 +1,7 @@ + +// the round-to-nearest float helpers: on Apple Silicon the FP ops are already IEEE and un-fused here +static inline float __fmul_rn(float a, float b) { return a * b; } +static inline float __fadd_rn(float a, float b) { return a + b; } +static inline float __fmaf_rn(float a, float b, float c) { return a * b + c; } +static inline float __frcp_rn(float a) { return 1.0f / a; } +static inline float __fsqrt_rn(float a) { return __builtin_sqrtf(a); }