Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace current_device() with device() #366

Merged
merged 6 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Metal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export MetalBackend
include("../ext/BFloat16sExt.jl")
end

include("deprecated.jl")

include("precompile.jl")

end # module
3 changes: 3 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export current_device

Base.@deprecate current_device() device()
christiangnrd marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 1 addition & 11 deletions src/state.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export current_device, device, device!, global_queue, synchronize, device_synchronize
export device, device!, global_queue, synchronize, device_synchronize

log_compiler() = OSLog("org.juliagpu.metal", "Compiler")
log_compiler(args...) = log_compiler()(args...)
Expand Down Expand Up @@ -28,16 +28,6 @@ function device()
end::MTLDevice
end

"""
current_device()::MTLDevice

Return the Metal GPU device associated with the current Julia task.

Since all M-series systems currently only externally show a single GPU, this function
effectively returns the only system GPU.
"""
current_device() = device()

"""
device!(dev::MTLDevice)

Expand Down