Skip to main content

MatrixDescriptor

Struct MatrixDescriptor 

Source
pub struct MatrixDescriptor { /* private fields */ }

Implementations§

Source§

impl MatrixDescriptor

Source

pub fn create() -> Result<Self>

Initializes a matrix descriptor. It sets MatrixType and IndexBase to MatrixType::General and IndexBase::Zero, respectively, while leaving other fields uninitialized.

§Errors

Returns an error if cuSPARSE cannot create the descriptor or if it returns a null handle.

Source

pub fn matrix_type(&self) -> MatrixType

Returns the MatrixType field of this matrix descriptor.

Source

pub fn set_matrix_type(&mut self, matrix_type: MatrixType) -> Result<()>

Sets the MatrixType field of this matrix descriptor.

§Errors

Returns an error if cuSPARSE rejects matrix_type.

Source

pub fn fill_mode(&self) -> FillMode

Returns the FillMode field of this matrix descriptor.

Source

pub fn set_fill_mode(&mut self, fill_mode: FillMode) -> Result<()>

Sets the FillMode field of this matrix descriptor.

§Errors

Returns an error if cuSPARSE rejects fill_mode.

Source

pub fn diagonal_type(&self) -> DiagonalType

Returns the DiagonalType field of this matrix descriptor.

Source

pub fn set_diagonal_type(&mut self, diagonal_type: DiagonalType) -> Result<()>

Sets the DiagonalType field of this matrix descriptor.

§Errors

Returns an error if cuSPARSE rejects diagonal_type.

Source

pub fn index_base(&self) -> IndexBase

Returns the IndexBase field of this matrix descriptor.

Source

pub fn set_index_base(&mut self, index_base: IndexBase) -> Result<()>

Sets the IndexBase field of this matrix descriptor.

§Errors

Returns an error if cuSPARSE rejects index_base.

Source

pub fn as_raw(&self) -> cusparseMatDescr_t

Source

pub unsafe fn from_raw(handle: cusparseMatDescr_t) -> Result<Self>

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

§Safety

handle must be a valid cusparseMatDescr_t. 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) -> cusparseMatDescr_t

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

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

Trait Implementations§

Source§

impl Debug for MatrixDescriptor

Source§

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

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

impl Drop for MatrixDescriptor

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 MatrixDescriptor

Source§

impl Sync for MatrixDescriptor

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.