primal-barracuda 0.4.0

barraCuda — BARrier-free Rust Abstracted Cross-platform Unified Dimensional Algebra. Vendor-agnostic GPU compute via WGSL.
Documentation
// SPDX-License-Identifier: AGPL-3.0-or-later
// View - Pure metadata operation (zero-copy) (f64 canonical)
// Changes tensor shape without copying data
//
// Algorithm:
// This is a metadata-only operation. No actual computation needed.
// The WGSL shader is a simple copy for buffer compatibility.
// The real work happens at the Tensor metadata level.

struct Params {
    size: u32,
    _pad1: u32,
    _pad2: u32,
    _pad3: u32,
}

@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read> input: array<f64>;
@group(0) @binding(2) var<storage, read_write> output: array<f64>;

@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
    let idx = global_id.x;
    if (idx >= params.size) {
        return;
    }

    // Simple copy - view is handled at Tensor metadata level
    output[idx] = input[idx];
}