Skip to main content
`Ctrl`+`K`

# Data types

hipSPARSELt: Data types
Data Structures | Enumerations
Data types

## Data Structures

struct | hipsparseLtHandle_t
| Handle to the hipSPARSELt library context queue. More...
struct | hipsparseLtMatDescriptor_t
| Descriptor of the matrix. More...
struct | hipsparseLtMatmulDescriptor_t
| Descriptor of the matrix multiplication operation. More...
struct | hipsparseLtMatmulAlgSelection_t
| Descriptor of the matrix multiplication algorithm. More...
struct | hipsparseLtMatmulPlan_t
| Descriptor of the matrix multiplication execution plan. More...

## Enumerations

enum | hipsparseLtSparsity_t { HIPSPARSELT_SPARSITY_50_PERCENT }
| Specify the sparsity of the structured matrix. More...
enum | hipsparseLtMatDescAttribute_t { HIPSPARSELT_MAT_NUM_BATCHES , HIPSPARSELT_MAT_BATCH_STRIDE }
| Specify the additional attributes of a matrix descriptor. More...
enum | hipsparseLtComputetype_t { HIPSPARSELT_COMPUTE_16F = 0 , HIPSPARSELT_COMPUTE_32I , HIPSPARSELT_COMPUTE_32F , HIPSPARSELT_COMPUTE_TF32 , HIPSPARSELT_COMPUTE_TF32_FAST }
| Specify the compute precision modes of the matrix. More...

enum

hipsparseLtMatmulDescAttribute_t {
HIPSPARSELT_MATMUL_ACTIVATION_RELU = 0 ,
HIPSPARSELT_MATMUL_ACTIVATION_RELU_UPPERBOUND = 1 ,
HIPSPARSELT_MATMUL_ACTIVATION_RELU_THRESHOLD = 2 ,
HIPSPARSELT_MATMUL_ACTIVATION_GELU = 3 ,
HIPSPARSELT_MATMUL_ACTIVATION_GELU_SCALING = 4 ,
HIPSPARSELT_MATMUL_ALPHA_VECTOR_SCALING = 5 ,
HIPSPARSELT_MATMUL_BETA_VECTOR_SCALING = 6 ,
HIPSPARSELT_MATMUL_BIAS_STRIDE = 7 ,
HIPSPARSELT_MATMUL_BIAS_POINTER = 8 ,
HIPSPARSELT_MATMUL_ACTIVATION_ABS = 9 ,
HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU = 10 ,
HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU_ALPHA = 11 ,
HIPSPARSELT_MATMUL_ACTIVATION_SIGMOID = 12 ,
HIPSPARSELT_MATMUL_ACTIVATION_TANH = 13 ,
HIPSPARSELT_MATMUL_ACTIVATION_TANH_ALPHA = 14 ,
HIPSPARSELT_MATMUL_ACTIVATION_TANH_BETA = 15 ,
HIPSPARSELT_MATMUL_BIAS_TYPE = 16 ,
HIPSPARSELT_MATMUL_SPARSE_MAT_POINTER = 17
}

| Specify the additional attributes of a matrix multiplication descriptor. More...
enum | hipsparseLtMatmulAlg_t { HIPSPARSELT_MATMUL_ALG_DEFAULT }
| Specify the algorithm for matrix-matrix multiplication. More...
enum | hipsparseLtMatmulAlgAttribute_t { HIPSPARSELT_MATMUL_ALG_CONFIG_ID = 0 , HIPSPARSELT_MATMUL_ALG_CONFIG_MAX_ID = 1 , HIPSPARSELT_MATMUL_SEARCH_ITERATIONS = 2 , HIPSPARSELT_MATMUL_SPLIT_K = 3 , HIPSPARSELT_MATMUL_SPLIT_K_MODE = 4 , HIPSPARSELT_MATMUL_SPLIT_K_BUFFERS = 5 }
| Specify the matrix multiplication algorithm attributes. More...
enum | hipsparseLtPruneAlg_t { HIPSPARSELT_PRUNE_SPMMA_TILE = 0 , HIPSPARSELT_PRUNE_SPMMA_STRIP = 1 }
| Specify the pruning algorithm to apply to the structured matrix before the compression. More...
enum | hipsparseLtSplitKMode_t { HIPSPARSELT_SPLIT_K_MODE_ONE_KERNEL = 0 , HIPSPARSELT_SPLIT_K_MODE_TWO_KERNELS = 1 }
| Specify the split k mode value. More...

## Detailed Description

HIP = Heterogeneous-compute Interface for Portability

Define a extremely thin runtime layer that allows source code to be compiled unmodified through either AMD HCC or NVCC. Key features tend to be in the spirit and terminology of CUDA, but with a portable path to other GPUs as well.

This is the master include file for hipSPARSELt, wrapping around hipSPARSELt and cuSPARSELt "version 0.3".

## Enumeration Type Documentation

## ◆ hipsparseLtComputetype_t

enum hipsparseLtComputetype_t

Specify the compute precision modes of the matrix.

Enumerator
HIPSPARSELT_COMPUTE_16F | 16-bit floating-point precision. CUDA backend only.
HIPSPARSELT_COMPUTE_32I | 32-bit integer precision
HIPSPARSELT_COMPUTE_32F | 32-bit floating-point precision. HIP backend only.
HIPSPARSELT_COMPUTE_TF32 | 32-bit floating point value are rounded to TF32 before the computation. CUDA backend only.
HIPSPARSELT_COMPUTE_TF32_FAST | 32-bit floating point value are truncated to TF32 before the computation. CUDA backend only.

## ◆ hipsparseLtMatDescAttribute_t

enum hipsparseLtMatDescAttribute_t

Specify the additional attributes of a matrix descriptor.

