Skip to content

Commit

Permalink
Initial macOS 15 support (#365)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Besard <[email protected]>
  • Loading branch information
christiangnrd and maleadt authored Jun 17, 2024
1 parent 12b33b3 commit 27a52c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions lib/mtl/compile-opts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
MTLLanguageVersion2_4 = (2 << 16) + 4
MTLLanguageVersion3_0 = (3 << 16) + 0
MTLLanguageVersion3_1 = (3 << 16) + 1
MTLLanguageVersion3_2 = (3 << 16) + 2
end

const language_versions = Dict(
Expand All @@ -26,6 +27,7 @@ const language_versions = Dict(
MTLLanguageVersion2_4 => v"2.4",
MTLLanguageVersion3_0 => v"3.0",
MTLLanguageVersion3_1 => v"3.1",
MTLLanguageVersion3_2 => v"3.2",
)

function Base.convert(::Type{VersionNumber}, ver::MTLLanguageVersion)
Expand Down
18 changes: 9 additions & 9 deletions lib/mtl/device.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ export supports_family, is_m3, is_m2, is_m1
@cenum MTLGPUFamily::NSUInteger begin
MTLGPUFamilyMetal3 = 5001 # Metal 3 support

MTLGPUFamilyApple9 = 1009 # M3 & A17
MTLGPUFamilyApple8 = 1008 # M2 & A15, A16
MTLGPUFamilyApple7 = 1007 # M1 & A14
MTLGPUFamilyApple6 = 1006 # A13
MTLGPUFamilyApple5 = 1005 # A12
MTLGPUFamilyApple4 = 1004 # A11
MTLGPUFamilyApple3 = 1003 # A9, A10
MTLGPUFamilyApple2 = 1002 # A8
MTLGPUFamilyApple1 = 1001 # A7
MTLGPUFamilyApple9 = 1009 # M3, M4 & A17
MTLGPUFamilyApple8 = 1008 # M2 & A15, A16
MTLGPUFamilyApple7 = 1007 # M1 & A14
MTLGPUFamilyApple6 = 1006 # A13
MTLGPUFamilyApple5 = 1005 # A12
MTLGPUFamilyApple4 = 1004 # A11
MTLGPUFamilyApple3 = 1003 # A9, A10
MTLGPUFamilyApple2 = 1002 # A8
MTLGPUFamilyApple1 = 1001 # A7

MTLGPUFamilyCommon3 = 3003
MTLGPUFamilyCommon2 = 3002
Expand Down
12 changes: 9 additions & 3 deletions lib/mtl/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ end
# support for the metallib file format
function metallib_support()
macos = macos_version()
if macos >= v"13"
if macos >= v"15"
v"1.2.8"
elseif macos >= v"13"
v"1.2.7"
elseif macos >= v"12"
v"1.2.6"
Expand All @@ -69,7 +71,9 @@ end
# support for the embedded AIR bitcode format
function air_support()
macos = macos_version()
if macos >= v"14"
if macos >= v"15"
v"2.7"
elseif macos >= v"14"
v"2.6"
elseif macos >= v"13"
v"2.5"
Expand All @@ -91,7 +95,9 @@ end
# support for the Metal language
function metal_support()
macos = macos_version()
if macos >= v"14"
if macos >= v"15"
v"3.2"
elseif macos >= v"14"
v"3.1"
elseif macos >= v"13"
v"3.0"
Expand Down

0 comments on commit 27a52c7

Please sign in to comment.