nnl 0.1.6

A high-performance neural network library for Rust with CPU and GPU support
Documentation
#version 450

// Elementwise subtraction compute shader
// Computes: result[i] = a[i] - b[i]

layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;

layout(set = 0, binding = 0) buffer InputBufferA {
    float a[];
};

layout(set = 0, binding = 1) buffer InputBufferB {
    float b[];
};

layout(set = 0, binding = 2) buffer OutputBuffer {
    float result[];
};

void main() {
    uint index = gl_GlobalInvocationID.x;

    // Bounds checking
    if (index >= a.length() || index >= b.length() || index >= result.length()) {
        return;
    }

    // Perform elementwise subtraction entirely on GPU
    result[index] = a[index] - b[index];
}