The hipsparseLtMatDescAttribute_t is used in the hipsparseLtMatDescSetAttribute and hipsparseLtMatDescGetAttribute functions

Enumerator
HIPSPARSELT_MAT_NUM_BATCHES | number of matrices in a batch. READ/WRITE
HIPSPARSELT_MAT_BATCH_STRIDE | stride between consecutive matrices in a batch expressed in terms of matrix elements. READ/WRITE

## ◆ hipsparseLtMatmulAlg_t

enum hipsparseLtMatmulAlg_t

Specify the algorithm for matrix-matrix multiplication.

The hipsparseLtMatmulAlg_t is used in the hipsparseLtMatmulAlgSelectionInit function.

Enumerator
HIPSPARSELT_MATMUL_ALG_DEFAULT |

## ◆ hipsparseLtMatmulAlgAttribute_t

enum hipsparseLtMatmulAlgAttribute_t

Specify the matrix multiplication algorithm attributes.

The hipsparseLtMatmulAlgAttribute_t is used in the hipsparseLtMatmulAlgGetAttribute and hipsparseLtMatmulAlgSetAttribute functions.

Enumerator
HIPSPARSELT_MATMUL_ALG_CONFIG_ID |
HIPSPARSELT_MATMUL_ALG_CONFIG_MAX_ID |
HIPSPARSELT_MATMUL_SEARCH_ITERATIONS |
HIPSPARSELT_MATMUL_SPLIT_K |
HIPSPARSELT_MATMUL_SPLIT_K_MODE |
HIPSPARSELT_MATMUL_SPLIT_K_BUFFERS |

## ◆ hipsparseLtMatmulDescAttribute_t

enum hipsparseLtMatmulDescAttribute_t

Specify the additional attributes of a matrix multiplication descriptor.

The hipsparseLtMatmulDescAttribute_t is used in the hipsparseLtMatmulDescSetAttribute and hipsparseLtMatmulDescGetAttribute functions

Enumerator
HIPSPARSELT_MATMUL_ACTIVATION_RELU | ReLU activation function.
HIPSPARSELT_MATMUL_ACTIVATION_RELU_UPPERBOUND | Upper bound of the ReLU activation function.
HIPSPARSELT_MATMUL_ACTIVATION_RELU_THRESHOLD | Lower threshold of the ReLU activation function.
HIPSPARSELT_MATMUL_ACTIVATION_GELU | GeLU activation function.
HIPSPARSELT_MATMUL_ACTIVATION_GELU_SCALING | Scaling coefficient for the GeLU activation function. It implies gelu is endable
HIPSPARSELT_MATMUL_ALPHA_VECTOR_SCALING | Enable/Disable alpha vector (per-channel) scaling
HIPSPARSELT_MATMUL_BETA_VECTOR_SCALING | Enable/Disable beta vector (per-channel) scaling
HIPSPARSELT_MATMUL_BIAS_STRIDE | Bias pointer. The bias vector size must equal to the number of rows of the output matrix (D).
HIPSPARSELT_MATMUL_BIAS_POINTER | Bias stride between consecutive bias vectors. 0 means broadcast the first bias vector.
HIPSPARSELT_MATMUL_ACTIVATION_ABS | ABS activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU | LeakyReLU activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU_ALPHA | Alpha value of the LeakyReLU activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_SIGMOID | Sigmoid activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_TANH | Tanh activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_TANH_ALPHA | Alpha value of the Tanh activation function. HIP backend only
HIPSPARSELT_MATMUL_ACTIVATION_TANH_BETA | Beta value of the Tanh activation function. HIP backend only
HIPSPARSELT_MATMUL_BIAS_TYPE | Precision of Bias. HIP backend only, When Input's datatype is FP16 - Bias type can be FP16 or FP32. (default FP16) When Input's datatype is BF16 - Bias type can be BF16 or FP32. (default BF16) In other cases - Bias type is FP32.
HIPSPARSELT_MATMUL_SPARSE_MAT_POINTER | Pointer to the pruned sparse matrix.

## ◆ hipsparseLtPruneAlg_t

enum hipsparseLtPruneAlg_t

Specify the pruning algorithm to apply to the structured matrix before the compression.

The hipsparseLtPruneAlg_t is used in the hipsparseLtSpMMAPrune and hipsparseLtSpMMAPrune2 function.

Enumerator
HIPSPARSELT_PRUNE_SPMMA_TILE | Zero out eight elements in a 4x4 tile, nonzero elements have the maximum L1-norm value in all combinations in the tile. Exactly two elements in each row and column.
HIPSPARSELT_PRUNE_SPMMA_STRIP | Zero out two elements in a 1x4 strip, nonzero elements have the maximum L1-norm value in all combinations in the strip.

## ◆ hipsparseLtSparsity_t

enum hipsparseLtSparsity_t

Specify the sparsity of the structured matrix.

The enumerator specifies the sparsity ratio of the structured matrix as sparsity = nnz / total elements The sparsity property is used in the hipsparseLtStructuredDescriptorInit function.

Enumerator
HIPSPARSELT_SPARSITY_50_PERCENT | 50% sparsity ratio - 1:2 for tf32 and float, 2:4 for half, bfloat16, int

## ◆ hipsparseLtSplitKMode_t

enum hipsparseLtSplitKMode_t

Specify the split k mode value.

The hipsparseLtSplitKMode_t is used by HIPSPARSELT_MATMUL_SPLIT_K_MODE attribute in hipsparseLtMatmulAlgAttribute_t.

Enumerator
HIPSPARSELT_SPLIT_K_MODE_ONE_KERNEL | Use the same SP-MM kernel to do the final reduction
HIPSPARSELT_SPLIT_K_MODE_TWO_KERNELS | Use another kernel to do the final reduction