From bbfb3631feb7f8c2cedf62bb1d9b626316c64d44 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:04:16 -0400 Subject: [PATCH] Check device string [skip benchmarks] --- lib/mtl/device.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mtl/device.jl b/lib/mtl/device.jl index 2931597f..0747006e 100644 --- a/lib/mtl/device.jl +++ b/lib/mtl/device.jl @@ -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 @@ -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))