/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/latest/projects/hipsparselt/library/include/hipsparselt.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/latest/projects/hipsparselt/library/include/hipsparselt.h Source File#

hipSPARSELt: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipsparselt/checkouts/latest/projects/hipsparselt/library/include/hipsparselt.h Source File
hipsparselt.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * MIT License
4  *
5  * Copyright (c) 2022-2026 Advanced Micro Devices, Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  *
25  *******************************************************************************/
26 
40 //
41 
67 #pragma once
68 #ifndef _HIPSPARSELT_H_
69 #define _HIPSPARSELT_H_
70 
71 #include <hipsparse/hipsparse.h>
72 #include <hipsparselt/hipsparselt-export.h>
73 #include <hipsparselt/hipsparselt-version.h>
74 
75 #include <hip/hip_complex.h>
76 #include <hip/hip_runtime_api.h>
77 
78 #if defined(__HIP_PLATFORM_AMD__)
79 #include <hip/hip_bfloat16.h>
80 #include <hip/hip_fp16.h>
81 #include <hip/hip_fp8.h>
82 #include <hip/library_types.h>
83 #else
84 #include <cuda_bf16.h>
85 #include <cuda_fp16.h>
86 #include <cuda_fp8.h>
87 #include <library_types.h>
88 #endif
89 
90 /* Opaque structures holding information */
91 // clang-format off
92 
93 // Zero-initialize opaque struct data in C++ (= {} is a C++11 feature, invalid in C).
94 // Guarantees is_init=0 on every declaration, eliminating uninitialized-struct false positives.
95 #ifdef __cplusplus
96 # define HIPSPARSELT_STRUCT_ZERO_INIT = {}
97 #else
98 # define HIPSPARSELT_STRUCT_ZERO_INIT
99 #endif
100 
101 #if defined(__HIP_PLATFORM_AMD__)
111 typedef struct hipsparseLtHandle_t { alignas(16) uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT; } hipsparseLtHandle_t;
112 
123 
133 
141 
151 typedef struct hipsparseLtMatmulPlan_t { alignas(16) uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT; } hipsparseLtMatmulPlan_t;
152 #elif defined(__HIP_PLATFORM_NVIDIA__)
153 typedef __nv_bfloat16 hip_bfloat16;
154 typedef struct { alignas(16) uint8_t data[512]; } hipsparseLtHandle_t;
155 typedef struct { alignas(16) uint8_t data[512]; } hipsparseLtMatDescriptor_t;
156 typedef struct { alignas(16) uint8_t data[512]; } hipsparseLtMatmulDescriptor_t;
157 typedef struct { alignas(16) uint8_t data[512]; } hipsparseLtMatmulAlgSelection_t;
158 typedef struct { alignas(16) uint8_t data[512]; } hipsparseLtMatmulPlan_t;
159 #endif
160 
169 typedef enum {
174 
182 typedef enum {
186 
192 typedef enum {
201 
209 typedef enum {
234 
241 typedef enum {
244 
252 typedef enum {
260 
267 typedef enum {
271 
278 typedef enum {
282 
283 // clang-format on
284 
285 #ifdef __cplusplus
286 extern "C" {
287 #endif
288 
297 HIPSPARSELT_EXPORT
299 
314 HIPSPARSELT_EXPORT
315 hipsparseStatus_t hipsparseLtGetVersion(const hipsparseLtHandle_t* handle, int* version);
316 
330 HIPSPARSELT_EXPORT
331 hipsparseStatus_t hipsparseLtGetProperty(hipLibraryPropertyType propertyType, int* value);
332 
333 HIPSPARSELT_EXPORT
334 hipsparseStatus_t hipsparseLtGetGitRevision(hipsparseLtHandle_t handle, char* rev);
335 
336 HIPSPARSELT_EXPORT
337 hipsparseStatus_t hipsparseLtGetArchName(char** archName);
338 
354 /* hipSPARSE initialization and management routines */
355 HIPSPARSELT_EXPORT
356 hipsparseStatus_t hipsparseLtInit(hipsparseLtHandle_t* handle);
357 
371 HIPSPARSELT_EXPORT
372 hipsparseStatus_t hipsparseLtDestroy(const hipsparseLtHandle_t* handle);
373 
374 /* matrix descriptor */
402 HIPSPARSELT_EXPORT
403 hipsparseStatus_t hipsparseLtDenseDescriptorInit(const hipsparseLtHandle_t* handle,
404  hipsparseLtMatDescriptor_t* matDescr,
405  int64_t rows,
406  int64_t cols,
407  int64_t ld,
408  uint32_t alignment,
409  hipDataType valueType,
410  hipsparseOrder_t order);
411 
442 HIPSPARSELT_EXPORT
444  hipsparseLtMatDescriptor_t* matDescr,
445  int64_t rows,
446  int64_t cols,
447  int64_t ld,
448  uint32_t alignment,
449  hipDataType valueType,
450  hipsparseOrder_t order,
451  hipsparseLtSparsity_t sparsity);
452 
466 HIPSPARSELT_EXPORT
468 
490 HIPSPARSELT_EXPORT
491 hipsparseStatus_t hipsparseLtMatDescSetAttribute(const hipsparseLtHandle_t* handle,
492  hipsparseLtMatDescriptor_t* matDescr,
493  hipsparseLtMatDescAttribute_t matAttribute,
494  const void* data,
495  size_t dataSize);
496 
518 HIPSPARSELT_EXPORT
519 hipsparseStatus_t hipsparseLtMatDescGetAttribute(const hipsparseLtHandle_t* handle,
520  const hipsparseLtMatDescriptor_t* matDescr,
521  hipsparseLtMatDescAttribute_t matAttribute,
522  void* data,
523  size_t dataSize);
524 
525 /* matmul descriptor */
555 HIPSPARSELT_EXPORT
556 hipsparseStatus_t hipsparseLtMatmulDescriptorInit(const hipsparseLtHandle_t* handle,
557  hipsparseLtMatmulDescriptor_t* matmulDescr,
558  hipsparseOperation_t opA,
559  hipsparseOperation_t opB,
560  const hipsparseLtMatDescriptor_t* matA,
561  const hipsparseLtMatDescriptor_t* matB,
562  const hipsparseLtMatDescriptor_t* matC,
563  const hipsparseLtMatDescriptor_t* matD,
564  hipsparseLtComputetype_t computeType);
565 
588 HIPSPARSELT_EXPORT
589 hipsparseStatus_t
591  hipsparseLtMatmulDescriptor_t* matmulDescr,
592  hipsparseLtMatmulDescAttribute_t matmulAttribute,
593  const void* data,
594  size_t dataSize);
595 
618 HIPSPARSELT_EXPORT
619 hipsparseStatus_t
621  const hipsparseLtMatmulDescriptor_t* matmulDescr,
622  hipsparseLtMatmulDescAttribute_t matmulAttribute,
623  void* data,
624  size_t dataSize);
625 
626 /* algorithm selection */
644 HIPSPARSELT_EXPORT
645 hipsparseStatus_t
647  hipsparseLtMatmulAlgSelection_t* algSelection,
648  const hipsparseLtMatmulDescriptor_t* matmulDescr,
650 
664 HIPSPARSELT_EXPORT
665 hipsparseStatus_t
667 
690 HIPSPARSELT_EXPORT
692  hipsparseLtMatmulAlgSelection_t* algSelection,
694  const void* data,
695  size_t dataSize);
696 
720 HIPSPARSELT_EXPORT
721 hipsparseStatus_t
723  const hipsparseLtMatmulAlgSelection_t* algSelection,
725  void* data,
726  size_t dataSize);
727 
728 /* matmul plan */
745 HIPSPARSELT_EXPORT
746 hipsparseStatus_t hipsparseLtMatmulGetWorkspace(const hipsparseLtHandle_t* handle,
747  const hipsparseLtMatmulPlan_t* plan,
748  size_t* workspaceSize);
749 
768 HIPSPARSELT_EXPORT
769 hipsparseStatus_t hipsparseLtMatmulPlanInit(const hipsparseLtHandle_t* handle,
771  const hipsparseLtMatmulDescriptor_t* matmulDescr,
772  const hipsparseLtMatmulAlgSelection_t* algSelection);
773 
787 HIPSPARSELT_EXPORT
789 
790 /* matmul execution */
836 HIPSPARSELT_EXPORT
837 hipsparseStatus_t hipsparseLtMatmul(const hipsparseLtHandle_t* handle,
838  const hipsparseLtMatmulPlan_t* plan,
839  const void* alpha,
840  const void* d_A,
841  const void* d_B,
842  const void* beta,
843  const void* d_C,
844  void* d_D,
845  void* workspace,
846  hipStream_t* streams,
847  int32_t numStreams);
848 
903 HIPSPARSELT_EXPORT
904 hipsparseStatus_t hipsparseLtMatmulSearch(const hipsparseLtHandle_t* handle,
906  const void* alpha,
907  const void* d_A,
908  const void* d_B,
909  const void* beta,
910  const void* d_C,
911  void* d_D,
912  void* workspace,
913  hipStream_t* streams,
914  int32_t numStreams);
915 
916 /* helper */
917 // prune
944 HIPSPARSELT_EXPORT
945 hipsparseStatus_t hipsparseLtSpMMAPrune(const hipsparseLtHandle_t* handle,
946  const hipsparseLtMatmulDescriptor_t* matmulDescr,
947  const void* d_in,
948  void* d_out,
949  hipsparseLtPruneAlg_t pruneAlg,
950  hipStream_t stream);
951 
974 HIPSPARSELT_EXPORT
975 hipsparseStatus_t hipsparseLtSpMMAPruneCheck(const hipsparseLtHandle_t* handle,
976  const hipsparseLtMatmulDescriptor_t* matmulDescr,
977  const void* d_in,
978  int* d_valid,
979  hipStream_t stream);
980 
1012 HIPSPARSELT_EXPORT
1013 hipsparseStatus_t hipsparseLtSpMMAPrune2(const hipsparseLtHandle_t* handle,
1014  const hipsparseLtMatDescriptor_t* sparseMatDescr,
1015  int isSparseA,
1016  hipsparseOperation_t op,
1017  const void* d_in,
1018  void* d_out,
1019  hipsparseLtPruneAlg_t pruneAlg,
1020  hipStream_t stream);
1021 
1048 HIPSPARSELT_EXPORT
1049 hipsparseStatus_t hipsparseLtSpMMAPruneCheck2(const hipsparseLtHandle_t* handle,
1050  const hipsparseLtMatDescriptor_t* sparseMatDescr,
1051  int isSparseA,
1052  hipsparseOperation_t op,
1053  const void* d_in,
1054  int* d_valid,
1055  hipStream_t stream);
1056 
1057 // compression
1077 HIPSPARSELT_EXPORT
1078 hipsparseStatus_t hipsparseLtSpMMACompressedSize(const hipsparseLtHandle_t* handle,
1079  const hipsparseLtMatmulPlan_t* plan,
1080  size_t* compressedSize,
1081  size_t* compressBufferSize);
1082 
1108 HIPSPARSELT_EXPORT
1109 hipsparseStatus_t hipsparseLtSpMMACompress(const hipsparseLtHandle_t* handle,
1110  const hipsparseLtMatmulPlan_t* plan,
1111  const void* d_dense,
1112  void* d_compressed,
1113  void* d_compressBuffer,
1114  hipStream_t stream);
1115 
1136 HIPSPARSELT_EXPORT
1138  const hipsparseLtMatDescriptor_t* sparseMatDescr,
1139  size_t* compressedSize,
1140  size_t* compressBufferSize);
1141 
1171 HIPSPARSELT_EXPORT
1172 hipsparseStatus_t hipsparseLtSpMMACompress2(const hipsparseLtHandle_t* handle,
1173  const hipsparseLtMatDescriptor_t* sparseMatDescr,
1174  int isSparseA,
1175  hipsparseOperation_t op,
1176  const void* d_dense,
1177  void* d_compressed,
1178  void* d_compressBuffer,
1179  hipStream_t stream);
1180 
1181 #ifdef __cplusplus
1182 }
1183 #endif
1184 
1185 #endif // _HIPSPARSELT_H_
hipsparseStatus_t hipsparseLtGetGitRevision(hipsparseLtHandle_t handle, char *rev)
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.
hipsparseLtSparsity_t
Specify the sparsity of the structured matrix.
Definition: hipsparselt.h:169
@ HIPSPARSELT_SPARSITY_50_PERCENT
Definition: hipsparselt.h:170
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)
Prune a dense matrix.
hipsparseStatus_t hipsparseLtSpMMACompressedSize2(const hipsparseLtHandle_t *handle, const hipsparseLtMatDescriptor_t *sparseMatDescr, size_t *compressedSize, size_t *compressBufferSize)
Provide the size of the compressed matrix.
void hipsparseLtInitialize()
Initialize hipSPARSELt for the current HIP device.
hipsparseStatus_t hipsparseLtGetArchName(char **archName)
hipsparseLtMatmulAlg_t
Specify the algorithm for matrix-matrix multiplication.
Definition: hipsparselt.h:241
@ HIPSPARSELT_MATMUL_ALG_DEFAULT
Definition: hipsparselt.h:242
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.
hipsparseStatus_t hipsparseLtInit(hipsparseLtHandle_t *handle)
Create a hipSPARSELt handle.
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 a structured matrix.
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.
hipsparseLtMatmulAlgAttribute_t
Specify the matrix multiplication algorithm attributes.
Definition: hipsparselt.h:252
@ HIPSPARSELT_MATMUL_SPLIT_K
Definition: hipsparselt.h:256
@ HIPSPARSELT_MATMUL_SPLIT_K_BUFFERS
Definition: hipsparselt.h:258
@ HIPSPARSELT_MATMUL_SEARCH_ITERATIONS
Definition: hipsparselt.h:255
@ HIPSPARSELT_MATMUL_SPLIT_K_MODE
Definition: hipsparselt.h:257
@ HIPSPARSELT_MATMUL_ALG_CONFIG_ID
Definition: hipsparselt.h:253
@ HIPSPARSELT_MATMUL_ALG_CONFIG_MAX_ID
Definition: hipsparselt.h:254
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.
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)
Compress a dense matrix to structured matrix.
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)
Check the correctness of the pruning structure for a given matrix.
hipsparseLtComputetype_t
Specify the compute precision modes of the matrix.
Definition: hipsparselt.h:192
@ HIPSPARSELT_COMPUTE_32F
Definition: hipsparselt.h:195
@ HIPSPARSELT_COMPUTE_TF32_FAST
Definition: hipsparselt.h:198
@ HIPSPARSELT_COMPUTE_TF32
Definition: hipsparselt.h:196
@ HIPSPARSELT_COMPUTE_32I
Definition: hipsparselt.h:194
@ HIPSPARSELT_COMPUTE_16F
Definition: hipsparselt.h:193
hipsparseStatus_t hipsparseLtMatmulAlgSelectionInit(const hipsparseLtHandle_t *handle, hipsparseLtMatmulAlgSelection_t *algSelection, const hipsparseLtMatmulDescriptor_t *matmulDescr, hipsparseLtMatmulAlg_t alg)
Initializes the algorithm selection descriptor.
hipsparseStatus_t hipsparseLtGetVersion(const hipsparseLtHandle_t *handle, int *version)
Retrieve the version number of the hipSPARSELt library.
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 a dense matrix.
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 and dense matrix multiplication.
hipsparseStatus_t hipsparseLtSpMMAPrune(const hipsparseLtHandle_t *handle, const hipsparseLtMatmulDescriptor_t *matmulDescr, const void *d_in, void *d_out, hipsparseLtPruneAlg_t pruneAlg, hipStream_t stream)
Prune a dense matrix.
hipsparseStatus_t hipsparseLtMatmulAlgSelectionDestroy(const hipsparseLtMatmulAlgSelection_t *algSelection)
Destroy the algorithm selection descriptor.
hipsparseStatus_t hipsparseLtSpMMACompressedSize(const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, size_t *compressedSize, size_t *compressBufferSize)
Provide the size of the compressed matrix.
hipsparseLtSplitKMode_t
Specify the Split-K mode value.
Definition: hipsparselt.h:278
@ HIPSPARSELT_SPLIT_K_MODE_TWO_KERNELS
Definition: hipsparselt.h:280
@ HIPSPARSELT_SPLIT_K_MODE_ONE_KERNEL
Definition: hipsparselt.h:279
hipsparseStatus_t hipsparseLtSpMMACompress(const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, const void *d_dense, void *d_compressed, void *d_compressBuffer, hipStream_t stream)
Compress a dense matrix to structured matrix.
hipsparseStatus_t hipsparseLtDestroy(const hipsparseLtHandle_t *handle)
Destroy a hipSPARSELt handle.
hipsparseLtMatmulDescAttribute_t
Specify the additional attributes of a matrix multiplication descriptor.
Definition: hipsparselt.h:209
@ HIPSPARSELT_MATMUL_ACTIVATION_RELU_UPPERBOUND
Definition: hipsparselt.h:211
@ HIPSPARSELT_MATMUL_BIAS_STRIDE
Definition: hipsparselt.h:217
@ HIPSPARSELT_MATMUL_BIAS_POINTER
Definition: hipsparselt.h:218
@ HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU
Definition: hipsparselt.h:220
@ HIPSPARSELT_MATMUL_BIAS_TYPE
Definition: hipsparselt.h:226
@ HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU_ALPHA
Definition: hipsparselt.h:221
@ HIPSPARSELT_MATMUL_ACTIVATION_TANH_BETA
Definition: hipsparselt.h:225
@ HIPSPARSELT_MATMUL_ACTIVATION_GELU_SCALING
Definition: hipsparselt.h:214
@ HIPSPARSELT_MATMUL_GATE_RESIDUAL_MAT_POINTER
Definition: hipsparselt.h:231
@ HIPSPARSELT_MATMUL_ALPHA_VECTOR_SCALING
Definition: hipsparselt.h:215
@ HIPSPARSELT_MATMUL_GATE_RESIDUAL_DESC
Definition: hipsparselt.h:232
@ HIPSPARSELT_MATMUL_ACTIVATION_TANH
Definition: hipsparselt.h:223
@ HIPSPARSELT_MATMUL_ACTIVATION_SIGMOID
Definition: hipsparselt.h:222
@ HIPSPARSELT_MATMUL_ACTIVATION_TANH_ALPHA
Definition: hipsparselt.h:224
@ HIPSPARSELT_MATMUL_BETA_VECTOR_SCALING
Definition: hipsparselt.h:216
@ HIPSPARSELT_MATMUL_ACTIVATION_RELU
Definition: hipsparselt.h:210
@ HIPSPARSELT_MATMUL_ACTIVATION_GELU
Definition: hipsparselt.h:213
@ HIPSPARSELT_MATMUL_ACTIVATION_ABS
Definition: hipsparselt.h:219
@ HIPSPARSELT_MATMUL_ACTIVATION_RELU_THRESHOLD
Definition: hipsparselt.h:212
@ HIPSPARSELT_MATMUL_SPARSE_MAT_POINTER
Definition: hipsparselt.h:230
hipsparseStatus_t hipsparseLtGetProperty(hipLibraryPropertyType propertyType, int *value)
Retrieve the value of the requested property.
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.
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 and dense matrix multiplication.
hipsparseLtPruneAlg_t
Specify the pruning algorithm to apply to the structured matrix before the compression.
Definition: hipsparselt.h:267
@ HIPSPARSELT_PRUNE_SPMMA_TILE
Definition: hipsparselt.h:268
@ HIPSPARSELT_PRUNE_SPMMA_STRIP
Definition: hipsparselt.h:269
hipsparseStatus_t hipsparseLtMatDescriptorDestroy(const hipsparseLtMatDescriptor_t *matDescr)
Destroy a matrix descriptor.
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 the algorithm selection descriptor.
hipsparseStatus_t hipsparseLtMatmulGetWorkspace(const hipsparseLtHandle_t *handle, const hipsparseLtMatmulPlan_t *plan, size_t *workspaceSize)
Determines the required workspace size.
hipsparseLtMatDescAttribute_t
Specify the additional attributes of a matrix descriptor.
Definition: hipsparselt.h:182
@ HIPSPARSELT_MAT_BATCH_STRIDE
Definition: hipsparselt.h:184
@ HIPSPARSELT_MAT_NUM_BATCHES
Definition: hipsparselt.h:183
hipsparseStatus_t hipsparseLtMatmulPlanDestroy(const hipsparseLtMatmulPlan_t *plan)
Destroy a matrix multiplication plan descriptor.
hipsparseStatus_t hipsparseLtMatmulPlanInit(const hipsparseLtHandle_t *handle, hipsparseLtMatmulPlan_t *plan, const hipsparseLtMatmulDescriptor_t *matmulDescr, const hipsparseLtMatmulAlgSelection_t *algSelection)
Initializes the matrix multiplication plan descriptor.
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.
hipsparseStatus_t hipsparseLtSpMMAPruneCheck(const hipsparseLtHandle_t *handle, const hipsparseLtMatmulDescriptor_t *matmulDescr, const void *d_in, int *d_valid, hipStream_t stream)
Check the correctness of the pruning structure for a given matrix.
Handle to the hipSPARSELt library context queue.
Definition: hipsparselt.h:111
uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT
Definition: hipsparselt.h:111
Descriptor of the matrix.
Definition: hipsparselt.h:122
uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT
Definition: hipsparselt.h:122
Descriptor of the matrix multiplication algorithm.
Definition: hipsparselt.h:140
uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT
Definition: hipsparselt.h:140
Descriptor of the matrix multiplication operation.
Definition: hipsparselt.h:132
uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT
Definition: hipsparselt.h:132
Descriptor of the matrix multiplication execution plan.
Definition: hipsparselt.h:151
uint8_t data[512] HIPSPARSELT_STRUCT_ZERO_INIT
Definition: hipsparselt.h:151