diff --git a/docs/src/api/essentials.md b/docs/src/api/essentials.md index 0536da2d3..175c6680f 100644 --- a/docs/src/api/essentials.md +++ b/docs/src/api/essentials.md @@ -2,7 +2,7 @@ ## Versions and Support ```@docs -macos_version +Metal.macos_version Metal.darwin_version Metal.metal_support Metal.metallib_support diff --git a/lib/mtl/library.jl b/lib/mtl/library.jl index f9037b535..60d11faa8 100644 --- a/lib/mtl/library.jl +++ b/lib/mtl/library.jl @@ -23,7 +23,7 @@ end function MTLLibraryFromFile(dev::MTLDevice, path::String) err = Ref{id{NSError}}(nil) - handle = if macos_version() >= v"13" + handle = if Metal.macos_version() >= v"13" url = NSFileURL(path) @objc [dev::id{MTLDevice} newLibraryWithURL:url::id{NSURL} error:err::Ptr{id{NSError}}]::id{MTLLibrary} diff --git a/src/version.jl b/src/version.jl index 89db5876a..91108b52c 100644 --- a/src/version.jl +++ b/src/version.jl @@ -1,7 +1,5 @@ # version and support queries -export macos_version - @noinline function _syscall_version(name) size = Ref{Csize_t}() err = @ccall sysctlbyname(name::Cstring, C_NULL::Ptr{Cvoid}, size::Ptr{Csize_t}, @@ -23,7 +21,7 @@ const _darwin_version = Ref{VersionNumber}() Returns the host Darwin kernel version. -See also [`macos_version`](@ref). +See also [`Metal.macos_version`](@ref). """ function darwin_version() if !isassigned(_darwin_version) @@ -34,7 +32,7 @@ end const _macos_version = Ref{VersionNumber}() """ - macos_version() -> VersionNumber + Metal.macos_version() -> VersionNumber Returns the host macOS version. diff --git a/test/execution.jl b/test/execution.jl index d0bd2f2c9..9ab3aa31f 100644 --- a/test/execution.jl +++ b/test/execution.jl @@ -52,7 +52,7 @@ end Metal.code_typed(dummy, Tuple{}) Metal.code_warntype(devnull, dummy, Tuple{}) Metal.code_llvm(devnull, dummy, Tuple{}) - if macos_version() >= v"13" + if Metal.macos_version() >= v"13" Metal.code_agx(devnull, dummy, Tuple{}) end @@ -60,7 +60,7 @@ end @device_code_typed @metal dummy() @device_code_warntype io=devnull @metal dummy() @device_code_llvm io=devnull @metal dummy() - if macos_version() >= v"13" + if Metal.macos_version() >= v"13" @device_code_agx io=devnull @metal dummy() end @@ -73,7 +73,7 @@ end # make sure kernel name aliases are preserved in the generated code @test occursin("dummy", sprint(io->(@device_code_llvm io=io optimize=false @metal dummy()))) @test occursin("dummy", sprint(io->(@device_code_llvm io=io @metal dummy()))) - if macos_version() >= v"13" + if Metal.macos_version() >= v"13" @test occursin("dummy", sprint(io->(@device_code_agx io=io @metal dummy()))) end diff --git a/test/profiling.jl b/test/profiling.jl index e6949e8bc..72be12ea2 100644 --- a/test/profiling.jl +++ b/test/profiling.jl @@ -1,4 +1,3 @@ -using Metal: macos_version @testset "profiling" begin # determine if we can even run these tests @@ -14,7 +13,7 @@ else error("Could not parse xctrace version output:\n$version_output") else xcode_version = VersionNumber(parse(Int, m.captures[1]), parse(Int, m.captures[2])) - if MTL.is_m1(device()) && macos_version() >= v"14.4" && xcode_version < v"15.3" + if MTL.is_m1(device()) && Metal.macos_version() >= v"14.4" && xcode_version < v"15.3" @warn "Skipping profiling tests because of an M1-related bug on macOS 14.4 and Xcode < 15.3; please upgrade Xcode first" else run_tests = true