Skip to main content
`Ctrl`+`K`

# Matmul descriptor functions

hipSPARSELt: Matmul descriptor functions
Functions
Matmul descriptor functions

## Functions

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

## Detailed Description

Defines how to matrix multiply

## Function Documentation

## ◆ hipsparseLtMatmulDescGetAttribute()

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.

`hipsparseLtMatmulDescGetAttribute` returns the matrix attribute of a matrix descriptor

Parameters

  [in] | handle | the hipsparselt handle
  [in] | matmulDescr | the matrix multiplication descriptor
  [in] | matmulAttribute | see hipsparseLtMatmulDescAttribute_t
  [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` , `matDescr` , `data` or `dataSize` is invalid.
  HIPSPARSE_STATUS_NOT_SUPPORTED | `hipsparseLtMatmulDescAttribute_t` is not supported.

## ◆ hipsparseLtMatmulDescriptorInit()

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.

`hipsparseLtMatmulDescriptorInit` creates a matrix multiplication descriptor.

Parameters

  [in] | handle | the hipsparselt handle
  [in,out] | matmulDescr | the matrix multiplication descriptor
  [in] | opA | hipsparse operation for Matrix A. `HIPSPARSE_OPERATION_NON_TRANSPOSE` or `HIPSPARSE_OPERATION_TRANSPOSE`
  [in] | opB | hipsparse operation for Matrix B. `HIPSPARSE_OPERATION_NON_TRANSPOSE` or `HIPSPARSE_OPERATION_TRANSPOSE`
  [in] | matA | the matrix descriptor (only and must one of matA or matB is a structured sparsity matrix)
  [in] | matB | the matrix descriptor (only and must one of matA or matB is a structured sparsity matrix)
  [in] | matC | the matrix descriptor (dense matrix)
  [in] | matD | the matrix descriptor (dense matrix)
  [in] | computeType | 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` , `opA` , `opB` , `matA` , `matB` , `matC` , `matD` or `computeType` ,is invalid.
  HIPSPARSE_STATUS_NOT_SUPPORTED | `opA` , `opB` or `computeType` is invalid.

## ◆ hipsparseLtMatmulDescSetAttribute()

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.

`hipsparseLtMatmulDescSetAttribute` 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] | matmulDescr | the matrix multiplication descriptor
  [in] | matmulAttribute | see hipsparseLtMatmulDescAttribute_t
  [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` , `matDescr` , `data` or `dataSize` is invalid.
  HIPSPARSE_STATUS_NOT_SUPPORTED | `hipsparseLtMatmulDescAttribute_t` is not supported.