Skip to main content

DenseMatrixDescriptor

Struct DenseMatrixDescriptor 

Source
pub struct DenseMatrixDescriptor<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> DenseMatrixDescriptor<'a>

Source

pub fn create<T: DataTypeLike>( ctx: &Context, rows: usize, cols: usize, leading_dimension: usize, values: &'a mut DeviceMemory<T>, order: Order, ) -> Result<Self>

Initializes a dense matrix descriptor.

The descriptor borrows the device value buffer by pointer; the buffer must remain valid while the descriptor uses it.

Source

pub fn values(&self) -> Result<DevicePtr>

Returns the values pointer of this dense matrix descriptor.

§Errors

Returns an error if cuSPARSE cannot report the values pointer.

Source

pub fn set_values<T: DataTypeLike>( &mut self, values: &'a mut DeviceMemory<T>, ) -> Result<()>

Sets the values pointer of this dense matrix descriptor.

The pointed-to device buffer must remain valid while the descriptor uses it.

§Errors

Returns an error if cuSPARSE rejects the values pointer.

Source

pub fn info(&self) -> Result<DenseMatrixInfo>

Returns the fields of this dense matrix descriptor.

§Errors

Returns an error if cuSPARSE cannot report the descriptor fields or if reported dimensions cannot be represented as usize.

Source

pub fn set_strided_batch( &mut self, batch_count: usize, batch_stride: usize, ) -> Result<()>

Sets the number of batches and the batch stride of this dense matrix descriptor.

§Errors

Returns an error if either argument cannot be represented by cuSPARSE or if cuSPARSE rejects the strided batch settings.

Source

pub fn strided_batch(&self) -> Result<(i32, usize)>

Returns the number of batches and the batch stride of this dense matrix descriptor.

§Errors

Returns an error if cuSPARSE cannot report the strided batch settings or if the reported stride cannot be represented as usize.

Source

pub fn as_raw(&self) -> cusparseDnMatDescr_t

Source

pub fn as_raw_const(&self) -> cusparseConstDnMatDescr_t

Source

pub fn cuda_context(&self) -> &Arc<CudaContext>

Source

pub unsafe fn from_raw( handle: cusparseDnMatDescr_t, ctx: &Context, ) -> Result<Self>

Wraps an existing cuSPARSE dense-matrix descriptor and takes ownership of it.

§Safety

handle must be a valid cusparseDnMatDescr_t. Any device buffer referenced by the descriptor must remain valid for lifetime 'a. Ownership of handle is transferred to the returned descriptor, and the handle must not be destroyed elsewhere after calling this function.

Source

pub fn into_raw(self) -> cusparseDnMatDescr_t

Consumes the descriptor and returns the raw cuSPARSE handle without destroying it.

The caller becomes responsible for eventually destroying the returned handle with cusparseDestroyDnMat.

Trait Implementations§

Source§

impl<'a> Debug for DenseMatrixDescriptor<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for DenseMatrixDescriptor<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for DenseMatrixDescriptor<'_>

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.