Essentials
Global State
Metal.device!
— Functiondevice!(dev::MTLDevice)
Sets the Metal GPU device associated with the current Julia task.
Metal.MTL.devices
— Functiondevices()
Get an iterator for the compute devices.
Metal.current_device
— Functioncurrent_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.
Metal.global_queue
— Functionglobal_queue(dev::MTLDevice)::MTLCommandQueue
Return the Metal command queue associated with the current Julia thread.
Metal.synchronize
— Functionsynchronize(queue)
Wait for currently committed GPU work on this queue to finish.
Create a new MTLCommandBuffer from the global command queue, commit it to the queue, and simply wait for it to be completed. Since command buffers should execute in a First-In-First-Out manner, this synchronizes the GPU.
Metal.device_synchronize
— Functiondevice_synchronize()
Synchronize all committed GPU work across all global queues