GpuVector

Type Alias GpuVector 

Source
pub type GpuVector<T> = GpuTensor<T, 1>;
Expand description

A storage buffer containing a vector.

Aliased Type§

pub struct GpuVector<T> { /* private fields */ }

Implementations§

Source§

impl<T> GpuVector<T>

Source

pub fn encase( device: &Device, vector: impl AsRef<[T]>, usage: BufferUsages, ) -> Self

Allocates a new vector on the gpu initialized from vector.

If T implements Pod, use GpuMatrix::init instead.

Source

pub fn uninit(device: &Device, len: u32, usage: BufferUsages) -> Self
where T: Pod,

Allocates a new uninitialized vector on the gpu for len elements of type T.

Source

pub fn init( device: &Device, vector: impl AsRef<[T]>, usage: BufferUsages, ) -> Self
where T: Pod,

Allocates a new vector on the gpu initialized from vector.

If T does not implement Pod, use GpuMatrix::encase instead.

Source

pub fn rows(&self, first_row: u32, num_rows: u32) -> GpuVectorView<'_, T>

Takes a view, over this vector, with num_rows rows starting at row first_row.