Skip to content

Commit

Permalink
Only load BFloat16sExt on Apple systems (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd authored Oct 10, 2024
1 parent c4c0e28 commit dbed750
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ext/BFloat16sExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ using Metal: MPS.MPSDataType, MPS.MPSDataTypeBFloat16, MPS.jl_mps_to_typ, macos_
using BFloat16s

# BFloat is only supported in MPS starting in MacOS 14
if macos_version() >= v"14"
Base.convert(::Type{MPSDataType}, ::Type{BFloat16}) = MPSDataTypeBFloat16
jl_mps_to_typ[MPSDataTypeBFloat16] = BFloat16
@static if Sys.isapple()
if macos_version() >= v"14"
Base.convert(::Type{MPSDataType}, ::Type{BFloat16}) = MPSDataTypeBFloat16
jl_mps_to_typ[MPSDataTypeBFloat16] = BFloat16
end
end

end # module

0 comments on commit dbed750

Please sign in to comment.