pub struct DenseMatrixDescriptor<'a> { /* private fields */ }Implementations§
Source§impl<'a> DenseMatrixDescriptor<'a>
impl<'a> DenseMatrixDescriptor<'a>
Sourcepub fn create<T: DataTypeLike>(
ctx: &Context,
rows: usize,
cols: usize,
leading_dimension: usize,
values: &'a mut DeviceMemory<T>,
order: Order,
) -> Result<Self>
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.
Sourcepub fn values(&self) -> Result<DevicePtr>
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.
Sourcepub fn set_values<T: DataTypeLike>(
&mut self,
values: &'a mut DeviceMemory<T>,
) -> Result<()>
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.
Sourcepub fn info(&self) -> Result<DenseMatrixInfo>
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.
Sourcepub fn set_strided_batch(
&mut self,
batch_count: usize,
batch_stride: usize,
) -> Result<()>
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.
Sourcepub fn strided_batch(&self) -> Result<(i32, usize)>
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.
pub fn as_raw(&self) -> cusparseDnMatDescr_t
pub fn as_raw_const(&self) -> cusparseConstDnMatDescr_t
pub fn cuda_context(&self) -> &Arc<CudaContext>
Sourcepub unsafe fn from_raw(
handle: cusparseDnMatDescr_t,
ctx: &Context,
) -> Result<Self>
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.
Sourcepub fn into_raw(self) -> cusparseDnMatDescr_t
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.