#[gpu_use]
fn main() {
let mut a = vec![0.2; 1000];
let mut b = vec![0.3; 1000];
let c = vec![0.0; 1000];
gpu_do!(load(a));
gpu_do!(load(b));
gpu_do!(load(c));
gpu_do!(launch());
for i in 0..1000 {
c[i] = a[i] + b[i];
}
gpu_do!(read(c));
println!("{:?}", c);
}
Emu is currently open-sourced as a 100% stable Rust library and while it only supports a tiny subset of Rust, that subset is well-defined with useful compile-time errors and a comprehensive test suite.
I would recommend looking through it first. Of course, if you have questions feel free to ask - https://gitter.im/talk-about-emu/thoughts