nnl 0.1.6

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

// Scalar addition compute shader
// Computes: result[i] = input[i] + scalar

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

layout(set = 0, binding = 0) buffer InputBuffer {
    float input_data[];
};

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

layout(set = 0, binding = 2) uniform UniformBuffer {
    float scalar;
};

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

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

    // Perform scalar addition entirely on GPU
    result[index] = input_data[index] + scalar;
}