metaltile 0.1.0

Rust DSL for writing Apple Metal GPU kernels — write once, run fast on Apple Silicon
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Copyright 2026 0xClandestine, Ekryski, TheTom, Ambisphaeric
//! SPDX-License-Identifier: Apache-2.0
//! `#[kernel]` rejects `while` loops — the body parser does not lower them
//! and would otherwise silently drop the loop, shipping a kernel that does
//! zero iterations. The macro fails loudly instead.

use metaltile::prelude::*;

#[kernel]
fn kernel_with_while(out: Tensor<f32>) {
    while program_id(0) < 8u32 {
        store(out[0u32], 0.0f32);
    }
}

fn main() {}