pub struct DenseVectorDescriptor<'a> { /* private fields */ }Implementations§
Source§impl<'a> DenseVectorDescriptor<'a>
impl<'a> DenseVectorDescriptor<'a>
Sourcepub fn create<T: DataTypeLike>(
ctx: &Context,
size: usize,
values: &'a mut DeviceMemory<T>,
) -> Result<Self>
pub fn create<T: DataTypeLike>( ctx: &Context, size: usize, values: &'a mut DeviceMemory<T>, ) -> Result<Self>
Initializes a dense vector descriptor.
The descriptor borrows the device value buffer by pointer; the buffer must
outlive descriptor use or be replaced with DenseVectorDescriptor::set_values.
§Errors
Returns an error if size cannot be represented by cuSPARSE, if cuSPARSE
cannot create the descriptor, or if it returns a null handle.
Sourcepub fn values(&self) -> Result<DevicePtr>
pub fn values(&self) -> Result<DevicePtr>
Returns the values pointer of this dense vector 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 vector 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<DenseVectorInfo>
pub fn info(&self) -> Result<DenseVectorInfo>
Returns the fields of this dense vector descriptor.
§Errors
Returns an error if cuSPARSE cannot report the descriptor fields or if the
reported size cannot be represented as usize.
pub fn as_raw(&self) -> cusparseDnVecDescr_t
pub fn as_raw_const(&self) -> cusparseConstDnVecDescr_t
pub fn cuda_context(&self) -> &Arc<CudaContext>
Sourcepub unsafe fn from_raw(
handle: cusparseDnVecDescr_t,
ctx: &Context,
) -> Result<Self>
pub unsafe fn from_raw( handle: cusparseDnVecDescr_t, ctx: &Context, ) -> Result<Self>
Wraps an existing cuSPARSE dense-vector descriptor and takes ownership of it.
§Safety
handle must be a valid cusparseDnVecDescr_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) -> cusparseDnVecDescr_t
pub fn into_raw(self) -> cusparseDnVecDescr_t
Consumes the descriptor and returns the raw cuSPARSE handle without destroying it.
The caller becomes responsible for eventually destroying the returned
handle with cusparseDestroyDnVec.