|
294 | 294 | @device_override Base.trunc(x::Float32) = ccall("extern air.trunc.f32", llvmcall, Cfloat, (Cfloat,), x) |
295 | 295 | @device_override Base.trunc(x::Float16) = ccall("extern air.trunc.f16", llvmcall, Float16, (Float16,), x) |
296 | 296 |
|
297 | | -@static if Metal.is_macos(v"14") |
298 | | - @device_function nextafter(x::Float32, y::Float32) = ccall("extern air.nextafter.f32", llvmcall, Cfloat, (Cfloat, Cfloat), x, y) |
299 | | - @device_function nextafter(x::Float16, y::Float16) = ccall("extern air.nextafter.f16", llvmcall, Float16, (Float16, Float16), x, y) |
| 297 | +@device_function function nextafter(x::Float32, y::Float32) |
| 298 | + if metal_version() >= sv"3.1" # macOS 14+ |
| 299 | + ccall("extern air.nextafter.f32", llvmcall, Cfloat, (Cfloat, Cfloat), x, y) |
| 300 | + else |
| 301 | + error() |
| 302 | + end |
| 303 | +end |
| 304 | +@device_function function nextafter(x::Float16, y::Float16) |
| 305 | + if metal_version() >= sv"3.1" # macOS 14+ |
| 306 | + ccall("extern air.nextafter.f16", llvmcall, Float16, (Float16, Float16), x, y) |
| 307 | + else |
| 308 | + error() |
| 309 | + end |
300 | 310 | end |
301 | 311 |
|
302 | 312 | # hypot without use of double |
|
0 commit comments