Matrix descriptor functions

Matrix descriptor functions#

hipSPARSELt: Matrix descriptor functions
Matrix descriptor functions

Functions

hipsparseStatus_t hipsparseLtDenseDescriptorInit (const hipsparseLtHandle_t *handle, hipsparseLtMatDescriptor_t *matDescr, int64_t rows, int64_t cols, int64_t ld, uint32_t alignment, hipDataType valueType, hipsparseOrder_t order)
 Create a descriptor for dense matrix. More...
 
hipsparseStatus_t hipsparseLtStructuredDescriptorInit (const hipsparseLtHandle_t *handle, hipsparseLtMatDescriptor_t *matDescr, int64_t rows, int64_t cols, int64_t ld, uint32_t alignment, hipDataType valueType, hipsparseOrder_t order, hipsparseLtSparsity_t sparsity)
 Create a descriptor for structured matrix. More...
 
hipsparseStatus_t hipsparseLtMatDescriptorDestroy (const hipsparseLtMatDescriptor_t *matDescr)
 Destroy a matrix descriptor. More...
 
hipsparseStatus_t hipsparseLtMatDescSetAttribute (const hipsparseLtHandle_t *handle, hipsparseLtMatDescriptor_t *matDescr, hipsparseLtMatDescAttribute_t matAttribute, const void *data, size_t dataSize)
 Specify the matrix attribute of a matrix descriptor. More...
 
hipsparseStatus_t hipsparseLtMatDescGetAttribute (const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *matDescr, hipsparseLtMatDescAttribute_t matAttribute, void *data, size_t dataSize)
 Get the matrix type of a matrix descriptor. More...
 

Detailed Description

Defines sparse and dense matrices

Function Documentation

◆ hipsparseLtDenseDescriptorInit()

hipsparseStatus_t hipsparseLtDenseDescriptorInit ( const hipsparseLtHandle_t handle,
hipsparseLtMatDescriptor_t matDescr,
int64_t  rows,
int64_t  cols,
int64_t  ld,
uint32_t  alignment,
hipDataType  valueType,
hipsparseOrder_t  order 
)

Create a descriptor for dense matrix.

hipsparseLtDenseDescriptorInit creates a matrix descriptor It initializes It should be destroyed at the end using hipsparseLtMatDescriptorDestroy().

Parameters
[in]handlethe hipsparselt handle
[out]matDescrthe pointer to the dense matrix descriptor
[in]rowsnumber of rows
[in]colsnumber of columns
[in]ldleading dimension
[in]alignmentmemory alignment in bytes (not used by HIP backend)
[in]valueTypedata type of the matrix. see hipDataType
[in]ordermemory layout. HIPSPARSE_ORDER_COL or HIPSPARSE_ORDER_ROW.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, descr , rows , cols , ld is invalid.
HIPSPARSE_STATUS_NOT_SUPPORTEDrows , cols , ld , alignment , valueType or order is not supported.

◆ hipsparseLtMatDescGetAttribute()

hipsparseStatus_t hipsparseLtMatDescGetAttribute ( const hipsparseLtHandle_t handle,
const hipsparseLtMatDescriptor_t matDescr,
hipsparseLtMatDescAttribute_t  matAttribute,
void *  data,
size_t  dataSize 
)

Get the matrix type of a matrix descriptor.

hipsparseLtMatDescGetAttribute returns the matrix attribute of a matrix descriptor

Parameters
[in]handlethe hipsparselt handle
[in]matDescrthe matrix descriptor
[in]matAttributeHIPSPARSELT_MAT_NUM_BATCHES, HIPSPARSELT_MAT_BATCH_STRIDE.
[in,out]datathe memory address containing the attribute value retrieved by this function
[in]dataSizesize in bytes of the attribute value used for verification.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle , descr , data or dataSize is invalid.

◆ hipsparseLtMatDescriptorDestroy()

hipsparseStatus_t hipsparseLtMatDescriptorDestroy ( const hipsparseLtMatDescriptor_t matDescr)

Destroy a matrix descriptor.

hipsparseLtMatDescriptorDestroy destroys a matrix descriptor and releases all resources used by the descriptor

Parameters
[in]matDescrthe matrix descriptor
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEdescr is invalid.

◆ hipsparseLtMatDescSetAttribute()

hipsparseStatus_t hipsparseLtMatDescSetAttribute ( const hipsparseLtHandle_t handle,
hipsparseLtMatDescriptor_t matDescr,
hipsparseLtMatDescAttribute_t  matAttribute,
const void *  data,
size_t  dataSize 
)

Specify the matrix attribute of a matrix descriptor.

hipsparseLtMatDescSetAttribute sets the value of the specified attribute belonging to matrix descr such as number of batches and their stride.

Parameters
[in]handlethe hipsparselt handle
[in,out]matDescrthe matrix descriptor
[in]matAttributeHIPSPARSELT_MAT_NUM_BATCHES, HIPSPARSELT_MAT_BATCH_STRIDE.
[in]datapointer to the value to which the specified attribute will be set.
[in]dataSizesize in bytes of the attribute value used for verification.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle , matmulDescr , data or dataSize is invalid.

◆ hipsparseLtStructuredDescriptorInit()

hipsparseStatus_t hipsparseLtStructuredDescriptorInit ( const hipsparseLtHandle_t handle,
hipsparseLtMatDescriptor_t matDescr,
int64_t  rows,
int64_t  cols,
int64_t  ld,
uint32_t  alignment,
hipDataType  valueType,
hipsparseOrder_t  order,
hipsparseLtSparsity_t  sparsity 
)

Create a descriptor for structured matrix.

hipsparseLtStructuredDescriptorInit creates a matrix descriptor It initializes It should be destroyed at the end using hipsparseLtMatDescriptorDestroy().

Parameters
[in]handlethe hipsparselt handle
[out]matDescrthe pointer to the dense matrix descriptor
[in]rowsnumber of rows
[in]colsnumber of columns
[in]ldleading dimension
[in]alignmentmemory alignment in bytes (not used by HIP backend)
[in]valueTypedata type of the matrix. see hipDataType
[in]ordermemory layout. HIPSPARSE_ORDER_COL or HIPSPARSE_ORDER_ROW.
[in]sparsitymatrix sparsity ratio. see hipsparseLtSparsity_t
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, descr , rows , cols , ld is invalid.
HIPSPARSE_STATUS_NOT_SUPPORTEDrows , cols , ld , alignment , valueType or order is not supported.