Essentials
Versions and Support
Metal.macos_version — Function
Metal.darwin_version — Function
Metal.metal_support — Function
Metal.metal_support(macos=macos_version())::VersionNumberReturns the highest Metal Shading Language version supported by macos (defaulting to the host macOS version).
See also Metal.metallib_support and Metal.air_support.
Metal.metallib_support — Function
Metal.metallib_support(macos=macos_version())::VersionNumberReturns the highest metallib file-format version supported by macos (defaulting to the host macOS version).
See also Metal.air_support and Metal.metal_support.
Metal.air_support — Function
Metal.air_support(macos=macos_version())::VersionNumberReturns the highest embedded-AIR-bitcode version supported by macos (defaulting to the host macOS version).
See also Metal.metallib_support and Metal.metal_support.
Metal.metal_target — Function
Metal.metal_target(macos=macos_version())::VersionNumberReturns the Metal Shading Language version Metal.jl emits by default, which tracks the host-supported version (see Metal.metal_support) to expose the newest intrinsics.
Metal.metallib_target — Function
Metal.metallib_target(macos=macos_version())::VersionNumberReturns the metallib file-format version Metal.jl emits by default, which tracks the host-supported version (see Metal.metallib_support).
Metal.air_target — Function
Metal.air_target(macos=macos_version())::VersionNumberReturns the embedded-AIR-bitcode version Metal.jl emits by default, which tracks the host-supported version (see Metal.air_support).
Global State
Metal.device! — Function
device!(dev::MTLDevice)Sets the Metal GPU device associated with the current Julia task.
Metal.MTL.devices — Function
devices()Get an iterator for the compute devices.
Metal.device — Function
device()::MTLDeviceReturn 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.
device(<:MtlArray)Get the Metal device for an MtlArray.
Metal.global_queue — Function
global_queue(dev::MTLDevice)::MTLCommandQueueReturn the Metal command queue associated with the current Julia thread.
Metal.synchronize — Function
synchronize(queue::MTLCommandQueue=global_queue(device()))Wait for currently committed GPU work on queue to finish.
synchronize(cmdbuf::MTLCommandBufferLike)Wait for cmdbuf (which must already have been committed) and all preceding work on the same queue to complete.
Metal.device_synchronize — Function
device_synchronize()Synchronize all committed GPU work across all global queues.