custos 0.7.0

A minimal OpenCL, WGPU, CUDA and host CPU array manipulation engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use custos::Buffer;

fn main() {
    let mut buf = Buffer::from([1, 2, 3, 6, 5, 3, -4]);

    for value in &mut buf {
        *value -= 2;
    }

    let mut gpu_buf = buf.to_gpu();

    assert_eq!(gpu_buf.read(), [-1, 0, 1, 4, 3, 1, -6]);

    gpu_buf.clear();

    assert_eq!(gpu_buf.read(), [0; 7]);
}