coaster 0.2.0

high-performance computation on any hardware
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use coaster::prelude::*;

fn main() {
    let ntv = Native::new();
    let dev = ntv.new_device(ntv.hardwares()).unwrap();

    let x = &mut SharedTensor::<f32>::new(&10);
    let m1 = x.write_only(&dev).unwrap();
    let m2 = x.read(&dev).unwrap();
    //~^ ERROR cannot borrow `*x` as immutable because it is also borrowed as mutable

    // need additional bindings, so rust knows it's used afterwards
    let _foo = m1;
    let _bar = m2;
}