Skip to main content
enigma.compile runs entirely in the compiler pipeline and does not require a Metal device. You can use this to develop and inspect kernels on any macOS machine with Xcode CLT, including CI runners without Apple Silicon.

Basic usage

Enabling debug artifacts

Use compile flags to capture every stage of the pipeline:

What each flag does

Exporting Metal source

To save the generated source to a specific path for review or diffing:
This is useful for:
  • Code review of generated kernels
  • Tracking codegen regressions in CI with git diff
  • Profiling with Metal’s GPU capture tools using the original source

Vectorized kernels

Pass vec_width to request vectorized codegen. The pipeline will emit float4-style loads and stores when alignment allows:

When to use this workflow