use custos::prelude::*; fn main() { let device = Stack; let _buf = Buffer::>::from((&device, [1, 2, 3])); let buf_stack = Buffer::with(&device, [1, 2, 3]); let cpu = CPU::new(); let buf_heap = Buffer::with(&cpu, [1, 2, 3]); assert_eq!(buf_stack.read(), buf_heap.read()); let buf_stack_dim2 = Buffer::with(&Stack, [[1, 2, 3], [7, 2, 1]]); let buf_heap_dim2 = Buffer::with(&cpu, [[1, 2, 3], [7, 2, 1]]); assert_eq!(buf_heap_dim2.read_to_vec(), buf_stack_dim2.read_to_vec()); }