Skip to content

Commit

Permalink
Check device string [skip benchmarks]
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Dec 16, 2024
1 parent 5db2e6d commit bbfb363
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mtl/device.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ MTLDevice(i::Integer) = devices()[i]
# family
#

export supports_family, is_m3, is_m2, is_m1
export supports_family, is_m4, is_m3, is_m2, is_m1

@cenum MTLGPUFamily::NSInteger begin
MTLGPUFamilyMetal3 = 5001 # Metal 3 support
Expand Down Expand Up @@ -121,5 +121,7 @@ is_m1(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple7) &&
!supports_family(dev, MTLGPUFamilyApple8)
is_m2(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple8) &&
!supports_family(dev, MTLGPUFamilyApple9)
is_m3(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple9)
is_m4(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple9)
is_m3(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple9) &&
occursin("M3", String(dev.name))
is_m4(dev::MTLDevice) = supports_family(dev, MTLGPUFamilyApple9) &&
occursin("M4", String(dev.name))

0 comments on commit bbfb363

Please sign in to comment.