File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
mistralrs-quant/src/metal_kernels Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,15 @@ inline bfloat16_t uint16_to_bfloat16(const uint16_t x) {
263263 return _MLX_BFloat16 (x, _MLX_BFloat16::bits_to_bfloat ());
264264}
265265
266+ // Resolve ambiguous call to metal::isnan for bfloat16_t by providing an
267+ // exact‑match overload. This prevents the compiler from having to choose
268+ // between the existing float and half overloads when the argument is a
269+ // bfloat16_t value.
270+ METAL_FUNC inline bool isnan (bfloat16_t x) {
271+ // Delegate to the float overload after an explicit cast.
272+ return metal::isnan (static_cast <float >(x));
273+ }
274+
266275#endif
267276
268277// /////////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments