********************* cuSPARSELt Data Types ********************* ====================== Opaque Data Structures ====================== -------------------------- :code:`cusparseLtHandle_t` -------------------------- | The `cusparseLtHandle_t` structure holds the cuSPARSELt library context (device properties, system information, etc.). | The handle must be initialized and destroyed with :ref:`cusparseLtInit() ` and :ref:`cusparseLtDestroy() ` functions respectively. --------------------------------- :code:`cusparseLtMatDescriptor_t` --------------------------------- | The `cusparseLtMatDescriptor_t` structure captures the shape and characteristics of a matrix. | It is initialized by :ref:`cusparseLtDenseDescriptorInit() ` or :ref:`cusparseLtStructuredDescriptorInit() ` functions. ------------------------------------ :code:`cusparseLtMatmulDescriptor_t` ------------------------------------ | The `cusparseLtMatmulDescriptor_t` structure holds the description of the matrix multiplication operation. | It is initialized by :ref:`cusparseLtMatmulDescriptorInit() ` function. -------------------------------------- :code:`cusparseLtMatmulAlgSelection_t` -------------------------------------- | The `cusparseLtMatmulAlgSelection_t` structure holds the description of the matrix multiplication algorithm. | It is initialized by :ref:`cusparseLtMatmulAlgSelectionInit() ` function. ------------------------------ :code:`cusparseLtMatmulPlan_t` ------------------------------ | The `cusparseLtMatmulPlan_t` structure holds the matrix multiplication execution plan, namely all the information necessary to execute the ``cusparseLtMatmul()`` operation. | It is initialized and destroyed by :ref:`cusparseLtMatmulPlanInit() ` and :ref:`cusparseLtMatmulPlanDestroy() ` functions respectively. ---- =========== Enumerators =========== .. _cusparseLtSparsity_t-label: ---------------------------- :code:`cusparseLtSparsity_t` ---------------------------- | The `cusparseLtSparsity_t` enumerator specifies the sparsity ratio of the structured matrix as .. math:: sparsity\ ratio = \frac{nnz}{num\_rows * num\_cols} +----------------------------------+-------------------------------------------+ | Value | Description | +==================================+===========================================+ | `CUSPARSELT_SPARSITY_50_PERCENT` | 50% Sparsity Ratio (2:4 Sparse MMA) | +----------------------------------+-------------------------------------------+ | The sparsity property is used in the :ref:`cusparseLtStructuredDescriptorInit() ` function. ---- --------------------------- :code:`cusparseComputeType` --------------------------- | The `cusparseComputeType` enumerator specifies the compute precision modes of the matrix +------------------------+--------------------------------------------------------------------------------------+ | Value | Description | +========================+======================================================================================+ | `CUSPARSE_COMPUTE_16F` | **-** Default mode for 16-bit floating-point | | | precision | | | | | | **-** All compute and intermediate storage | | | precisions with at least 16-bit precision | | | | | | **-** Tensor Cores will be used whenever possible | +------------------------+--------------------------------------------------------------------------------------+ | `CUSPARSE_COMPUTE_32I` | **-** Default mode for 32-bit integer precision | | | | | | **-** All compute and intermediate storage | | | precisions with at least 32-bit integer precision | | | | | | **-** Tensor Cores will be used whenever possible | +------------------------+--------------------------------------------------------------------------------------+ | The compute precision is used in the :ref:`cusparseLtMatmulDescriptorInit() ` function. ---- ----------------------------- :code:`cusparseLtMatmulAlg_t` ----------------------------- | The `cusparseLtMatmulAlg_t` enumerator specifies the algorithm for matrix-matrix multiplication +---------------------------------+----------------------------+ | Value | Description | +=================================+============================+ | `CUSPARSELT_MATMUL_ALG_DEFAULT` | Default algorithm | +---------------------------------+----------------------------+ | The algorithm enumerator is used in the :ref:`cusparseLtMatmulAlgSelectionInit() ` function. ---- .. _cusparseLtMatmulAlgAttribute_t-label: -------------------------------------- :code:`cusparseLtMatmulAlgAttribute_t` -------------------------------------- | The `cusparseLtMatmulAlgAttribute_t` enumerator specifies the matrix multiplication algorithm attributes +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | Value | Description | +=======================================+=====================================================================================================================================+ | `CUSPARSELT_MATMUL_ALG_CONFIG_ID` | Algorithm ID (set and query) | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | `CUSPARSELT_MATMUL_ALG_CONFIG_MAX_ID` | Algorithm ID limit (query only) | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | `CUSPARSELT_MATMUL_SEARCH_ITERATIONS` | Number of iterations (kernel launches per algorithm) for :ref:`cusparseLtMatmulSearch() `, default=10 | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | The algorithm attribute enumerator is used in the :ref:`cusparseLtMatmulAlgGetAttribute() ` and :ref:`cusparseLtMatmulAlgSetAttribute() ` functions. ---- ---------------------------- :code:`cusparseLtPruneAlg_t` ---------------------------- | The `cusparseLtPruneAlg_t` enumerator specifies the pruning algorithm to apply to the structured matrix before the compression +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Value | Description | +================================+================================================================================================================================================================================+ | `CUSPARSELT_PRUNE_SPMMA_TILE` | Zero-out eight values in a 4x4 tile to maximize the *L1-norm* of the resulting tile, under the constraint of selecting exactly two elements for each row and column | +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | `CUSPARSELT_PRUNE_SPMMA_STRIP` | Zero-out two values in a 1x4 strip to maximize the *L1-norm* of the resulting strip. The strip direction is chosen according to the operation `opA` specified in `matmulDescr` | +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | The pruning algorithm is used in the :ref:`cusparseLtSpMMAPrune() ` function.