Skip to main content

DeviceBuffer

Struct DeviceBuffer 

Source
pub struct DeviceBuffer<T: DeviceElement> { /* private fields */ }
Expand description

A typed owner for a cudf runtime-allocated device buffer.

Implementations§

Source§

impl<T: DeviceElement> DeviceBuffer<T>

Source

pub fn new(resources: &CuvsResources, len: usize) -> Result<Self>

Source

pub fn from_slice(resources: &CuvsResources, values: &[T]) -> Result<Self>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn size_bytes(&self) -> usize

Source

pub fn binding_id(&self) -> ExecutionBindingId

Source

pub fn runtime(&self) -> &Arc<Runtime> ⓘ

Source

pub fn as_validated_tensor<'a>( &'a self, resources: &CuvsResources, shape: &[usize], strides: Option<&[usize]>, byte_offset: usize, ) -> Result<ValidatedDeviceTensor<'a, T>>

Source

pub fn as_validated_matrix( &self, resources: &CuvsResources, rows: usize, columns: usize, ) -> Result<ValidatedDeviceTensor<'_, T>>

Source

pub fn as_tensor<'a>( &'a self, resources: &CuvsResources, shape: &[usize], strides: Option<&[usize]>, byte_offset: usize, ) -> Result<DeviceTensor<'a, T>>

Source

pub fn as_tensor_mut<'a>( &'a mut self, resources: &CuvsResources, shape: &[usize], strides: Option<&[usize]>, byte_offset: usize, ) -> Result<DeviceTensorMut<'a, T>>

Source

pub fn as_matrix( &self, resources: &CuvsResources, rows: usize, columns: usize, ) -> Result<DeviceTensor<'_, T>>

Source

pub fn as_matrix_mut( &mut self, resources: &CuvsResources, rows: usize, columns: usize, ) -> Result<DeviceTensorMut<'_, T>>

Source

pub fn inner(&self) -> &CudfDeviceBuffer

Source

pub fn into_inner(self) -> CudfDeviceBuffer

Source

pub fn into_column(self) -> Result<Column>

Adopt this allocation as one flat cudf column without copying it.

Trait Implementations§

Source§

impl<T: DeviceElement> Debug for DeviceBuffer<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for DeviceBuffer<T>

§

impl<T> !UnwindSafe for DeviceBuffer<T>

§

impl<T> Freeze for DeviceBuffer<T>
where PhantomData<T>: Freeze,

§

impl<T> Send for DeviceBuffer<T>
where PhantomData<T>: Send,

§

impl<T> Sync for DeviceBuffer<T>
where PhantomData<T>: Sync,

§

impl<T> Unpin for DeviceBuffer<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for DeviceBuffer<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.