Skip to main content

MatDescr

Struct MatDescr 

Source
pub struct MatDescr { /* private fields */ }
Expand description

RAII wrapper for aoclsparse_mat_descr.

Implementations§

Source§

impl MatDescr

Source

pub fn new() -> Result<Self>

Create a fresh descriptor with library defaults.

Source

pub fn as_raw(&self) -> aoclsparse_mat_descr

Borrow the underlying handle for raw FFI calls.

§Safety

The returned pointer is valid only for the lifetime of self. Do not call aoclsparse_destroy_mat_descr on it.

Source

pub fn set_type(&mut self, ty: MatType) -> Result<()>

Set the matrix-type hint (general / symmetric / hermitian / triangular). Affects which fast paths the library can take.

Source

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

Set the index base (zero- or one-based) for column / row arrays.

Source

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

For triangular / symmetric matrices, declare which triangle is stored (upper or lower).

Source

pub fn set_diag_type(&mut self, diag: DiagType) -> Result<()>

For triangular matrices, declare whether the diagonal is unit (implicit) or non-unit (explicitly stored).

Source

pub fn ty(&self) -> MatType

Read back the matrix-type hint.

Source

pub fn index_base(&self) -> IndexBase

Read back the index base.

Source

pub fn fill_mode(&self) -> FillMode

Read back the fill mode.

Source

pub fn diag_type(&self) -> DiagType

Read back the diagonal-type hint.

Trait Implementations§

Source§

impl Debug for MatDescr

Source§

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

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

impl Drop for MatDescr

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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<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 = 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.