vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
struct ByteCountParams {
    haystack_len: u32,
    needle: u32,
    reserved0: u32,
    reserved1: u32,
}

@group(0) @binding(0) var<uniform> params: ByteCountParams;
@group(0) @binding(1) var<storage, read> haystack_words: array<u32>;
@group(0) @binding(2) var<storage, read_write> count: atomic<u32>;

@compute @workgroup_size(64, 1, 1)
fn buffer_byte_count(@builtin(global_invocation_id) id: vec3<u32>) {
    let index = id.x;
    if (index >= params.haystack_len) {
        return;
    }
    if (vyre_packed_byte(&haystack_words, index) == (params.needle & 0xffu)) {
        atomicAdd(&count, 1u);
    }
}