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, hipsparseLtDatatype_t 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, hipsparseLtDatatype_t 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, | ||
hipsparseLtDatatype_t | 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] handle the hipsparselt handle [out] matDescr the pointer to the dense matrix descriptor [in] rows number of rows [in] cols number of columns [in] ld leading dimension [in] alignment memory alignment in bytes (not used by HIP backend) [in] valueType data type of the matrix. see hipsparseLtDatatype_t [in] order memory layout. HIPSPARSE_ORDER_COL
orHIPSPARSE_ORDER_ROW
. (HIP backend only support HIPSPARSE_ORDER_COL.)
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle
,descr
,rows
,cols
,ld
is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED rows
,cols
,ld
,alignment
,valueType
ororder
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] handle the hipsparselt handle [in] matDescr the matrix descriptor [in] matAttribute HIPSPARSELT_MAT_NUM_BATCHES, HIPSPARSELT_MAT_BATCH_STRIDE. [in,out] data the memory address containing the attribute value retrieved by this function [in] dataSize size in bytes of the attribute value used for verification.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle
,descr
,data
ordataSize
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] matDescr the matrix descriptor
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE descr
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] handle the hipsparselt handle [in,out] matDescr the matrix descriptor [in] matAttribute HIPSPARSELT_MAT_NUM_BATCHES, HIPSPARSELT_MAT_BATCH_STRIDE. [in] data pointer to the value to which the specified attribute will be set. [in] dataSize size in bytes of the attribute value used for verification.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle
,matmulDescr
,data
ordataSize
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, | ||
hipsparseLtDatatype_t | 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] handle the hipsparselt handle [out] matDescr the pointer to the dense matrix descriptor [in] rows number of rows [in] cols number of columns [in] ld leading dimension [in] alignment memory alignment in bytes (not used by HIP backend) [in] valueType data type of the matrix. see hipsparseLtDatatype_t [in] order memory layout. HIPSPARSE_ORDER_COL
orHIPSPARSE_ORDER_ROW
. (HIP backend only support HIPSPARSE_ORDER_COL.)[in] sparsity matrix sparsity ratio. see hipsparseLtSparsity_t
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle
,descr
,rows
,cols
,ld
is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED rows
,cols
,ld
,alignment
,valueType
ororder
is not supported.