/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/docs-6.1.1/library/include/hipsparselt.h File Reference

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/docs-6.1.1/library/include/hipsparselt.h File Reference#

hipSPARSELt: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/docs-6.1.1/library/include/hipsparselt.h File Reference
hipsparselt.h File Reference

hipsparselt.h provides Sparse Linear Algebra Subprograms of Prune, Compressed and Matrix Multiplication, using HIP optimized for AMD GPU hardware. More...

#include <hipsparse/hipsparse.h>
#include <hipsparselt/hipsparselt-export.h>
#include <hipsparselt/hipsparselt-version.h>
#include <hip/hip_complex.h>
#include <hip/hip_runtime_api.h>
#include <hip/hip_bfloat16.h>
#include <hip/hip_fp16.h>
#include <hip/library_types.h>
Include dependency graph for hipsparselt.h:

Go to the source code of this file.

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...
 

Macros

#define _HIPSPARSELT_H_
 

Enumerations

enum  hipsparseLtDatatype_t {
  HIPSPARSELT_R_16F = 150 ,
  HIPSPARSELT_R_32F = 151 ,
  HIPSPARSELT_R_8I = 160 ,
  HIPSPARSELT_R_16BF = 168 ,
  HIPSPARSELT_R_8F = 170 ,
  HIPSPARSELT_R_8BF = 171
}
 List of hipsparselt data types. More...
 
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
}
 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...
 

Functions

void hipsparseLtInitialize ()
 Initialize hipSPARSELt for the current HIP device. More...
 
hipsparseStatus_t hipsparseLtGetVersion (const hipsparseLtHandle_t *handle, int *version)
 Retrive the version number of the hipSPARSELt library. More...
 
hipsparseStatus_t hipsparseLtGetProperty (hipLibraryPropertyType propertyType, int *value)
 Retrive the value of the requested property. More...
 
hipsparseStatus_t hipsparseLtGetGitRevision (hipsparseLtHandle_t handle, char *rev)
 
hipsparseStatus_t hipsparseLtGetArchName (char **archName)
 
hipsparseStatus_t hipsparseLtInit (hipsparseLtHandle_t *handle)
 Create a hipsparselt handle. More...
 
hipsparseStatus_t hipsparseLtDestroy (const hipsparseLtHandle_t *handle)
 Destroy a hipsparselt handle. More...
 
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...
 
hipsparseStatus_t hipsparseLtMatmulDescriptorInit (const hipsparseLtHandle_t *handle, hipsparseLtMatmulDescriptor_t *matmulDescr, hipsparseOperation_t opA, hipsparseOperation_t opB, const hipsparseLtMatDescriptor_t *matA, const hipsparseLtMatDescriptor_t *matB, const hipsparseLtMatDescriptor_t *matC, const hipsparseLtMatDescriptor_t *matD, hipsparseLtComputetype_t computeType)
 Initializes the matrix multiplication descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulDescSetAttribute (const hipsparseLtHandle_t *handle, hipsparseLtMatmulDescriptor_t *matmulDescr, hipsparseLtMatmulDescAttribute_t matmulAttribute, const void *data, size_t dataSize)
 Specify the matrix attribute of a matrix descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulDescGetAttribute (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulDescriptor_t *matmulDescr, hipsparseLtMatmulDescAttribute_t matmulAttribute, void *data, size_t dataSize)
 Get the matrix type of a matrix descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulAlgSelectionInit (const hipsparseLtHandle_t *handle, hipsparseLtMatmulAlgSelection_t *algSelection, const hipsparseLtMatmulDescriptor_t *matmulDescr, hipsparseLtMatmulAlg_t alg)
 Initializes the algorithm selection descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulAlgSetAttribute (const hipsparseLtHandle_t *handle, hipsparseLtMatmulAlgSelection_t *algSelection, hipsparseLtMatmulAlgAttribute_t attribute, const void *data, size_t dataSize)
 Specify the algorithm attribute of a algorithm selection descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulAlgGetAttribute (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulAlgSelection_t *algSelection, hipsparseLtMatmulAlgAttribute_t attribute, void *data, size_t dataSize)
 Get the specific algorithm attribute from algorithm selection descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulGetWorkspace (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, size_t *workspaceSize)
 Determines the required workspace size. More...
 
hipsparseStatus_t hipsparseLtMatmulPlanInit (const hipsparseLtHandle_t *handle, hipsparseLtMatmulPlan_t *plan, const hipsparseLtMatmulDescriptor_t *matmulDescr, const hipsparseLtMatmulAlgSelection_t *algSelection)
 Initializes the matrix multiplication plan descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmulPlanDestroy (const hipsparseLtMatmulPlan_t *plan)
 Destroy a matrix multiplication plan descriptor. More...
 
hipsparseStatus_t hipsparseLtMatmul (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, const void *alpha, const void *d_A, const void *d_B, const void *beta, const void *d_C, void *d_D, void *workspace, hipStream_t *streams, int32_t numStreams)
 Sparse matrix dense matrix multiplication. More...
 
hipsparseStatus_t hipsparseLtMatmulSearch (const hipsparseLtHandle_t *handle, hipsparseLtMatmulPlan_t *plan, const void *alpha, const void *d_A, const void *d_B, const void *beta, const void *d_C, void *d_D, void *workspace, hipStream_t *streams, int32_t numStreams)
 Sparse matrix dense matrix multiplication. More...
 
hipsparseStatus_t hipsparseLtSpMMAPrune (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulDescriptor_t *matmulDescr, const void *d_in, void *d_out, hipsparseLtPruneAlg_t pruneAlg, hipStream_t stream)
 Purnes a dense matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMAPruneCheck (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulDescriptor_t *matmulDescr, const void *d_in, int *d_valid, hipStream_t stream)
 checks the correctness of the pruning structure for a given matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMAPrune2 (const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *sparseMatDescr, int isSparseA, hipsparseOperation_t op, const void *d_in, void *d_out, hipsparseLtPruneAlg_t pruneAlg, hipStream_t stream)
 Purnes a dense matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMAPruneCheck2 (const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *sparseMatDescr, int isSparseA, hipsparseOperation_t op, const void *d_in, int *d_valid, hipStream_t stream)
 checks the correctness of the pruning structure for a given matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMACompressedSize (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, size_t *compressedSize, size_t *compressBufferSize)
 provide the size of the compressed matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMACompress (const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, const void *d_dense, void *d_compressed, void *d_compressBuffer, hipStream_t stream)
 compresses a dense matrix to structured matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMACompressedSize2 (const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *sparseMatDescr, size_t *compressedSize, size_t *compressBufferSize)
 provide the size of the compressed matrix. More...
 
hipsparseStatus_t hipsparseLtSpMMACompress2 (const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *sparseMatDescr, int isSparseA, hipsparseOperation_t op, const void *d_dense, void *d_compressed, void *d_compressBuffer, hipStream_t stream)
 compresses a dense matrix to structured matrix. More...
 

Detailed Description

hipsparselt.h provides Sparse Linear Algebra Subprograms of Prune, Compressed and Matrix Multiplication, using HIP optimized for AMD GPU hardware.

Macro Definition Documentation

◆ _HIPSPARSELT_H_

#define _HIPSPARSELT_H_

Function Documentation

◆ hipsparseLtGetArchName()

hipsparseStatus_t hipsparseLtGetArchName ( char **  archName)

◆ hipsparseLtGetGitRevision()

hipsparseStatus_t hipsparseLtGetGitRevision ( hipsparseLtHandle_t  handle,
char *  rev 
)