Metal programming in Julia
With Metal.jl it's possible to program GPUs on macOS using the Metal programming framework. The package is very much a work-in-progress, and currently is only interesting to developers.
- Mac device with M-series chip
- macOS Catalina 10.15 or newer (might also work on 10.14 but untested).
- Julia 1.8 (this package currently requires LLVM 13)
- This GPUCompiler fork
For interactions with the Metal APIs, this package depends on a small C/ObjC
dynamic library that wraps the ObjectiveC APIs
with a C interface. This library is built during the build phase of Metal.jl
.
Julia wrappers to this small C library have been built with Clang.jl, and can be
regenerated by running julia --project=res/ res/wrap.jl
from the project
folder.
These low-level wrappers, along with some slightly higher-level Julia wrappers,
are available in the MTL
submodule exported by Metal.jl. All wrapped C
functions and types start with the mt
prefix, whereas the Julia wrappers are
prefixed with Mtl
.
The C library started by forking rcp/cmt, to whom
goes the original credit. This package builds upon the experience of several
Julia contributors to CUDA.jl
, AMDGPU.jl
, oneAPI.jl
.