cublaslt

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cublaslt provides low-level Go bindings for cuBLASLt (CUDA Linear Algebra Subroutines Lightweight).

cuBLASLt is a lightweight matrix multiplication library designed for modern GPU architectures (Volta and newer), providing flexible matrix data layouts, explicit epilogue fusions, and algorithm heuristic search capabilities.

Most operations require a Handle, created with Create. Use NewMatmulDesc, NewMatrixLayout, and NewMatmulPreference to configure GEMM operations.

Other

  • Create: initializes the cuBLASLt library and creates a handle to an opaque structure holding the cuBLASLt library context.
  • Handle.Close: releases hardware resources used by the cuBLASLt library.
  • [DisableCpuInstructionsSetMask]: Instructs cuBLASLt library to not use CPU instructions specified by the flags in the mask.
  • NewEmulationDesc: creates a new emulation descriptor.
  • EmulationDesc.Close: destroys a previously created emulation descriptor.
  • EmulationDesc.Attribute: returns the value of the queried attribute belonging to a previously created emulation descriptor.
  • EmulationDesc.SetAttribute: sets the value of the specified attribute belonging to a previously created emulation descriptor.
  • [GetCudartVersion]: returns the version number of the CUDA Runtime library.
  • GetProperty: returns the value of the requested property by writing it to the memory location pointed to by the value parameter.
  • [GetVersion]: returns the version number of cuBLASLt library.
  • NewMatrixLayout: creates a grouped matrix layout descriptor by allocating the memory needed to hold its opaque structure.
  • HeuristicsCacheGetCapacity: Returns the Heuristics Cache capacity.
  • HeuristicsCacheSetCapacity: Sets the Heuristics Cache capacity.
  • LoggerForceDisable: disables logging for the entire run.
  • LoggerOpenFile: opens and sets the logging output file in the given path.
  • LoggerSetCallback: sets the logging callback function.
  • LoggerSetFile: sets the logging output file.
  • LoggerSetLevel: sets the value of the logging level.
  • LoggerSetMask: sets the value of the logging mask.
  • Handle.Matmul: computes the matrix multiplication of matrices A and B to produce the output matrix D, according to the following operation:
  • MatmulAlgoCapGetAttribute: returns the value of the queried capability attribute for an initialized MatmulAlgo descriptor structure.
  • Handle.MatmulAlgoCheck: performs the correctness check on the matrix multiply algorithm descriptor for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.
  • Handle.MatmulAlgoCheckForStream: performs the correctness check on the matrix multiply algorithm descriptor for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.
  • MatmulAlgoConfigGetAttribute: returns the value of the queried configuration attribute for an initialized MatmulAlgo descriptor.
  • MatmulAlgoConfigSetAttribute: sets the value of the specified configuration attribute for an initialized MatmulAlgo descriptor.
  • Handle.MatmulAlgoGetHeuristic: retrieves the possible algorithms for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.
  • Handle.MatmulAlgoGetHeuristicForStream: retrieves the possible algorithms for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.
  • Handle.MatmulAlgoGetIds: retrieves the IDs of all the matrix multiply algorithms that are valid, and can potentially be run by the Handle.Matmul function, for given types of the input matrices A, B and C, and of the output matrix D.
  • Handle.MatmulAlgoInit: initializes the matrix multiply algorithm structure for the Handle.Matmul , for a specified matrix multiply algorithm and input matrices A, B and C, and the output matrix D.
  • NewMatmulDesc: creates a matrix multiply descriptor by allocating the memory needed to hold its opaque structure.
  • MatmulDesc.Close: destroys a previously created matrix multiply descriptor object.
  • MatmulDesc.Attribute: returns the value of the queried attribute belonging to a previously created matrix multiply descriptor.
  • MatmulDesc.SetAttribute: sets the value of the specified attribute belonging to a previously created matrix multiply descriptor.
  • NewMatmulPreference: creates a matrix multiply heuristic search preferences descriptor by allocating the memory needed to hold its opaque structure.
  • MatmulPreference.Close: destroys a previously created matrix multiply preferences descriptor object.
  • MatmulPreference.Attribute: returns the value of the queried attribute belonging to a previously created matrix multiply heuristic search preferences descriptor.
  • MatmulPreference.SetAttribute: sets the value of the specified attribute belonging to a previously created matrix multiply preferences descriptor.
  • MatrixLayout.Close: destroys a previously created matrix layout descriptor object.
  • MatrixLayout.Attribute: returns the value of the queried attribute belonging to the specified matrix layout descriptor.
  • MatrixLayout.SetAttribute: sets the value of the specified attribute belonging to a previously created matrix layout descriptor.
  • Handle.MatrixTransform: computes the matrix transformation operation on the input matrices A and B, to produce the output matrix C, according to the below operation:
  • NewMatrixTransformDesc: creates a matrix transform descriptor by allocating the memory needed to hold its opaque structure.
  • MatrixTransformDesc.Close: destroys a previously created matrix transform descriptor object.
  • MatrixTransformDesc.Attribute: returns the value of the queried attribute belonging to a previously created matrix transform descriptor.
  • MatrixTransformDesc.SetAttribute: sets the value of the specified attribute belonging to a previously created matrix transform descriptor.
Example

Example runs a single-precision matrix multiply through cublasLtMatmul. It returns early when the cuBLASLt library is not available. The device buffers dA..dD are CUDA device pointers, e.g. from the driver package's MemAlloc. It has no Output comment, so it is compiled but not run: what it prints depends on the host's cuBLASLt.

package main

import (
	"fmt"

	"github.com/tmc/lib/nvidia/cublaslt"
	"github.com/tmc/lib/nvidia/driver"
)

func main() {
	h, err := cublaslt.Create()
	if err != nil {
		fmt.Println("cuBLASLt unavailable:", err)
		return
	}
	defer h.Close()

	const m, n, k = 128, 128, 128

	desc, err := cublaslt.NewMatmulDesc(cublaslt.Compute32F, cublaslt.R32F)
	if err != nil {
		fmt.Println("matmul desc:", err)
		return
	}
	defer desc.Close()

	aLayout, _ := cublaslt.NewMatrixLayout(cublaslt.R32F, m, k, m)
	bLayout, _ := cublaslt.NewMatrixLayout(cublaslt.R32F, k, n, k)
	cLayout, _ := cublaslt.NewMatrixLayout(cublaslt.R32F, m, n, m)
	defer aLayout.Close()
	defer bLayout.Close()
	defer cLayout.Close()

	var dA, dB, dC driver.DevicePtr // device allocations, m*k, k*n, m*n floats
	err = h.Matmul(desc,
		cublaslt.Float32Scalar(1), dA, aLayout, dB, bLayout,
		cublaslt.Float32Scalar(0), dC, cLayout, dC, cLayout,
		nil, 0, 0, 0)
	if err != nil {
		fmt.Println("matmul:", err)
		return
	}
	fmt.Println("matmul enqueued")
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close unloads the library and clears all bound function pointers.

The function pointers are package-level state, so Close must not be called concurrently with any other call into this package: doing so is a use-after-free. It is intended for test teardown, not for reclaiming a live library.

func GetProperty

func GetProperty(type_ LibraryPropertyType, value *int32) error

GetProperty returns the value of the requested property by writing it to the memory location pointed to by the value parameter.

  • type_: Of the type libraryPropertyType, whose value is requested from the property. See libraryPropertyType_t
  • value: Pointer to the host memory location where the requested information should be written

A nil error means the requested libraryPropertyType information is successfully written at the provided address.

Errors:

  • ErrInvalidValue: If invalid value of the type input argument, or if value is NULL

Wraps cublasLtGetProperty.

func Has

func Has(symbol string) bool

Has reports whether the named C symbol resolved in the loaded library, loading it first if necessary. It returns false if the library failed to load. Use it to gate on capabilities before calling into them.

func HasCreate

func HasCreate() bool

HasCreate reports whether cublasLtCreate resolved in the loaded library.

func HasDestroy

func HasDestroy() bool

HasDestroy reports whether cublasLtDestroy resolved in the loaded library.

func HasEmulationDescCreate

func HasEmulationDescCreate() bool

HasEmulationDescCreate reports whether cublasLtEmulationDescCreate resolved in the loaded library.

func HasEmulationDescDestroy

func HasEmulationDescDestroy() bool

HasEmulationDescDestroy reports whether cublasLtEmulationDescDestroy resolved in the loaded library.

func HasEmulationDescGetAttribute

func HasEmulationDescGetAttribute() bool

HasEmulationDescGetAttribute reports whether cublasLtEmulationDescGetAttribute resolved in the loaded library.

func HasEmulationDescInit_internal

func HasEmulationDescInit_internal() bool

HasEmulationDescInit_internal reports whether cublasLtEmulationDescInit_internal resolved in the loaded library.

func HasEmulationDescSetAttribute

func HasEmulationDescSetAttribute() bool

HasEmulationDescSetAttribute reports whether cublasLtEmulationDescSetAttribute resolved in the loaded library.

func HasGetProperty

func HasGetProperty() bool

HasGetProperty reports whether cublasLtGetProperty resolved in the loaded library.

func HasGetStatusName

func HasGetStatusName() bool

HasGetStatusName reports whether cublasLtGetStatusName resolved in the loaded library.

func HasGetStatusString

func HasGetStatusString() bool

HasGetStatusString reports whether cublasLtGetStatusString resolved in the loaded library.

func HasGroupedMatrixLayoutCreate

func HasGroupedMatrixLayoutCreate() bool

HasGroupedMatrixLayoutCreate reports whether cublasLtGroupedMatrixLayoutCreate resolved in the loaded library.

func HasGroupedMatrixLayoutInit_internal

func HasGroupedMatrixLayoutInit_internal() bool

HasGroupedMatrixLayoutInit_internal reports whether cublasLtGroupedMatrixLayoutInit_internal resolved in the loaded library.

func HasHeuristicsCacheGetCapacity

func HasHeuristicsCacheGetCapacity() bool

HasHeuristicsCacheGetCapacity reports whether cublasLtHeuristicsCacheGetCapacity resolved in the loaded library.

func HasHeuristicsCacheSetCapacity

func HasHeuristicsCacheSetCapacity() bool

HasHeuristicsCacheSetCapacity reports whether cublasLtHeuristicsCacheSetCapacity resolved in the loaded library.

func HasLoggerForceDisable

func HasLoggerForceDisable() bool

HasLoggerForceDisable reports whether cublasLtLoggerForceDisable resolved in the loaded library.

func HasLoggerOpenFile

func HasLoggerOpenFile() bool

HasLoggerOpenFile reports whether cublasLtLoggerOpenFile resolved in the loaded library.

func HasLoggerSetCallback

func HasLoggerSetCallback() bool

HasLoggerSetCallback reports whether cublasLtLoggerSetCallback resolved in the loaded library.

func HasLoggerSetFile

func HasLoggerSetFile() bool

HasLoggerSetFile reports whether cublasLtLoggerSetFile resolved in the loaded library.

func HasLoggerSetLevel

func HasLoggerSetLevel() bool

HasLoggerSetLevel reports whether cublasLtLoggerSetLevel resolved in the loaded library.

func HasLoggerSetMask

func HasLoggerSetMask() bool

HasLoggerSetMask reports whether cublasLtLoggerSetMask resolved in the loaded library.

func HasMatmul

func HasMatmul() bool

HasMatmul reports whether cublasLtMatmul resolved in the loaded library.

func HasMatmulAlgoCapGetAttribute

func HasMatmulAlgoCapGetAttribute() bool

HasMatmulAlgoCapGetAttribute reports whether cublasLtMatmulAlgoCapGetAttribute resolved in the loaded library.

func HasMatmulAlgoCheck

func HasMatmulAlgoCheck() bool

HasMatmulAlgoCheck reports whether cublasLtMatmulAlgoCheck resolved in the loaded library.

func HasMatmulAlgoCheckForStream

func HasMatmulAlgoCheckForStream() bool

HasMatmulAlgoCheckForStream reports whether cublasLtMatmulAlgoCheckForStream resolved in the loaded library.

func HasMatmulAlgoConfigGetAttribute

func HasMatmulAlgoConfigGetAttribute() bool

HasMatmulAlgoConfigGetAttribute reports whether cublasLtMatmulAlgoConfigGetAttribute resolved in the loaded library.

func HasMatmulAlgoConfigSetAttribute

func HasMatmulAlgoConfigSetAttribute() bool

HasMatmulAlgoConfigSetAttribute reports whether cublasLtMatmulAlgoConfigSetAttribute resolved in the loaded library.

func HasMatmulAlgoGetHeuristic

func HasMatmulAlgoGetHeuristic() bool

HasMatmulAlgoGetHeuristic reports whether cublasLtMatmulAlgoGetHeuristic resolved in the loaded library.

func HasMatmulAlgoGetHeuristicForStream

func HasMatmulAlgoGetHeuristicForStream() bool

HasMatmulAlgoGetHeuristicForStream reports whether cublasLtMatmulAlgoGetHeuristicForStream resolved in the loaded library.

func HasMatmulAlgoGetIds

func HasMatmulAlgoGetIds() bool

HasMatmulAlgoGetIds reports whether cublasLtMatmulAlgoGetIds resolved in the loaded library.

func HasMatmulAlgoInit

func HasMatmulAlgoInit() bool

HasMatmulAlgoInit reports whether cublasLtMatmulAlgoInit resolved in the loaded library.

func HasMatmulDescCreate

func HasMatmulDescCreate() bool

HasMatmulDescCreate reports whether cublasLtMatmulDescCreate resolved in the loaded library.

func HasMatmulDescDestroy

func HasMatmulDescDestroy() bool

HasMatmulDescDestroy reports whether cublasLtMatmulDescDestroy resolved in the loaded library.

func HasMatmulDescGetAttribute

func HasMatmulDescGetAttribute() bool

HasMatmulDescGetAttribute reports whether cublasLtMatmulDescGetAttribute resolved in the loaded library.

func HasMatmulDescInit_internal

func HasMatmulDescInit_internal() bool

HasMatmulDescInit_internal reports whether cublasLtMatmulDescInit_internal resolved in the loaded library.

func HasMatmulDescSetAttribute

func HasMatmulDescSetAttribute() bool

HasMatmulDescSetAttribute reports whether cublasLtMatmulDescSetAttribute resolved in the loaded library.

func HasMatmulPreferenceCreate

func HasMatmulPreferenceCreate() bool

HasMatmulPreferenceCreate reports whether cublasLtMatmulPreferenceCreate resolved in the loaded library.

func HasMatmulPreferenceDestroy

func HasMatmulPreferenceDestroy() bool

HasMatmulPreferenceDestroy reports whether cublasLtMatmulPreferenceDestroy resolved in the loaded library.

func HasMatmulPreferenceGetAttribute

func HasMatmulPreferenceGetAttribute() bool

HasMatmulPreferenceGetAttribute reports whether cublasLtMatmulPreferenceGetAttribute resolved in the loaded library.

func HasMatmulPreferenceInit_internal

func HasMatmulPreferenceInit_internal() bool

HasMatmulPreferenceInit_internal reports whether cublasLtMatmulPreferenceInit_internal resolved in the loaded library.

func HasMatmulPreferenceSetAttribute

func HasMatmulPreferenceSetAttribute() bool

HasMatmulPreferenceSetAttribute reports whether cublasLtMatmulPreferenceSetAttribute resolved in the loaded library.

func HasMatrixLayoutCreate

func HasMatrixLayoutCreate() bool

HasMatrixLayoutCreate reports whether cublasLtMatrixLayoutCreate resolved in the loaded library.

func HasMatrixLayoutDestroy

func HasMatrixLayoutDestroy() bool

HasMatrixLayoutDestroy reports whether cublasLtMatrixLayoutDestroy resolved in the loaded library.

func HasMatrixLayoutGetAttribute

func HasMatrixLayoutGetAttribute() bool

HasMatrixLayoutGetAttribute reports whether cublasLtMatrixLayoutGetAttribute resolved in the loaded library.

func HasMatrixLayoutInit_internal

func HasMatrixLayoutInit_internal() bool

HasMatrixLayoutInit_internal reports whether cublasLtMatrixLayoutInit_internal resolved in the loaded library.

func HasMatrixLayoutSetAttribute

func HasMatrixLayoutSetAttribute() bool

HasMatrixLayoutSetAttribute reports whether cublasLtMatrixLayoutSetAttribute resolved in the loaded library.

func HasMatrixTransform

func HasMatrixTransform() bool

HasMatrixTransform reports whether cublasLtMatrixTransform resolved in the loaded library.

func HasMatrixTransformDescCreate

func HasMatrixTransformDescCreate() bool

HasMatrixTransformDescCreate reports whether cublasLtMatrixTransformDescCreate resolved in the loaded library.

func HasMatrixTransformDescDestroy

func HasMatrixTransformDescDestroy() bool

HasMatrixTransformDescDestroy reports whether cublasLtMatrixTransformDescDestroy resolved in the loaded library.

func HasMatrixTransformDescGetAttribute

func HasMatrixTransformDescGetAttribute() bool

HasMatrixTransformDescGetAttribute reports whether cublasLtMatrixTransformDescGetAttribute resolved in the loaded library.

func HasMatrixTransformDescInit_internal

func HasMatrixTransformDescInit_internal() bool

HasMatrixTransformDescInit_internal reports whether cublasLtMatrixTransformDescInit_internal resolved in the loaded library.

func HasMatrixTransformDescSetAttribute

func HasMatrixTransformDescSetAttribute() bool

HasMatrixTransformDescSetAttribute reports whether cublasLtMatrixTransformDescSetAttribute resolved in the loaded library.

func HeuristicsCacheGetCapacity

func HeuristicsCacheGetCapacity(capacity *uint) error

HeuristicsCacheGetCapacity returns the Heuristics Cache capacity.

  • capacity: The pointer to the returned capacity value

A nil error means the capacity was successfully written.

Errors:

Wraps cublasLtHeuristicsCacheGetCapacity.

func HeuristicsCacheSetCapacity

func HeuristicsCacheSetCapacity(capacity uint) error

HeuristicsCacheSetCapacity sets the Heuristics Cache capacity.

Set the capacity to 0 to disable the heuristics cache. This function takes precedence over CUBLASLT_HEURISTICS_CACHE_CAPACITY environment variable.

  • capacity: The desirable heuristics cache capacity

A nil error means the capacity was successfully set.

Wraps cublasLtHeuristicsCacheSetCapacity.

func Load

func Load(path string) error

Load opens the shared library from path, or from the default search list when path is empty, and binds all symbols. Callers that need to direct loading should call Load before any other function; otherwise the first call loads from the default search list.

Load is idempotent: calling it again with the same path, or with an empty path, returns nil. Calling it with a different path after a successful load returns *LibraryConflictError rather than replacing the library. After a failed load, Load retries.

func Loaded

func Loaded() bool

Loaded reports whether the library is currently loaded. It does not trigger a load.

func LoggerForceDisable

func LoggerForceDisable() error

LoggerForceDisable disables logging for the entire run.

This function is experimental.

A nil error means logging was successfully disabled.

Wraps cublasLtLoggerForceDisable.

func LoggerOpenFile

func LoggerOpenFile(logFile *byte) error

LoggerOpenFile opens and sets the logging output file in the given path.

This function is experimental.

  • logFile: Path of the logging output file

A nil error means the logging file was successfully opened.

Wraps cublasLtLoggerOpenFile.

func LoggerSetCallback

func LoggerSetCallback(callback uintptr) error

LoggerSetCallback sets the logging callback function.

This function is experimental.

A nil error means the callback function was successfully set.

Wraps cublasLtLoggerSetCallback.

func LoggerSetFile

func LoggerSetFile(file uintptr) error

LoggerSetFile sets the logging output file.

Note: once registered using this function call, the provided file handle must not be closed unless the function is called again to switch to a different file handle. This function is experimental.

  • file: Pointer to an open file. File should have write permission

A nil error means logging file was successfully set.

Wraps cublasLtLoggerSetFile.

func LoggerSetLevel

func LoggerSetLevel(level int32) error

LoggerSetLevel sets the value of the logging level.

This function is experimental.

  • level: Value of the logging level. See cuBLASLt Logging

A nil error means the logging level was successfully set.

Errors:

  • ErrInvalidValue: If the value was not a valid logging level. See cuBLASLt Logging.

Wraps cublasLtLoggerSetLevel.

func LoggerSetMask

func LoggerSetMask(mask int32) error

LoggerSetMask sets the value of the logging mask.

This function is experimental.

  • mask: Value of the logging mask. See cuBLASLt Logging

A nil error means the logging mask was successfully set.

Wraps cublasLtLoggerSetMask.

func MatmulAlgoCapGetAttribute

func MatmulAlgoCapGetAttribute(algo *MatmulAlgo, attr MatmulAlgoCapAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

MatmulAlgoCapGetAttribute returns the value of the queried capability attribute for an initialized MatmulAlgo descriptor structure.

The capability attribute value is retrieved from the enumerated type MatmulAlgoCapAttributes.

  • algo: Pointer to the previously created opaque structure holding the matrix multiply algorithm descriptor. See MatmulAlgo
  • attr: The capability attribute whose value will be retrieved by this function. See MatmulAlgoCapAttributes
  • buf: The attribute value returned by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or if sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatmulAlgoCapGetAttribute.

Example

ExampleMatmulAlgoCapGetAttribute lists the tile shapes each single-precision matmul algorithm supports.

package main

import (
	"fmt"
	"unsafe"

	"github.com/tmc/lib/nvidia/cublaslt"
)

func main() {
	h, err := cublaslt.Create()
	if err != nil {
		fmt.Println("cuBLASLt unavailable:", err)
		return
	}
	defer h.Close()

	const f32 = cublaslt.R32F
	ids := make([]int32, 16)
	n, err := h.MatmulAlgoGetIds(cublaslt.Compute32F, f32, f32, f32, f32, f32, ids)
	if err != nil {
		fmt.Println("algo ids:", err)
		return
	}
	for _, id := range ids[:n] {
		var algo cublaslt.MatmulAlgo
		if err := h.MatmulAlgoInit(cublaslt.Compute32F, f32, f32, f32, f32, f32, id, &algo); err != nil {
			fmt.Println("algo init:", err)
			return
		}
		var tiles [cublaslt.MatmulTileEnd]cublaslt.MatmulTile
		written, err := cublaslt.MatmulAlgoCapGetAttribute(&algo, cublaslt.AlgoCapTileIds, unsafe.Pointer(&tiles), uint(unsafe.Sizeof(tiles)))
		if err != nil {
			fmt.Println("tile ids:", err)
			return
		}
		fmt.Println("algo", id, tiles[:written/uint(unsafe.Sizeof(tiles[0]))])
	}
}

func MatmulAlgoConfigGetAttribute

func MatmulAlgoConfigGetAttribute(algo *MatmulAlgo, attr MatmulAlgoConfigAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

MatmulAlgoConfigGetAttribute returns the value of the queried configuration attribute for an initialized MatmulAlgo descriptor.

The configuration attribute value is retrieved from the enumerated type MatmulAlgoConfigAttributes.

  • algo: Pointer to the previously created opaque structure holding the matrix multiply algorithm descriptor. See MatmulAlgo
  • attr: The configuration attribute whose value will be retrieved by this function. See MatmulAlgoConfigAttributes
  • buf: The attribute value returned by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or if sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatmulAlgoConfigGetAttribute.

func MatmulAlgoConfigSetAttribute

func MatmulAlgoConfigSetAttribute(algo *MatmulAlgo, attr MatmulAlgoConfigAttributes, buf unsafe.Pointer, sizeInBytes uint) error

MatmulAlgoConfigSetAttribute sets the value of the specified configuration attribute for an initialized MatmulAlgo descriptor.

The configuration attribute is an enumerant of the type MatmulAlgoConfigAttributes.

  • algo: Pointer to the previously created opaque structure holding the matrix multiply algorithm descriptor. See MatmulAlgo
  • attr: The configuration attribute whose value will be set by this function. See MatmulAlgoConfigAttributes
  • buf: The value to which the configuration attribute should be set
  • sizeInBytes: Size of buf buffer (in bytes) for verification

A nil error means the attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes doesn’t match the size of the internal storage for the selected attribute.

Wraps cublasLtMatmulAlgoConfigSetAttribute.

func Path

func Path() string

Path returns the path or name the loaded library was opened from, or the empty string if no library is loaded.

Types

type BatchMode

type BatchMode int32

BatchMode is an enum for batch mode.

const (
	BatchModeStrided      BatchMode = 0
	BatchModePointerArray BatchMode = 1
	BatchModeGrouped      BatchMode = 2
)

func (BatchMode) String

func (e BatchMode) String() string

String returns the constant name, or a numeric representation for unknown values.

type BindFailure

type BindFailure struct {
	Symbol string
	Err    error
}

BindFailure names a symbol the loaded library exports but that could not be bound, and why.

func BindFailures

func BindFailures() []BindFailure

BindFailures returns the symbols the loaded library exports that could not be bound, sorted by symbol name, or nil if every exported symbol bound. Calling one of these reports *SymbolError with the same Err.

A load that reports no error can still leave symbols unbound: the library is fine and the signatures are not representable here. Call this after Load to find that out at once rather than one call site at a time. It does not trigger a load, and returns nil if none has happened.

type CallError

type CallError struct {
	Func   string // the C symbol called
	Result Result
}

CallError reports that a library call returned a failure result.

Unwrap returns Result, so errors.Is(err, c) reports whether the call returned the Result constant c, and errors.As(err, &r) with r of type Result recovers the code.

func (*CallError) Error

func (e *CallError) Error() string

Error reports the C symbol called and the result it returned.

func (*CallError) Unwrap

func (e *CallError) Unwrap() error

Unwrap returns the result the call reported.

type ClusterShape

type ClusterShape int32

ClusterShape represents thread Block Cluster size.

Typically dimensioned similar to MatmulTile, with the third coordinate unused at this time.

const (
	ClusterShapeAuto   ClusterShape = 0
	ClusterShape1x1x1  ClusterShape = 2
	ClusterShape2x1x1  ClusterShape = 3
	ClusterShape4x1x1  ClusterShape = 4
	ClusterShape1x2x1  ClusterShape = 5
	ClusterShape2x2x1  ClusterShape = 6
	ClusterShape4x2x1  ClusterShape = 7
	ClusterShape1x4x1  ClusterShape = 8
	ClusterShape2x4x1  ClusterShape = 9
	ClusterShape4x4x1  ClusterShape = 10
	ClusterShape8x1x1  ClusterShape = 11
	ClusterShape1x8x1  ClusterShape = 12
	ClusterShape8x2x1  ClusterShape = 13
	ClusterShape2x8x1  ClusterShape = 14
	ClusterShape16x1x1 ClusterShape = 15
	ClusterShape1x16x1 ClusterShape = 16
	ClusterShape3x1x1  ClusterShape = 17
	ClusterShape5x1x1  ClusterShape = 18
	ClusterShape6x1x1  ClusterShape = 19
	ClusterShape7x1x1  ClusterShape = 20
	ClusterShape9x1x1  ClusterShape = 21
	ClusterShape10x1x1 ClusterShape = 22
	ClusterShape11x1x1 ClusterShape = 23
	ClusterShape12x1x1 ClusterShape = 24
	ClusterShape13x1x1 ClusterShape = 25
	ClusterShape14x1x1 ClusterShape = 26
	ClusterShape15x1x1 ClusterShape = 27
	ClusterShape3x2x1  ClusterShape = 28
	ClusterShape5x2x1  ClusterShape = 29
	ClusterShape6x2x1  ClusterShape = 30
	ClusterShape7x2x1  ClusterShape = 31
	ClusterShape1x3x1  ClusterShape = 32
	ClusterShape2x3x1  ClusterShape = 33
	ClusterShape3x3x1  ClusterShape = 34
	ClusterShape4x3x1  ClusterShape = 35
	ClusterShape5x3x1  ClusterShape = 36
	ClusterShape3x4x1  ClusterShape = 37
	ClusterShape1x5x1  ClusterShape = 38
	ClusterShape2x5x1  ClusterShape = 39
	ClusterShape3x5x1  ClusterShape = 40
	ClusterShape1x6x1  ClusterShape = 41
	ClusterShape2x6x1  ClusterShape = 42
	ClusterShape1x7x1  ClusterShape = 43
	ClusterShape2x7x1  ClusterShape = 44
	ClusterShape1x9x1  ClusterShape = 45
	ClusterShape1x10x1 ClusterShape = 46
	ClusterShape1x11x1 ClusterShape = 47
	ClusterShape1x12x1 ClusterShape = 48
	ClusterShape1x13x1 ClusterShape = 49
	ClusterShape1x14x1 ClusterShape = 50
	ClusterShape1x15x1 ClusterShape = 51
	ClusterShapeEnd    ClusterShape = 52
)

func (ClusterShape) String

func (e ClusterShape) String() string

String returns the constant name, or a numeric representation for unknown values.

type ComputeType

type ComputeType int32

ComputeType specifies the compute precision for cuBLAS operations.

const (
	// Half-precision compute with default behavior.
	Compute16F ComputeType = 64
	// Half-precision compute with pedantic behavior.
	Compute16FPedantic ComputeType = 65
	// Single-precision compute with default behavior.
	Compute32F ComputeType = 68
	// Single-precision compute with pedantic behavior.
	Compute32FPedantic ComputeType = 69
	// Single-precision compute allowing fast half and TF32 down-conversion.
	Compute32FFast16F ComputeType = 74
	// Single-precision compute allowing fast bfloat16 and TF32 down-conversion.
	Compute32FFast16BF ComputeType = 75
	// Single-precision compute allowing fast TF32 down-conversion.
	Compute32FFastTF32 ComputeType = 77
	// Single-precision compute using emulated 3xBF16 inputs.
	Compute32FEmulated16Bfx9 ComputeType = 78
	// Double-precision compute with default behavior.
	Compute64F ComputeType = 70
	// Double-precision compute with pedantic behavior.
	Compute64FPedantic ComputeType = 71
	// Double-precision compute using fixed-point emulation.
	Compute64FEmulatedFixedpoint ComputeType = 79
	// Signed 32-bit integer compute with default behavior.
	Compute32I ComputeType = 72
	// Signed 32-bit integer compute with pedantic behavior.
	Compute32IPedantic ComputeType = 73
)

ComputeType constants.

type CublasatomicsmodeT

type CublasatomicsmodeT int32

CublasatomicsmodeT indicates whether cuBLAS routines which has an alternate implementation using atomics can be used.

The atomics mode can be set and queried using cublasSetAtomicsMode() and cublasGetAtomicsMode() and routines, respectively.

const (
	CublasAtomicsNotAllowed CublasatomicsmodeT = 0
	CublasAtomicsAllowed    CublasatomicsmodeT = 1
)

func (CublasatomicsmodeT) String

func (e CublasatomicsmodeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublascomputetypeT

type CublascomputetypeT int32

CublascomputetypeT is used in cublasGemmEx() and Handle.Matmul (including all batched and strided batched variants) to choose compute precision modes as defined below. Note Setting the environment variable NVIDIA_TF32_OVERRIDE = 0 will override any defaults or programmatic configuration of NVIDIA libraries, and consequently, cuBLAS will not accelerate single-precision computations with TF32 tensor cores.

const (
	CublasCompute16F                   CublascomputetypeT = 64 // half - default
	CublasCompute16FPedantic           CublascomputetypeT = 65 // half - pedantic
	CublasCompute32F                   CublascomputetypeT = 68 // float - default
	CublasCompute32FPedantic           CublascomputetypeT = 69 // float - pedantic
	CublasCompute32FFast16F            CublascomputetypeT = 74 // float - fast, allows down-converting inputs to half or TF32
	CublasCompute32FFast16BF           CublascomputetypeT = 75 // float - fast, allows down-converting inputs to bfloat16 or TF32
	CublasCompute32FFastTF32           CublascomputetypeT = 77 // float - fast, allows down-converting inputs to TF32
	CublasCompute32FEmulated16bfx9     CublascomputetypeT = 78 // float - emulated, converts inputs into 3xBF16 values
	CublasCompute64F                   CublascomputetypeT = 70 // double - default
	CublasCompute64FPedantic           CublascomputetypeT = 71 // double - pedantic
	CublasCompute64FEmulatedFixedpoint CublascomputetypeT = 79 // double - emulated, converts inputs into fixed-point
	CublasCompute32I                   CublascomputetypeT = 72 // signed 32-bit int - default
	CublasCompute32IPedantic           CublascomputetypeT = 73 // signed 32-bit int - pedantic
)

func (CublascomputetypeT) String

func (e CublascomputetypeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasdiagtypeT

type CublasdiagtypeT int32

CublasdiagtypeT indicates whether the main diagonal of the dense matrix is unity and consequently should not be touched or modified by the function. Its values correspond to Fortran characters ‘N’ or ‘n’ (non-unit) and ‘U’ or ‘u’ (unit) that are often used as parameters to legacy BLAS implementations.

const (
	CublasDiagNonUnit CublasdiagtypeT = 0
	CublasDiagUnit    CublasdiagtypeT = 1
)

func (CublasdiagtypeT) String

func (e CublasdiagtypeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasemulationstrategyT

type CublasemulationstrategyT int32

CublasemulationstrategyT is used in cublasSetEmulationStrategy() to choose how to leverage floating point emulation algorithms. Note In general, the cublasSetEmulationStrategy() function takes precedence over the environment variable setting. However, setting the environment variable CUBLAS_EMULATION_STRATEGY to performant or eager will override the default emulation strategy with the corresponding emulation strategy, even if the default strategy was set by the function call.

const (
	CublasEmulationStrategyDefault    CublasemulationstrategyT = 0
	CublasEmulationStrategyPerformant CublasemulationstrategyT = 1
	CublasEmulationStrategyEager      CublasemulationstrategyT = 2
)

func (CublasemulationstrategyT) String

func (e CublasemulationstrategyT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasfillmodeT

type CublasfillmodeT int32

CublasfillmodeT indicates which part (lower or upper) of the dense matrix was filled and consequently should be used by the function. Its values correspond to Fortran characters L or l (lower) and U or u (upper) that are often used as parameters to legacy BLAS implementations.

const (
	CublasFillModeLower CublasfillmodeT = 0
	CublasFillModeUpper CublasfillmodeT = 1
	CublasFillModeFull  CublasfillmodeT = 2
)

func (CublasfillmodeT) String

func (e CublasfillmodeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasgemmalgoT

type CublasgemmalgoT int32

CublasgemmalgoT is an enumerant to specify the algorithm for matrix-matrix multiplication on GPU architectures up to sm_75. On sm_80 and newer GPU architectures, this enumerant has no effect. cuBLAS has the following algorithm options.

const (
	CublasGemmDfalt           CublasgemmalgoT = -1
	CublasGemmDefault         CublasgemmalgoT = -1
	CublasGemmAlgo0           CublasgemmalgoT = 0
	CublasGemmAlgo1           CublasgemmalgoT = 1
	CublasGemmAlgo2           CublasgemmalgoT = 2
	CublasGemmAlgo3           CublasgemmalgoT = 3
	CublasGemmAlgo4           CublasgemmalgoT = 4
	CublasGemmAlgo5           CublasgemmalgoT = 5
	CublasGemmAlgo6           CublasgemmalgoT = 6
	CublasGemmAlgo7           CublasgemmalgoT = 7
	CublasGemmAlgo8           CublasgemmalgoT = 8
	CublasGemmAlgo9           CublasgemmalgoT = 9
	CublasGemmAlgo10          CublasgemmalgoT = 10
	CublasGemmAlgo11          CublasgemmalgoT = 11
	CublasGemmAlgo12          CublasgemmalgoT = 12
	CublasGemmAlgo13          CublasgemmalgoT = 13
	CublasGemmAlgo14          CublasgemmalgoT = 14
	CublasGemmAlgo15          CublasgemmalgoT = 15
	CublasGemmAlgo16          CublasgemmalgoT = 16
	CublasGemmAlgo17          CublasgemmalgoT = 17
	CublasGemmAlgo18          CublasgemmalgoT = 18 // sliced 32x32
	CublasGemmAlgo19          CublasgemmalgoT = 19 // sliced 64x32
	CublasGemmAlgo20          CublasgemmalgoT = 20 // sliced 128x32
	CublasGemmAlgo21          CublasgemmalgoT = 21 // sliced 32x32 -splitK
	CublasGemmAlgo22          CublasgemmalgoT = 22 // sliced 64x32 -splitK
	CublasGemmAlgo23          CublasgemmalgoT = 23 // sliced 128x32 -splitK
	CublasGemmDefaultTensorOp CublasgemmalgoT = 99
	CublasGemmDfaltTensorOp   CublasgemmalgoT = 99
	CublasGemmAlgo0TensorOp   CublasgemmalgoT = 100
	CublasGemmAlgo1TensorOp   CublasgemmalgoT = 101
	CublasGemmAlgo2TensorOp   CublasgemmalgoT = 102
	CublasGemmAlgo3TensorOp   CublasgemmalgoT = 103
	CublasGemmAlgo4TensorOp   CublasgemmalgoT = 104
	CublasGemmAlgo5TensorOp   CublasgemmalgoT = 105
	CublasGemmAlgo6TensorOp   CublasgemmalgoT = 106
	CublasGemmAlgo7TensorOp   CublasgemmalgoT = 107
	CublasGemmAlgo8TensorOp   CublasgemmalgoT = 108
	CublasGemmAlgo9TensorOp   CublasgemmalgoT = 109
	CublasGemmAlgo10TensorOp  CublasgemmalgoT = 110
	CublasGemmAlgo11TensorOp  CublasgemmalgoT = 111
	CublasGemmAlgo12TensorOp  CublasgemmalgoT = 112
	CublasGemmAlgo13TensorOp  CublasgemmalgoT = 113
	CublasGemmAlgo14TensorOp  CublasgemmalgoT = 114
	CublasGemmAlgo15TensorOp  CublasgemmalgoT = 115
	CublasGemmAutotune        CublasgemmalgoT = 999 // benchmark available algorithms and choose optimal one, cached in handle
)

func (CublasgemmalgoT) String

func (e CublasgemmalgoT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasmathT

type CublasmathT int32

CublasmathT is used in cublasSetMathMode() to choose compute precision modes as defined in the following table. Since this setting does not directly control the use of Tensor Cores, the mode CublasTensorOpMath is being deprecated, and will be removed in a future release.

const (
	CublasDefaultMath                           CublasmathT = 0
	CublasTensorOpMath                          CublasmathT = 1
	CublasPedanticMath                          CublasmathT = 2
	CublasTF32TensorOpMath                      CublasmathT = 3
	CublasFP32EmulatedBf16x9Math                CublasmathT = 4
	CublasFP64EmulatedFixedpointMath            CublasmathT = 8
	CublasMathDisallowReducedPrecisionReduction CublasmathT = 16
)

func (CublasmathT) String

func (e CublasmathT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublasoperationT

type CublasoperationT int32

CublasoperationT indicates which operation needs to be performed with the dense matrix.

Its values correspond to Fortran characters ‘N’ or ‘n’ (non-transpose), ‘T’ or ‘t’ (transpose) and ‘C’ or ‘c’ (conjugate transpose) that are often used as parameters to legacy BLAS implementations.

const (
	CublasOpN        CublasoperationT = 0
	CublasOpT        CublasoperationT = 1
	CublasOpC        CublasoperationT = 2
	CublasOpHermitan CublasoperationT = 2 // synonym if [CublasOpC]
	CublasOpConjg    CublasoperationT = 3 // conjugate, placeholder - not supported in the current release
)

func (CublasoperationT) String

func (e CublasoperationT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublaspointermodeT

type CublaspointermodeT int32

CublaspointermodeT indicates whether the scalar values are passed by reference on the host or device.

It is important to point out that if several scalar values are present in the function call, all of them must conform to the same single pointer mode. The pointer mode can be set and retrieved using cublasSetPointerMode() and cublasGetPointerMode() routines, respectively.

const (
	CublasPointerModeHost   CublaspointermodeT = 0
	CublasPointerModeDevice CublaspointermodeT = 1
)

func (CublaspointermodeT) String

func (e CublaspointermodeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type CublassidemodeT

type CublassidemodeT int32

CublassidemodeT indicates whether the dense matrix is on the left or right side in the matrix equation solved by a particular function. Its values correspond to Fortran characters ‘L’ or ‘l’ (left) and ‘R’ or ‘r’ (right) that are often used as parameters to legacy BLAS implementations.

const (
	CublasSideLeft  CublassidemodeT = 0
	CublasSideRight CublassidemodeT = 1
)

func (CublassidemodeT) String

func (e CublassidemodeT) String() string

String returns the constant name, or a numeric representation for unknown values.

type DataType

type DataType int32

DataType represents a CUDA data type enumeration.

const (
	// 32-bit real float.
	R32F DataType = 0
	// 64-bit real double.
	R64F DataType = 1
	// 16-bit real half.
	R16F DataType = 2
	// 8-bit real signed int.
	R8I DataType = 3
	// 32-bit complex float pair.
	C32F DataType = 4
	// 64-bit complex double pair.
	C64F DataType = 5
	// 16-bit complex half pair.
	C16F DataType = 6
	// 8-bit complex signed int pair.
	C8I DataType = 7
	// 8-bit real unsigned int.
	R8U DataType = 8
	// 8-bit complex unsigned int pair.
	C8U DataType = 9
	// 32-bit real signed int.
	R32I DataType = 10
	// 32-bit complex signed int pair.
	C32I DataType = 11
	// 32-bit real unsigned int.
	R32U DataType = 12
	// 32-bit complex unsigned int pair.
	C32U DataType = 13
	// 16-bit real bfloat16.
	R16BF DataType = 14
	// 16-bit complex bfloat16 pair.
	C16BF DataType = 15
	// 4-bit real signed int.
	R4I DataType = 16
	// 4-bit complex signed int pair.
	C4I DataType = 17
	// 4-bit real unsigned int.
	R4U DataType = 18
	// 4-bit complex unsigned int pair.
	C4U DataType = 19
	// Value 20 now denotes R16I in cudaDataType; R16F_Aligned8 is a legacy cuBLASLt spelling.
	R16F_Aligned8 DataType = 20
	// Value 21 now denotes C16I in cudaDataType; R16BF_Aligned8 is a legacy cuBLASLt spelling.
	R16BF_Aligned8 DataType = 21
	// 8-bit real float with 4-bit exponent and 3-bit mantissa (fp8 e4m3).
	R8F_E4M3 DataType = 28
	// 8-bit real float with 5-bit exponent and 2-bit mantissa (fp8 e5m2).
	R8F_E5M2 DataType = 29
	// real as a signed 16-bit int
	R16I DataType = 20
	// complex as a pair of signed 16-bit int numbers
	C16I DataType = 21
	// real as a unsigned 16-bit int
	R16U DataType = 22
	// complex as a pair of unsigned 16-bit int numbers
	C16U DataType = 23
	// real as a signed 64-bit int
	R64I DataType = 24
	// complex as a pair of signed 64-bit int numbers
	C64I DataType = 25
	// real as a unsigned 64-bit int
	R64U DataType = 26
	// complex as a pair of unsigned 64-bit int numbers
	C64U DataType = 27
	// real as an unsigned nv_fp8_e4m3
	R8F_UE4M3 DataType = R8F_E4M3
	// real as an exponent-only unsigned nv_fp8_e8m0
	R8F_UE8M0 DataType = 30
	// real as a nv_fp6_e2m3
	R6F_E2M3 DataType = 31
	// real as a nv_fp6_e3m2
	R6F_E3M2 DataType = 32
	// real as a nv_fp4_e2m1
	R4F_E2M1 DataType = 33
	// real as an unsigned nv_fp8_ue5m3
	R8FUe5m3 DataType = 34
)

DataType constants.

type EmulationDesc

type EmulationDesc uintptr

EmulationDesc is an opaque handle for cublasLtEmulationDesc_t.

func NewEmulationDesc

func NewEmulationDesc() (EmulationDesc, error)

NewEmulationDesc creates a new emulation descriptor.

  • emulationDesc: Pointer to the previously created structure holding the emulation descriptor queried by this function. See EmulationDesc

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtEmulationDescCreate.

func (EmulationDesc) Attribute

func (e EmulationDesc) Attribute(attr EmulationDescAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

Attribute returns the value of the queried attribute belonging to a previously created emulation descriptor.

  • attr: The attribute that will be retrieved by this function. See EmulationDescAttributes
  • buf: Memory address containing the attribute value retrieved by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; If sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is zero and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or if sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtEmulationDescGetAttribute.

func (*EmulationDesc) Close

func (e *EmulationDesc) Close() error

Close destroys a previously created emulation descriptor.

A nil error means the descriptor was destroyed successfully.

If e is zero, Close returns nil. Otherwise Close sets e to zero when the call succeeds and leaves it unchanged when it fails. Only e is zeroed: a copy of it still refers to the released object.

Wraps cublasLtEmulationDescDestroy.

func (EmulationDesc) Init_internal

func (e EmulationDesc) Init_internal(size uint) error

Init_internal wraps cublasLtEmulationDescInit_internal.

func (EmulationDesc) SetAttribute

func (e EmulationDesc) SetAttribute(attr EmulationDescAttributes, buf unsafe.Pointer, sizeInBytes uint) error

SetAttribute sets the value of the specified attribute belonging to a previously created emulation descriptor.

  • attr: The attribute that will be set by this function. See EmulationDescAttributes
  • buf: The value to which the specified attribute should be set
  • sizeInBytes: Size of buf buffer (in bytes) for verification

A nil error means the attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes does not match size of the internal storage for the selected attribute.

Wraps cublasLtEmulationDescSetAttribute.

type EmulationDescAttributes

type EmulationDescAttributes int32

EmulationDescAttributes represents emulation descriptor attributes to configure floating point emulation.

const (
	EmulationDescStrategy                          EmulationDescAttributes = 0
	EmulationDescSpecialValuesSupport              EmulationDescAttributes = 1
	EmulationDescFixedpointMantissaControl         EmulationDescAttributes = 2
	EmulationDescFixedpointMaxMantissaBitCount     EmulationDescAttributes = 3
	EmulationDescFixedpointMantissaBitOffset       EmulationDescAttributes = 4
	EmulationDescFixedpointMantissaBitCountPointer EmulationDescAttributes = 5
)

func (EmulationDescAttributes) String

func (e EmulationDescAttributes) String() string

String returns the constant name, or a numeric representation for unknown values.

type EmulationDescOpaque

type EmulationDescOpaque struct {
	Data [8]uint64
}

EmulationDescOpaque represents semi-opaque descriptor for properties related to floating point emulation.

type Epilogue

type Epilogue int32

Epilogue represents postprocessing options for the epilogue.

const (
	EpilogueDefault     Epilogue = 1
	EpilogueRelu        Epilogue = 2
	EpilogueReluAux     Epilogue = EpilogueRelu | 128
	EpilogueBias        Epilogue = 4
	EpilogueReluBias    Epilogue = EpilogueRelu | EpilogueBias
	EpilogueReluAuxBias Epilogue = EpilogueReluAux | EpilogueBias
	EpilogueDrelu       Epilogue = 8 | 128
	EpilogueDreluBgrad  Epilogue = EpilogueDrelu | 16
	EpilogueGelu        Epilogue = 32
	EpilogueGeluAux     Epilogue = EpilogueGelu | 128
	EpilogueGeluBias    Epilogue = EpilogueGelu | EpilogueBias
	EpilogueGeluAuxBias Epilogue = EpilogueGeluAux | EpilogueBias
	EpilogueDgelu       Epilogue = 64 | 128
	EpilogueDgeluBgrad  Epilogue = EpilogueDgelu | 16
	EpilogueBgrada      Epilogue = 256
	EpilogueBgradb      Epilogue = 512
)

func (Epilogue) String

func (e Epilogue) String() string

String returns the constant name, or a numeric representation for unknown values.

type Handle

type Handle uintptr

Handle is an opaque handle for cublasLtHandle_t.

func Create

func Create() (Handle, error)

Create initializes the cuBLASLt library and creates a handle to an opaque structure holding the cuBLASLt library context.

It allocates light hardware resources on the host and device, and must be called prior to making any other cuBLASLt library calls. The cuBLASLt library context is tied to the current CUDA device. To use the library on multiple devices, one cuBLASLt handle must be created for each device. Furthermore, the device must be set as the current before invoking cuBLASLt functions with a handle tied to that device.

See also: cuBLAS Context.

  • lightHandle: Pointer to the allocated cuBLASLt handle for the created cuBLASLt context

A nil error means the allocation completed successfully.

Errors:

  • ErrAllocFailed: Resource allocation failed inside the cuBLASLt library. This is usually caused by a cudaMalloc() failure. To correct: prior to the function call, deallocate the previously allocated memory as much as possible.
  • ErrInvalidValue: lighthandle is NULL
  • ErrNotInitialized: The cuBLASLt library was not initialized. This usually happens: when Create is not called first; an error in the CUDA Runtime API called by the cuBLASLt routine, or an error in the hardware setup.

Wraps cublasLtCreate.

func (*Handle) Close

func (h *Handle) Close() error

Close releases hardware resources used by the cuBLASLt library.

This function is usually the last call with a particular handle to the cuBLASLt library. Because Create allocates some internal resources and the release of those resources by calling Handle.Close will implicitly call cudaDeviceSynchronize(), it is recommended to minimize the number of times these functions are called.

A nil error means the cuBLASLt context was successfully destroyed.

Errors:

If h is zero, Close returns nil. Otherwise Close sets h to zero when the call succeeds and leaves it unchanged when it fails. Only h is zeroed: a copy of it still refers to the released object.

Wraps cublasLtDestroy.

func (Handle) Matmul

func (h Handle) Matmul(computeDesc MatmulDesc, alpha Scalar, a driver.DevicePtr, adesc MatrixLayout, b driver.DevicePtr, bdesc MatrixLayout, beta Scalar, c driver.DevicePtr, cdesc MatrixLayout, d driver.DevicePtr, ddesc MatrixLayout, algo *MatmulAlgo, workspace driver.DevicePtr, workspaceSizeInBytes uint, stream driver.Stream) error

Matmul computes the matrix multiplication of matrices A and B to produce the output matrix D, according to the following operation:

D = alpha*(A*B) + beta*(C), where A, B, and C are input matrices, and alpha and beta are input scalars.

Note: This function supports both in-place matrix multiplication ( C == D and Cdesc == Ddesc) and out-of-place matrix multiplication ( C != D, both matrices must have the same data type, number of rows, number of columns, batch size, and memory order). In the out-of-place case, the leading dimension of C can be different from the leading dimension of D. Specifically the leading dimension of C can be 0 to achieve row or column broadcast. If Cdesc is omitted, this function assumes it to be equal to Ddesc. The workspace pointer must be aligned to at least a multiple of 256 bytes. The recommendations on workspaceSizeInBytes are the same as mentioned in the cublasSetWorkspace() section. Datatypes Supported: Handle.Matmul supports the following computeType, scaleType, Atype/Btype, and Ctype. Footnotes can be found at the end of this section. To use IMMA kernels, one of the following sets of requirements, with the first being the preferred one, must be met:

To use tensor- or block-scaled FP8 kernels, the following set of requirements must be satisfied:

  • All matrix dimensions must meet the optimal requirements listed in Tensor Core Usage (i.e. pointers and matrix dimension must support 16-byte alignment).
  • Scaling mode must meet the restrictions noted in the Scaling Mode Support Overview table.
  • A must be transposed and B non-transposed (The “TN” format) on Ada (compute capability 8.9), Hopper (compute capability 9.0), and Blackwell GeForce (compute capability 12.x) GPUs.
  • The compute type must be CublasCompute32F.
  • The scale type must be CUDA_R_32F.

See the table below when using FP8 kernels:

AType           BType           CType        DType             Bias Type
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_8F_E5M2 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_8F_E5M2 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E5M2 9  CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E5M2 9  CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7

To use block-scaled FP4 kernels, the following set of requirements must be satisfied:

All matrix dimensions must meet the optimal requirements listed in Tensor Core Usage (i.e. pointers and matrix dimension must support 16-byte alignment).

Scaling mode must be MatmulMatrixScaleVec16Ue4m3

A must be transposed and B non-transposed (The “TN” format).

The compute type must be CublasCompute32F.

The scale type must be CUDA_R_32F.

AType           BType           CType        DType           Bias Type
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16BF  CUDA_R_16BF     CUDA_R_16BF 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16BF  CUDA_R_4F_E2M1  CUDA_R_16BF 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16F   CUDA_R_16F      CUDA_R_16F 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16F   CUDA_R_4F_E2M1  CUDA_R_16F 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_32F   CUDA_R_32F      CUDA_R_16BF 7

When A,B,C,D are planar-complex matrices ( MatrixLayoutPlaneOffset != 0, see MatrixLayoutAttribute) to make use of mixed precision tensor core acceleration, the following set of requirements must be satisfied:

computeType         scaleType   Atype/Btype    Ctype
CUBLAS_COMPUTE_32F  CUDA_C_32F  CUDA_C_16F 8   CUDA_C_16F 8
CUBLAS_COMPUTE_32F  CUDA_C_32F  CUDA_C_16F 8   CUDA_C_32F 8
CUBLAS_COMPUTE_32F  CUDA_C_32F  CUDA_C_16BF 8  CUDA_C_16BF 8
CUBLAS_COMPUTE_32F  CUDA_C_32F  CUDA_C_16BF 8  CUDA_C_32F 8

Experimental: To use Handle.Matmul with grouped matrices, the following set of requirements must be satisfied:

All matrix dimensions must meet the optimal requirements listed in Tensor Core Usage (i.e. pointers and matrix dimension must support 16-byte alignment).

GPU with one of the following compute capabilities: 9.0, 10.x, 11.0.

The batch mode of all matrices must be BatchModeGrouped.

The pointer mode must be PointerModeHost or PointerModeDevice.

The scale mode of matrices C and D must be MatmulMatrixScaleScalar32F.

On GPUs with compute capability 9.0:

On GPUs with compute capability 10.x and 11.0:

AType           BType           CType        DType             Bias Type
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E4M3  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16BF  CUDA_R_8F_E5M2 9  CUDA_R_16BF 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_16F   CUDA_R_8F_E5M2 9  CUDA_R_16F 7
CUDA_R_8F_E4M3  CUDA_R_8F_E5M2  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E4M3 9  CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16BF  CUDA_R_8F_E5M2 9  CUDA_R_16BF 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E4M3 9  CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_16F   CUDA_R_8F_E5M2 9  CUDA_R_16F 7
CUDA_R_8F_E5M2  CUDA_R_8F_E4M3  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16BF  CUDA_R_16BF       CUDA_R_16BF 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_16F   CUDA_R_16F        CUDA_R_16F 7
CUDA_R_4F_E2M1  CUDA_R_4F_E2M1  CUDA_R_32F   CUDA_R_32F        CUDA_R_16BF 7

Note: Because the shape information for the matrices is only available on the GPU (see GroupedMatrixLayoutRowsArray, GroupedMatrixLayoutColsArray, and GroupedMatrixLayoutLdArray), the arguments validation is very limited. So it is possible that invalid arguments are not detected which will result in an undefined behavior. NOTES: 7( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55) Epilogue modes that combine ReLU, dReLu, GELU, or dGELU with Bias (see MatmulDescEpilogue in MatmulDescAttributes) are not supported when D matrix memory order is defined as OrderRow. For best performance when using the bias vector, specify zero beta and set pointer mode to PointerModeHost. 8( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17) Use of CUBLAS_ORDER_ROW together with CublasOpC (Hermitian operator) is not supported unless all of A, B, C, and D matrices use the CUBLAS_ORDER_ROW ordering. 9( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) FP8 DType is not supported when scaling modes are one of MatmulMatrixScaleOuterVec32F, MatmulMatrixScaleVec12832F, and CUBLASLT_MATMUL_MATRIX_SCALE_BLK128x128_32F.

  • computeDesc: Handle to a previously created matrix multiplication descriptor of type MatmulDesc
  • alpha: Scalar used in the multiplication. Its kind must match the scale type of computeDesc (MatmulDescScaleType). It holds a host value or, under a descriptor pointer mode (MatmulDescPointerMode, MatrixTransformDescPointerMode) other than PointerModeHost, a device address made with DeviceScalar.
  • a: Pointers to the GPU memory associated with the corresponding descriptors Adesc, Bdesc and Cdesc
  • adesc: Handles to the previous created descriptors of the type MatrixLayout
  • b: Pointers to the GPU memory associated with the corresponding descriptors Adesc, Bdesc and Cdesc
  • bdesc: Handles to the previous created descriptors of the type MatrixLayout
  • beta: Scalar used in the multiplication. Its kind must match the scale type of computeDesc (MatmulDescScaleType). It holds a host value or, under a descriptor pointer mode (MatmulDescPointerMode, MatrixTransformDescPointerMode) other than PointerModeHost, a device address made with DeviceScalar.
  • c: Pointers to the GPU memory associated with the corresponding descriptors Adesc, Bdesc and Cdesc
  • cdesc: Handles to the previous created descriptors of the type MatrixLayout
  • d: Pointer to the GPU memory associated with the descriptor Ddesc
  • ddesc: Handle to the previous created descriptor of the type MatrixLayout
  • algo: Handle for matrix multiplication algorithm to be used. See MatmulAlgo. When NULL, an implicit heuristics query with default search preferences will be performed to determine actual algorithm to use
  • workspace: Pointer to the workspace buffer allocated in the GPU memory. Must be 256B aligned (i.e. lowest 8 bits of address must be 0)
  • workspaceSizeInBytes: Size of the workspace
  • stream: The CUDA stream where all the GPU work will be submitted

Errors:

  • ErrArchMismatch: If the configured operation cannot be run using the selected device.
  • ErrExecutionFailed: If CUDA reported an execution error from the device.
  • ErrInvalidValue: If the parameters are unexpectedly NULL, in conflict or in an impossible configuration. For example, when workspaceSizeInBytes is less than workspace required by the configured algo.
  • ErrNotInitialized: If cuBLASLt handle has not been initialized.
  • ErrNotSupported: If the current implementation on the selected device doesn’t support the configured operation.

Wraps cublasLtMatmul.

func (Handle) MatmulAlgoCheck

func (h Handle) MatmulAlgoCheck(operationDesc MatmulDesc, adesc MatrixLayout, bdesc MatrixLayout, cdesc MatrixLayout, ddesc MatrixLayout, algo *MatmulAlgo) (MatmulHeuristicResult, error)

MatmulAlgoCheck performs the correctness check on the matrix multiply algorithm descriptor for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.

It checks whether the descriptor is supported on the current device, and returns the result containing the required workspace and the calculated wave count.

Note: Success doesn’t fully guarantee that the algo will run. The algo will fail if, for example, the buffers are not correctly aligned. However, if Handle.MatmulAlgoCheck fails, the algo will not run.

  • operationDesc: Handle to a previously created matrix multiplication descriptor of type MatmulDesc
  • adesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • bdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • cdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • ddesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • algo: Descriptor which specifies which matrix multiplication algorithm should be used. See MatmulAlgo. May point to result->algo
  • result: Pointer to the structure holding the results returned by this function. The results comprise of the required workspace and the calculated wave count. The algo field is never updated. See MatmulHeuristicResult

A nil error means the check was successful.

Errors:

  • ErrArchMismatch: If the algo configuration cannot be run using the selected device.
  • ErrInvalidValue: If matrix layout descriptors or the operation descriptor do not match the algo descriptor.
  • ErrNotSupported: If the algo configuration or data type combination is not currently supported on the given device.

Wraps cublasLtMatmulAlgoCheck.

func (Handle) MatmulAlgoCheckForStream

func (h Handle) MatmulAlgoCheckForStream(operationDesc MatmulDesc, adesc MatrixLayout, bdesc MatrixLayout, cdesc MatrixLayout, ddesc MatrixLayout, algo *MatmulAlgo, stream driver.Stream) (MatmulHeuristicResult, error)

MatmulAlgoCheckForStream performs the correctness check on the matrix multiply algorithm descriptor for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.

It checks whether the descriptor is supported on the current device and execution context (specified by the stream), and returns the result containing the required workspace and the calculated wave count. Unlike Handle.MatmulAlgoCheck, this variant takes a CUDA stream into account when evaluating algorithm compatibility. If the stream is associated with a Green Context (a CUDA execution context that provides access to a subset of GPU resources), the check reflects the SM count and resource constraints of that context, not the full device. For more information see Execution Context Management.

Note: Success doesn’t fully guarantee that the algo will run. The algo will fail if, for example, the buffers are not correctly aligned. However, if Handle.MatmulAlgoCheckForStream fails, the algo will not run.

  • operationDesc: Handle to a previously created matrix multiplication descriptor of type MatmulDesc
  • adesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • bdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • cdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • ddesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • algo: Descriptor which specifies which matrix multiplication algorithm should be used. See MatmulAlgo. May point to result->algo
  • result: Pointer to the structure holding the results returned by this function. The results comprise of the required workspace and the calculated wave count. The algo field is never updated. See MatmulHeuristicResult
  • stream: CUDA stream used to determine the execution context. If the stream is associated with a Green Context, the check accounts for the SM count and resource constraints of that context

A nil error means the check was successful.

Errors:

  • ErrArchMismatch: If the algo configuration cannot be run using the selected device.
  • ErrInvalidValue: If matrix layout descriptors or the operation descriptor do not match the algo descriptor.
  • ErrNotSupported: If the algo configuration or data type combination is not currently supported on the given device or execution context.

Wraps cublasLtMatmulAlgoCheckForStream.

func (Handle) MatmulAlgoGetHeuristic

func (h Handle) MatmulAlgoGetHeuristic(operationDesc MatmulDesc, adesc MatrixLayout, bdesc MatrixLayout, cdesc MatrixLayout, ddesc MatrixLayout, preference MatmulPreference, heuristicResultsArray []MatmulHeuristicResult) (int, error)

MatmulAlgoGetHeuristic retrieves the possible algorithms for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.

The output is placed in heuristicResultsArray[] in the order of increasing estimated compute time.

Note: This function may load some kernels using CUDA Driver API which may fail when there is no available GPU memory. Do not allocate the entire VRAM before running Handle.MatmulAlgoGetHeuristic.

  • operationDesc: Handle to a previously created matrix multiplication descriptor of type MatmulDesc
  • adesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • bdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • cdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • ddesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • preference: Pointer to the structure holding the heuristic search preferences descriptor. See MatmulPreference
  • heuristicResultsArray: Array containing the algorithm heuristics and associated runtime characteristics, returned by this function, in the order of increasing estimated compute time
  • returnAlgoCount: Number of algorithms returned by this function. This is the number of heuristicResultsArray elements written

A nil error means query was successful. Inspect heuristicResultsArray[0 to (returnAlgoCount -1)].state for the status of the results.

Errors:

Wraps cublasLtMatmulAlgoGetHeuristic.

func (Handle) MatmulAlgoGetHeuristicForStream

func (h Handle) MatmulAlgoGetHeuristicForStream(operationDesc MatmulDesc, adesc MatrixLayout, bdesc MatrixLayout, cdesc MatrixLayout, ddesc MatrixLayout, preference MatmulPreference, heuristicResultsArray []MatmulHeuristicResult, stream driver.Stream) (int, error)

MatmulAlgoGetHeuristicForStream retrieves the possible algorithms for the matrix multiply operation Handle.Matmul function with the given input matrices A, B and C, and the output matrix D.

The output is placed in heuristicResultsArray[] in the order of increasing estimated compute time. Unlike Handle.MatmulAlgoGetHeuristic, this variant takes a CUDA stream into account when selecting algorithms. If the stream is associated with a Green Context (a CUDA execution context that provides access to a subset of GPU resources), the heuristic considers the SM count and resource constraints of that context. For more information see Execution Context Management.

Note: This function may load some kernels using CUDA Driver API which may fail when there is no available GPU memory. Do not allocate the entire VRAM before running Handle.MatmulAlgoGetHeuristicForStream.

Note: Calling Handle.Matmul on a stream associated with a Green Context with an algo requested using a different execution context is not guaranteed to work.

  • operationDesc: Handle to a previously created matrix multiplication descriptor of type MatmulDesc
  • adesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • bdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • cdesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • ddesc: Handles to the previously created matrix layout descriptors of the type MatrixLayout
  • preference: Pointer to the structure holding the heuristic search preferences descriptor. See MatmulPreference
  • heuristicResultsArray: Array containing the algorithm heuristics and associated runtime characteristics, returned by this function, in the order of increasing estimated compute time
  • returnAlgoCount: Number of algorithms returned by this function. This is the number of heuristicResultsArray elements written
  • stream: CUDA stream used to determine the execution context. If the stream is associated with a Green Context, the heuristic accounts for the SM count and resource constraints of that context

A nil error means query was successful. Inspect heuristicResultsArray[0 to (returnAlgoCount -1)].state for the status of the results.

Errors:

Wraps cublasLtMatmulAlgoGetHeuristicForStream.

func (Handle) MatmulAlgoGetIds

func (h Handle) MatmulAlgoGetIds(computeType ComputeType, scaleType DataType, atype DataType, btype DataType, ctype DataType, dtype DataType, algoIdsArray []int32) (int, error)

MatmulAlgoGetIds retrieves the IDs of all the matrix multiply algorithms that are valid, and can potentially be run by the Handle.Matmul function, for given types of the input matrices A, B and C, and of the output matrix D.

Note: The IDs are returned in no particular order.

  • computeType: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • scaleType: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • atype: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • btype: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • ctype: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • dtype: Data types of the computation type, scaling factors and of the operand matrices. See cudaDataType_t
  • algoIdsArray: Array containing the algorithm IDs returned by this function
  • returnAlgoCount: Number of algorithms actually returned by this function

A nil error means query was successful. Inspect returnAlgoCount to get actual number of IDs available.

Errors:

Wraps cublasLtMatmulAlgoGetIds.

func (Handle) MatmulAlgoInit

func (h Handle) MatmulAlgoInit(computeType ComputeType, scaleType DataType, atype DataType, btype DataType, ctype DataType, dtype DataType, algoId int32, algo *MatmulAlgo) error

MatmulAlgoInit initializes the matrix multiply algorithm structure for the Handle.Matmul , for a specified matrix multiply algorithm and input matrices A, B and C, and the output matrix D.

  • computeType: Compute type. See MatmulDescComputeType of MatmulDescAttributes
  • scaleType: Scale type. See MatmulDescScaleType of MatmulDescAttributes. Usually same as computeType
  • atype: Datatype precision for the input and output matrices. See cudaDataType_t
  • btype: Datatype precision for the input and output matrices. See cudaDataType_t
  • ctype: Datatype precision for the input and output matrices. See cudaDataType_t
  • dtype: Datatype precision for the input and output matrices. See cudaDataType_t
  • algoId: Specifies the algorithm being initialized. Should be a valid algoId returned by the Handle.MatmulAlgoGetIds function
  • algo: Pointer to the opaque structure to be initialized. See MatmulAlgo

A nil error means the structure was successfully initialized.

Errors:

  • ErrInvalidValue: If algo is NULL or algoId is outside the recognized range.
  • ErrNotSupported: If algoId is not supported for given combination of data types.

Wraps cublasLtMatmulAlgoInit.

func (Handle) MatrixTransform

func (h Handle) MatrixTransform(transformDesc MatrixTransformDesc, alpha Scalar, a driver.DevicePtr, adesc MatrixLayout, beta Scalar, b driver.DevicePtr, bdesc MatrixLayout, c driver.DevicePtr, cdesc MatrixLayout, stream driver.Stream) error

MatrixTransform computes the matrix transformation operation on the input matrices A and B, to produce the output matrix C, according to the below operation:

C = alpha*transformation(A) + beta*transformation(B), where A, B are input matrices, and alpha and beta are input scalars. The transformation operation is defined by the transformDesc pointer. This function can be used to change the memory order of data or to scale and shift the values.

  • transformDesc: Pointer to the opaque descriptor holding the matrix transformation operation. See MatrixTransformDesc
  • alpha: Scalar used in the multiplication. Its kind must match the scale type of transformDesc (MatrixTransformDescScaleType). It holds a host value or, under a descriptor pointer mode (MatmulDescPointerMode, MatrixTransformDescPointerMode) other than PointerModeHost, a device address made with DeviceScalar.
  • a: Pointers to the GPU memory associated with the corresponding descriptors Adesc and Bdesc
  • adesc: Handles to the previous created descriptors of the type MatrixLayout. Adesc or Bdesc can be NULL if the corresponding pointer is NULL and the corresponding scalar is zero
  • beta: Scalar used in the multiplication. Its kind must match the scale type of transformDesc (MatrixTransformDescScaleType). It holds a host value or, under a descriptor pointer mode (MatmulDescPointerMode, MatrixTransformDescPointerMode) other than PointerModeHost, a device address made with DeviceScalar.
  • b: Pointers to the GPU memory associated with the corresponding descriptors Adesc and Bdesc
  • bdesc: Handles to the previous created descriptors of the type MatrixLayout. Adesc or Bdesc can be NULL if the corresponding pointer is NULL and the corresponding scalar is zero
  • c: Pointer to the GPU memory associated with the Cdesc descriptor
  • cdesc: Handles to the previous created descriptors of the type MatrixLayout. Adesc or Bdesc can be NULL if the corresponding pointer is NULL and the corresponding scalar is zero
  • stream: The CUDA stream where all the GPU work will be submitted

Errors:

  • ErrArchMismatch: If the configured operation cannot be run using the selected device.
  • ErrExecutionFailed: If CUDA reported an execution error from the device.
  • ErrInvalidValue: If the parameters are in conflict or in an impossible configuration. For example, when A is not NULL, but Adesc is NULL.
  • ErrNotInitialized: If cuBLASLt handle has not been initialized.
  • ErrNotSupported: If the current implementation on the selected device does not support the configured operation.

Wraps cublasLtMatrixTransform.

type IntegerWidth

type IntegerWidth int32

IntegerWidth represents experimental: Enum for integer width of array pointer elements.

const (
	IntegerWidth32 IntegerWidth = 0
	IntegerWidth64 IntegerWidth = 1
)

func (IntegerWidth) String

func (e IntegerWidth) String() string

String returns the constant name, or a numeric representation for unknown values.

type LibraryAttempt

type LibraryAttempt struct {
	Name string // path or soname passed to dlopen
	Err  error
}

LibraryAttempt records one failed attempt to open the shared library.

type LibraryConflictError

type LibraryConflictError struct {
	Loaded    string
	Requested string

	// Implicit reports that the loaded library was opened lazily and no
	// successful Load has since acknowledged it. A
	// caller that sees this called some
	// other function first, and that call took the default search list.
	Implicit bool
}

LibraryConflictError reports a Load call naming a different library than the one already loaded. Only one library is loaded per process.

func (*LibraryConflictError) Error

func (e *LibraryConflictError) Error() string

Error reports the conflicting library paths, and whether the library that is already loaded got there without a Load call.

type LibraryError

type LibraryError struct {
	Library  string
	Env      string
	Path     string
	Attempts []LibraryAttempt
	Hint     string
}

LibraryError reports that libcublasLt could not be opened. Attempts lists every name tried in order. Path is set when an explicit path, from Load or CUBLASLT_LIB_PATH, was requested and failed. Hint reports pkg-config discovery results and query failures, when discovery ran.

func (*LibraryError) Error

func (e *LibraryError) Error() string

Error describes the library load attempts and their errors.

func (*LibraryError) Unwrap

func (e *LibraryError) Unwrap() []error

Unwrap returns the error from each attempt.

type LibraryPropertyType

type LibraryPropertyType int32

LibraryPropertyType identifies a library property to query.

const (
	MajorVersion LibraryPropertyType = 0
	MinorVersion LibraryPropertyType = 1
	PatchLevel   LibraryPropertyType = 2
)

LibraryPropertyType constants.

type LoggerCallback

type LoggerCallback func(logLevel int32, functionName uintptr, message uintptr)

LoggerCallback is the Go form of cublasLtLoggerCallback_t.

It corresponds to the C signature

typedef void (*cublasLtLoggerCallback_t)(int logLevel, const char* functionName, const char* message);

Pass one to the API by converting it with purego.NewCallback, which is why every pointer argument is a uintptr rather than a Go pointer: the memory belongs to the C library and must not be traced by the collector.

type MatmulAlgo

type MatmulAlgo struct {
	Data [8]uint64
}

MatmulAlgo represents semi-opaque algorithm descriptor (to avoid complicated alloc/free schemes).

This structure can be trivially serialized and later restored for use with the same version of cuBLAS library to save on selecting the right configuration again.

type MatmulAlgoCapAttributes

type MatmulAlgoCapAttributes int32

MatmulAlgoCapAttributes represents capabilities Attributes that can be retrieved from an initialized Algo structure.

const (
	AlgoCapSplitkSupport                 MatmulAlgoCapAttributes = 0
	AlgoCapReductionSchemeMask           MatmulAlgoCapAttributes = 1
	AlgoCapCtaSwizzlingSupport           MatmulAlgoCapAttributes = 2
	AlgoCapStridedBatchSupport           MatmulAlgoCapAttributes = 3
	AlgoCapOutOfPlaceResultSupport       MatmulAlgoCapAttributes = 4
	AlgoCapUploSupport                   MatmulAlgoCapAttributes = 5
	AlgoCapTileIds                       MatmulAlgoCapAttributes = 6
	AlgoCapCustomOptionMax               MatmulAlgoCapAttributes = 7
	AlgoCapCustomMemoryOrder             MatmulAlgoCapAttributes = 10
	AlgoCapPointerModeMask               MatmulAlgoCapAttributes = 11
	AlgoCapEpilogueMask                  MatmulAlgoCapAttributes = 12
	AlgoCapStagesIds                     MatmulAlgoCapAttributes = 13
	AlgoCapLdNegative                    MatmulAlgoCapAttributes = 14
	AlgoCapNumericalImplFlags            MatmulAlgoCapAttributes = 15
	AlgoCapMinAlignmentABytes            MatmulAlgoCapAttributes = 16
	AlgoCapMinAlignmentBBytes            MatmulAlgoCapAttributes = 17
	AlgoCapMinAlignmentCBytes            MatmulAlgoCapAttributes = 18
	AlgoCapMinAlignmentDBytes            MatmulAlgoCapAttributes = 19
	AlgoCapPointerArrayBatchSupport      MatmulAlgoCapAttributes = 21
	AlgoCapFloatingPointEmulationSupport MatmulAlgoCapAttributes = 22
	AlgoCapPointerArrayGroupedSupport    MatmulAlgoCapAttributes = 23
)

func (MatmulAlgoCapAttributes) String

func (e MatmulAlgoCapAttributes) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulAlgoConfigAttributes

type MatmulAlgoConfigAttributes int32

MatmulAlgoConfigAttributes represents algo Configuration Attributes that can be set according to the Algo capabilities.

const (
	AlgoConfigId              MatmulAlgoConfigAttributes = 0
	AlgoConfigTileId          MatmulAlgoConfigAttributes = 1
	AlgoConfigSplitkNum       MatmulAlgoConfigAttributes = 2
	AlgoConfigReductionScheme MatmulAlgoConfigAttributes = 3
	AlgoConfigCtaSwizzling    MatmulAlgoConfigAttributes = 4
	AlgoConfigCustomOption    MatmulAlgoConfigAttributes = 5
	AlgoConfigStagesId        MatmulAlgoConfigAttributes = 6
	AlgoConfigInnerShapeId    MatmulAlgoConfigAttributes = 7
	AlgoConfigClusterShapeId  MatmulAlgoConfigAttributes = 8
)

func (MatmulAlgoConfigAttributes) String

String returns the constant name, or a numeric representation for unknown values.

type MatmulBatchInvarianceFlags

type MatmulBatchInvarianceFlags int32

MatmulBatchInvarianceFlags represents experimental: batch invariance flags.

const (
	BatchInvarianceDisabled MatmulBatchInvarianceFlags = 0x0
	BatchInvarianceAlign2B  MatmulBatchInvarianceFlags = 0x1
	BatchInvarianceAlign4B  MatmulBatchInvarianceFlags = 0x2
	BatchInvarianceAlign8B  MatmulBatchInvarianceFlags = 0x3
	BatchInvarianceAlign16B MatmulBatchInvarianceFlags = 0x4
	BatchInvarianceAuto     MatmulBatchInvarianceFlags = 0x8
	BatchInvarianceUnset    MatmulBatchInvarianceFlags = 0x8000
)

func (MatmulBatchInvarianceFlags) String

String returns the constant name, or a numeric representation for unknown values.

type MatmulDesc

type MatmulDesc uintptr

MatmulDesc is an opaque handle for cublasLtMatmulDesc_t.

func NewMatmulDesc

func NewMatmulDesc(computeType ComputeType, scaleType DataType) (MatmulDesc, error)

NewMatmulDesc creates a matrix multiply descriptor by allocating the memory needed to hold its opaque structure.

  • matmulDesc: Pointer to the structure holding the matrix multiply descriptor created by this function. See MatmulDesc
  • computeType: Enumerant that specifies the data precision for the matrix multiply descriptor this function creates. See CublascomputetypeT
  • scaleType: Enumerant that specifies the data precision for the matrix transform descriptor this function creates. See cudaDataType_t

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtMatmulDescCreate.

func (MatmulDesc) Attribute

func (m MatmulDesc) Attribute(attr MatmulDescAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

Attribute returns the value of the queried attribute belonging to a previously created matrix multiply descriptor.

  • attr: The attribute that will be retrieved by this function. See MatmulDescAttributes
  • buf: Memory address containing the attribute value retrieved by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatmulDescGetAttribute.

func (*MatmulDesc) Close

func (m *MatmulDesc) Close() error

Close destroys a previously created matrix multiply descriptor object.

If m is zero, Close returns nil. Otherwise Close sets m to zero when the call succeeds and leaves it unchanged when it fails. Only m is zeroed: a copy of it still refers to the released object.

Wraps cublasLtMatmulDescDestroy.

func (MatmulDesc) Init_internal

func (m MatmulDesc) Init_internal(size uint, computeType ComputeType, scaleType DataType) error

Init_internal wraps cublasLtMatmulDescInit_internal.

func (MatmulDesc) SetAttribute

func (m MatmulDesc) SetAttribute(attr MatmulDescAttributes, buf unsafe.Pointer, sizeInBytes uint) error

SetAttribute sets the value of the specified attribute belonging to a previously created matrix multiply descriptor.

  • attr: The attribute that will be set by this function. See MatmulDescAttributes
  • buf: The value to which the specified attribute should be set
  • sizeInBytes: Size of buf buffer (in bytes) for verification

A nil error means the attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes doesn’t match the size of the internal storage for the selected attribute.

Wraps cublasLtMatmulDescSetAttribute.

type MatmulDescAttributes

type MatmulDescAttributes int32

MatmulDescAttributes represents matmul descriptor attributes to define details of the operation.

const (
	MatmulDescComputeType             MatmulDescAttributes = 0
	MatmulDescScaleType               MatmulDescAttributes = 1
	MatmulDescPointerMode             MatmulDescAttributes = 2
	MatmulDescTransa                  MatmulDescAttributes = 3
	MatmulDescTransb                  MatmulDescAttributes = 4
	MatmulDescTransc                  MatmulDescAttributes = 5
	MatmulDescFillMode                MatmulDescAttributes = 6
	MatmulDescEpilogue                MatmulDescAttributes = 7
	MatmulDescBiasPointer             MatmulDescAttributes = 8
	MatmulDescBiasBatchStride         MatmulDescAttributes = 10
	MatmulDescEpilogueAuxPointer      MatmulDescAttributes = 11
	MatmulDescEpilogueAuxLd           MatmulDescAttributes = 12
	MatmulDescEpilogueAuxBatchStride  MatmulDescAttributes = 13
	MatmulDescAlphaVectorBatchStride  MatmulDescAttributes = 14
	MatmulDescSmCountTarget           MatmulDescAttributes = 15
	MatmulDescAScalePointer           MatmulDescAttributes = 17
	MatmulDescBScalePointer           MatmulDescAttributes = 18
	MatmulDescCScalePointer           MatmulDescAttributes = 19
	MatmulDescDScalePointer           MatmulDescAttributes = 20
	MatmulDescAmaxDPointer            MatmulDescAttributes = 21
	MatmulDescEpilogueAuxDataType     MatmulDescAttributes = 22
	MatmulDescEpilogueAuxScalePointer MatmulDescAttributes = 23
	MatmulDescEpilogueAuxAmaxPointer  MatmulDescAttributes = 24
	MatmulDescFastAccum               MatmulDescAttributes = 25
	MatmulDescBiasDataType            MatmulDescAttributes = 26
	MatmulDescAScaleMode              MatmulDescAttributes = 31
	MatmulDescBScaleMode              MatmulDescAttributes = 32
	MatmulDescCScaleMode              MatmulDescAttributes = 33
	MatmulDescDScaleMode              MatmulDescAttributes = 34
	MatmulDescEpilogueAuxScaleMode    MatmulDescAttributes = 35
	MatmulDescDOutScalePointer        MatmulDescAttributes = 36
	MatmulDescDOutScaleMode           MatmulDescAttributes = 37
	MatmulDescEmulationDescriptor     MatmulDescAttributes = 38
	MatmulDescAlphaBatchStride        MatmulDescAttributes = 39
	MatmulDescBetaBatchStride         MatmulDescAttributes = 40
	MatmulDescBatchInvarianceFlags    MatmulDescAttributes = 41
)

func (MatmulDescAttributes) String

func (e MatmulDescAttributes) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulDescOpaque

type MatmulDescOpaque struct {
	Data [32]uint64
}

MatmulDescOpaque represents semi-opaque descriptor for Handle.Matmul operation details.

type MatmulHeuristicResult

type MatmulHeuristicResult struct {
	Algo          MatmulAlgo
	WorkspaceSize uint
	State         Result
	WavesCount    float32
	Reserved      [4]int32
}

MatmulHeuristicResult represents results structure used by Handle.MatmulAlgoGetHeuristic.

Holds returned configured algo descriptor and its runtime properties.

type MatmulInnerShape

type MatmulInnerShape int32

MatmulInnerShape represents inner size of the kernel.

Represents various aspects of internal kernel design, that don't impact CUDA grid size but may have other more subtle effects.

const (
	MatmulInnerShapeUndefined MatmulInnerShape = 0
	MatmulInnerShapeMma884    MatmulInnerShape = 1
	MatmulInnerShapeMma1684   MatmulInnerShape = 2
	MatmulInnerShapeMma1688   MatmulInnerShape = 3
	MatmulInnerShapeMma16816  MatmulInnerShape = 4
	MatmulInnerShapeEnd       MatmulInnerShape = 5
)

func (MatmulInnerShape) String

func (e MatmulInnerShape) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulMatrixScale

type MatmulMatrixScale int32

MatmulMatrixScale represents scaling mode for per-matrix scaling.

See documentation for layout information.

const (
	MatmulMatrixScaleScalar32F         MatmulMatrixScale = 0
	MatmulMatrixScaleVec16Ue4m3        MatmulMatrixScale = 1
	MatmulMatrixScaleVec32Ue8m0        MatmulMatrixScale = 2
	MatmulMatrixScaleOuterVec32F       MatmulMatrixScale = 3
	MatmulMatrixScaleVec12832F         MatmulMatrixScale = 4
	MatmulMatrixScaleBlk128x12832F     MatmulMatrixScale = 5
	MatmulMatrixScalePerBatchScalar32F MatmulMatrixScale = 6
	MatmulMatrixScaleVec128MnK4Ue8m0   MatmulMatrixScale = 12
	MatmulMatrixScaleVec32MnK4Ue8m0    MatmulMatrixScale = 13
	MatmulMatrixScaleEnd               MatmulMatrixScale = 14
	MatmulMatrixScaleReserved          MatmulMatrixScale = 0x7f
)

func (MatmulMatrixScale) String

func (e MatmulMatrixScale) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulPreference

type MatmulPreference uintptr

MatmulPreference is an opaque handle for cublasLtMatmulPreference_t.

func NewMatmulPreference

func NewMatmulPreference() (MatmulPreference, error)

NewMatmulPreference creates a matrix multiply heuristic search preferences descriptor by allocating the memory needed to hold its opaque structure.

  • pref: Pointer to the structure holding the matrix multiply preferences descriptor created by this function. See MatrixLayout

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtMatmulPreferenceCreate.

func (MatmulPreference) Attribute

func (m MatmulPreference) Attribute(attr MatmulPreferenceAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

Attribute returns the value of the queried attribute belonging to a previously created matrix multiply heuristic search preferences descriptor.

  • attr: The attribute that will be queried by this function. See MatmulPreferenceAttributes
  • buf: Memory address containing the attribute value retrieved by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatmulPreferenceGetAttribute.

func (*MatmulPreference) Close

func (m *MatmulPreference) Close() error

Close destroys a previously created matrix multiply preferences descriptor object.

A nil error means the operation was successful.

If m is zero, Close returns nil. Otherwise Close sets m to zero when the call succeeds and leaves it unchanged when it fails. Only m is zeroed: a copy of it still refers to the released object.

Wraps cublasLtMatmulPreferenceDestroy.

func (MatmulPreference) Init_internal

func (m MatmulPreference) Init_internal(size uint) error

Init_internal wraps cublasLtMatmulPreferenceInit_internal.

func (MatmulPreference) SetAttribute

func (m MatmulPreference) SetAttribute(attr MatmulPreferenceAttributes, buf unsafe.Pointer, sizeInBytes uint) error

SetAttribute sets the value of the specified attribute belonging to a previously created matrix multiply preferences descriptor.

  • attr: The attribute that will be set by this function. See MatmulPreferenceAttributes
  • buf: The value to which the specified attribute should be set
  • sizeInBytes: Size of buf buffer (in bytes) for verification

A nil error means the attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes doesn’t match the size of the internal storage for the selected attribute.

Wraps cublasLtMatmulPreferenceSetAttribute.

type MatmulPreferenceAttributes

type MatmulPreferenceAttributes int32

MatmulPreferenceAttributes represents algo search preference to fine tune the heuristic function.

const (
	MatmulPrefSearchMode                 MatmulPreferenceAttributes = 0
	MatmulPrefMaxWorkspaceBytes          MatmulPreferenceAttributes = 1
	MatmulPrefReductionSchemeMask        MatmulPreferenceAttributes = 3
	MatmulPrefMinAlignmentABytes         MatmulPreferenceAttributes = 5
	MatmulPrefMinAlignmentBBytes         MatmulPreferenceAttributes = 6
	MatmulPrefMinAlignmentCBytes         MatmulPreferenceAttributes = 7
	MatmulPrefMinAlignmentDBytes         MatmulPreferenceAttributes = 8
	MatmulPrefMaxWavesCount              MatmulPreferenceAttributes = 9
	MatmulPrefImplMask                   MatmulPreferenceAttributes = 12
	MatmulPrefGroupedAverageReductionDim MatmulPreferenceAttributes = 13
	MatmulPrefGroupedDescDAverageRows    MatmulPreferenceAttributes = 14
	MatmulPrefGroupedDescDAverageCols    MatmulPreferenceAttributes = 15
)

func (MatmulPreferenceAttributes) String

String returns the constant name, or a numeric representation for unknown values.

type MatmulPreferenceOpaque

type MatmulPreferenceOpaque struct {
	Data [12]uint64
}

MatmulPreferenceOpaque represents semi-opaque descriptor for cublasLtMatmulPreference() operation details.

type MatmulSearch

type MatmulSearch int32

MatmulSearch represents matmul heuristic search mode.

const (
	SearchBestFit         MatmulSearch = 0
	SearchLimitedByAlgoId MatmulSearch = 1
	SearchReserved02      MatmulSearch = 2
	SearchReserved03      MatmulSearch = 3
	SearchReserved04      MatmulSearch = 4
	SearchReserved05      MatmulSearch = 5
	SearchReserved06      MatmulSearch = 6
	SearchReserved07      MatmulSearch = 7
	SearchReserved08      MatmulSearch = 8
	SearchReserved09      MatmulSearch = 9
)

func (MatmulSearch) String

func (e MatmulSearch) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulStages

type MatmulStages int32

MatmulStages represents size and number of stages in which elements are read into shared memory.

General order of stages IDs is sorted by stage size first and by number of stages second.

const (
	MatmulStagesUndefined MatmulStages = 0
	MatmulStages16x1      MatmulStages = 1
	MatmulStages16x2      MatmulStages = 2
	MatmulStages16x3      MatmulStages = 3
	MatmulStages16x4      MatmulStages = 4
	MatmulStages16x5      MatmulStages = 5
	MatmulStages16x6      MatmulStages = 6
	MatmulStages32x1      MatmulStages = 7
	MatmulStages32x2      MatmulStages = 8
	MatmulStages32x3      MatmulStages = 9
	MatmulStages32x4      MatmulStages = 10
	MatmulStages32x5      MatmulStages = 11
	MatmulStages32x6      MatmulStages = 12
	MatmulStages64x1      MatmulStages = 13
	MatmulStages64x2      MatmulStages = 14
	MatmulStages64x3      MatmulStages = 15
	MatmulStages64x4      MatmulStages = 16
	MatmulStages64x5      MatmulStages = 17
	MatmulStages64x6      MatmulStages = 18
	MatmulStages128x1     MatmulStages = 19
	MatmulStages128x2     MatmulStages = 20
	MatmulStages128x3     MatmulStages = 21
	MatmulStages128x4     MatmulStages = 22
	MatmulStages128x5     MatmulStages = 23
	MatmulStages128x6     MatmulStages = 24
	MatmulStages32x10     MatmulStages = 25
	MatmulStages8x4       MatmulStages = 26
	MatmulStages16x10     MatmulStages = 27
	MatmulStages8x5       MatmulStages = 28
	MatmulStages8x3       MatmulStages = 31
	MatmulStages8xauto    MatmulStages = 32
	MatmulStages16xauto   MatmulStages = 33
	MatmulStages32xauto   MatmulStages = 34
	MatmulStages64xauto   MatmulStages = 35
	MatmulStages128xauto  MatmulStages = 36
	MatmulStages256xauto  MatmulStages = 37
	MatmulStages768xauto  MatmulStages = 38
	MatmulStagesEnd       MatmulStages = 39
)

func (MatmulStages) String

func (e MatmulStages) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatmulTile

type MatmulTile int32

MatmulTile represents tile size (in C/D matrix Rows x Cols).

General order of tile IDs is sorted by size first and by first dimension second.

const (
	MatmulTileUndefined MatmulTile = 0
	MatmulTile8x8       MatmulTile = 1
	MatmulTile8x16      MatmulTile = 2
	MatmulTile16x8      MatmulTile = 3
	MatmulTile8x32      MatmulTile = 4
	MatmulTile16x16     MatmulTile = 5
	MatmulTile32x8      MatmulTile = 6
	MatmulTile8x64      MatmulTile = 7
	MatmulTile16x32     MatmulTile = 8
	MatmulTile32x16     MatmulTile = 9
	MatmulTile64x8      MatmulTile = 10
	MatmulTile32x32     MatmulTile = 11
	MatmulTile32x64     MatmulTile = 12
	MatmulTile64x32     MatmulTile = 13
	MatmulTile32x128    MatmulTile = 14
	MatmulTile64x64     MatmulTile = 15
	MatmulTile128x32    MatmulTile = 16
	MatmulTile64x128    MatmulTile = 17
	MatmulTile128x64    MatmulTile = 18
	MatmulTile64x256    MatmulTile = 19
	MatmulTile128x128   MatmulTile = 20
	MatmulTile256x64    MatmulTile = 21
	MatmulTile64x512    MatmulTile = 22
	MatmulTile128x256   MatmulTile = 23
	MatmulTile256x128   MatmulTile = 24
	MatmulTile512x64    MatmulTile = 25
	MatmulTile64x96     MatmulTile = 26
	MatmulTile96x64     MatmulTile = 27
	MatmulTile96x128    MatmulTile = 28
	MatmulTile128x160   MatmulTile = 29
	MatmulTile160x128   MatmulTile = 30
	MatmulTile192x128   MatmulTile = 31
	MatmulTile128x192   MatmulTile = 32
	MatmulTile128x96    MatmulTile = 33
	MatmulTile32x256    MatmulTile = 34
	MatmulTile256x32    MatmulTile = 35
	MatmulTile8x128     MatmulTile = 36
	MatmulTile8x192     MatmulTile = 37
	MatmulTile8x256     MatmulTile = 38
	MatmulTile8x320     MatmulTile = 39
	MatmulTile8x384     MatmulTile = 40
	MatmulTile8x448     MatmulTile = 41
	MatmulTile8x512     MatmulTile = 42
	MatmulTile8x576     MatmulTile = 43
	MatmulTile8x640     MatmulTile = 44
	MatmulTile8x704     MatmulTile = 45
	MatmulTile8x768     MatmulTile = 46
	MatmulTile16x64     MatmulTile = 47
	MatmulTile16x128    MatmulTile = 48
	MatmulTile16x192    MatmulTile = 49
	MatmulTile16x256    MatmulTile = 50
	MatmulTile16x320    MatmulTile = 51
	MatmulTile16x384    MatmulTile = 52
	MatmulTile16x448    MatmulTile = 53
	MatmulTile16x512    MatmulTile = 54
	MatmulTile16x576    MatmulTile = 55
	MatmulTile16x640    MatmulTile = 56
	MatmulTile16x704    MatmulTile = 57
	MatmulTile16x768    MatmulTile = 58
	MatmulTile24x64     MatmulTile = 59
	MatmulTile24x128    MatmulTile = 60
	MatmulTile24x192    MatmulTile = 61
	MatmulTile24x256    MatmulTile = 62
	MatmulTile24x320    MatmulTile = 63
	MatmulTile24x384    MatmulTile = 64
	MatmulTile24x448    MatmulTile = 65
	MatmulTile24x512    MatmulTile = 66
	MatmulTile24x576    MatmulTile = 67
	MatmulTile24x640    MatmulTile = 68
	MatmulTile24x704    MatmulTile = 69
	MatmulTile24x768    MatmulTile = 70
	MatmulTile32x192    MatmulTile = 71
	MatmulTile32x320    MatmulTile = 72
	MatmulTile32x384    MatmulTile = 73
	MatmulTile32x448    MatmulTile = 74
	MatmulTile32x512    MatmulTile = 75
	MatmulTile32x576    MatmulTile = 76
	MatmulTile32x640    MatmulTile = 77
	MatmulTile32x704    MatmulTile = 78
	MatmulTile32x768    MatmulTile = 79
	MatmulTile40x64     MatmulTile = 80
	MatmulTile40x128    MatmulTile = 81
	MatmulTile40x192    MatmulTile = 82
	MatmulTile40x256    MatmulTile = 83
	MatmulTile40x320    MatmulTile = 84
	MatmulTile40x384    MatmulTile = 85
	MatmulTile40x448    MatmulTile = 86
	MatmulTile40x512    MatmulTile = 87
	MatmulTile40x576    MatmulTile = 88
	MatmulTile40x640    MatmulTile = 89
	MatmulTile40x704    MatmulTile = 90
	MatmulTile40x768    MatmulTile = 91
	MatmulTile48x64     MatmulTile = 92
	MatmulTile48x128    MatmulTile = 93
	MatmulTile48x192    MatmulTile = 94
	MatmulTile48x256    MatmulTile = 95
	MatmulTile48x320    MatmulTile = 96
	MatmulTile48x384    MatmulTile = 97
	MatmulTile48x448    MatmulTile = 98
	MatmulTile48x512    MatmulTile = 99
	MatmulTile48x576    MatmulTile = 100
	MatmulTile48x640    MatmulTile = 101
	MatmulTile48x704    MatmulTile = 102
	MatmulTile48x768    MatmulTile = 103
	MatmulTile56x64     MatmulTile = 104
	MatmulTile56x128    MatmulTile = 105
	MatmulTile56x192    MatmulTile = 106
	MatmulTile56x256    MatmulTile = 107
	MatmulTile56x320    MatmulTile = 108
	MatmulTile56x384    MatmulTile = 109
	MatmulTile56x448    MatmulTile = 110
	MatmulTile56x512    MatmulTile = 111
	MatmulTile56x576    MatmulTile = 112
	MatmulTile56x640    MatmulTile = 113
	MatmulTile56x704    MatmulTile = 114
	MatmulTile56x768    MatmulTile = 115
	MatmulTile64x192    MatmulTile = 116
	MatmulTile64x320    MatmulTile = 117
	MatmulTile64x384    MatmulTile = 118
	MatmulTile64x448    MatmulTile = 119
	MatmulTile64x576    MatmulTile = 120
	MatmulTile64x640    MatmulTile = 121
	MatmulTile64x704    MatmulTile = 122
	MatmulTile64x768    MatmulTile = 123
	MatmulTile72x64     MatmulTile = 124
	MatmulTile72x128    MatmulTile = 125
	MatmulTile72x192    MatmulTile = 126
	MatmulTile72x256    MatmulTile = 127
	MatmulTile72x320    MatmulTile = 128
	MatmulTile72x384    MatmulTile = 129
	MatmulTile72x448    MatmulTile = 130
	MatmulTile72x512    MatmulTile = 131
	MatmulTile72x576    MatmulTile = 132
	MatmulTile72x640    MatmulTile = 133
	MatmulTile80x64     MatmulTile = 134
	MatmulTile80x128    MatmulTile = 135
	MatmulTile80x192    MatmulTile = 136
	MatmulTile80x256    MatmulTile = 137
	MatmulTile80x320    MatmulTile = 138
	MatmulTile80x384    MatmulTile = 139
	MatmulTile80x448    MatmulTile = 140
	MatmulTile80x512    MatmulTile = 141
	MatmulTile80x576    MatmulTile = 142
	MatmulTile88x64     MatmulTile = 143
	MatmulTile88x128    MatmulTile = 144
	MatmulTile88x192    MatmulTile = 145
	MatmulTile88x256    MatmulTile = 146
	MatmulTile88x320    MatmulTile = 147
	MatmulTile88x384    MatmulTile = 148
	MatmulTile88x448    MatmulTile = 149
	MatmulTile88x512    MatmulTile = 150
	MatmulTile96x192    MatmulTile = 151
	MatmulTile96x256    MatmulTile = 152
	MatmulTile96x320    MatmulTile = 153
	MatmulTile96x384    MatmulTile = 154
	MatmulTile96x448    MatmulTile = 155
	MatmulTile96x512    MatmulTile = 156
	MatmulTile104x64    MatmulTile = 157
	MatmulTile104x128   MatmulTile = 158
	MatmulTile104x192   MatmulTile = 159
	MatmulTile104x256   MatmulTile = 160
	MatmulTile104x320   MatmulTile = 161
	MatmulTile104x384   MatmulTile = 162
	MatmulTile104x448   MatmulTile = 163
	MatmulTile112x64    MatmulTile = 164
	MatmulTile112x128   MatmulTile = 165
	MatmulTile112x192   MatmulTile = 166
	MatmulTile112x256   MatmulTile = 167
	MatmulTile112x320   MatmulTile = 168
	MatmulTile112x384   MatmulTile = 169
	MatmulTile120x64    MatmulTile = 170
	MatmulTile120x128   MatmulTile = 171
	MatmulTile120x192   MatmulTile = 172
	MatmulTile120x256   MatmulTile = 173
	MatmulTile120x320   MatmulTile = 174
	MatmulTile120x384   MatmulTile = 175
	MatmulTile128x320   MatmulTile = 176
	MatmulTile128x384   MatmulTile = 177
	MatmulTile136x64    MatmulTile = 178
	MatmulTile136x128   MatmulTile = 179
	MatmulTile136x192   MatmulTile = 180
	MatmulTile136x256   MatmulTile = 181
	MatmulTile136x320   MatmulTile = 182
	MatmulTile144x64    MatmulTile = 183
	MatmulTile144x128   MatmulTile = 184
	MatmulTile144x192   MatmulTile = 185
	MatmulTile144x256   MatmulTile = 186
	MatmulTile144x320   MatmulTile = 187
	MatmulTile152x64    MatmulTile = 188
	MatmulTile152x128   MatmulTile = 189
	MatmulTile152x192   MatmulTile = 190
	MatmulTile152x256   MatmulTile = 191
	MatmulTile152x320   MatmulTile = 192
	MatmulTile160x64    MatmulTile = 193
	MatmulTile160x192   MatmulTile = 194
	MatmulTile160x256   MatmulTile = 195
	MatmulTile168x64    MatmulTile = 196
	MatmulTile168x128   MatmulTile = 197
	MatmulTile168x192   MatmulTile = 198
	MatmulTile168x256   MatmulTile = 199
	MatmulTile176x64    MatmulTile = 200
	MatmulTile176x128   MatmulTile = 201
	MatmulTile176x192   MatmulTile = 202
	MatmulTile176x256   MatmulTile = 203
	MatmulTile184x64    MatmulTile = 204
	MatmulTile184x128   MatmulTile = 205
	MatmulTile184x192   MatmulTile = 206
	MatmulTile184x256   MatmulTile = 207
	MatmulTile192x64    MatmulTile = 208
	MatmulTile192x192   MatmulTile = 209
	MatmulTile192x256   MatmulTile = 210
	MatmulTile200x64    MatmulTile = 211
	MatmulTile200x128   MatmulTile = 212
	MatmulTile200x192   MatmulTile = 213
	MatmulTile208x64    MatmulTile = 214
	MatmulTile208x128   MatmulTile = 215
	MatmulTile208x192   MatmulTile = 216
	MatmulTile216x64    MatmulTile = 217
	MatmulTile216x128   MatmulTile = 218
	MatmulTile216x192   MatmulTile = 219
	MatmulTile224x64    MatmulTile = 220
	MatmulTile224x128   MatmulTile = 221
	MatmulTile224x192   MatmulTile = 222
	MatmulTile232x64    MatmulTile = 223
	MatmulTile232x128   MatmulTile = 224
	MatmulTile232x192   MatmulTile = 225
	MatmulTile240x64    MatmulTile = 226
	MatmulTile240x128   MatmulTile = 227
	MatmulTile240x192   MatmulTile = 228
	MatmulTile248x64    MatmulTile = 229
	MatmulTile248x128   MatmulTile = 230
	MatmulTile248x192   MatmulTile = 231
	MatmulTile256x192   MatmulTile = 232
	MatmulTile264x64    MatmulTile = 233
	MatmulTile264x128   MatmulTile = 234
	MatmulTile272x64    MatmulTile = 235
	MatmulTile272x128   MatmulTile = 236
	MatmulTile280x64    MatmulTile = 237
	MatmulTile280x128   MatmulTile = 238
	MatmulTile288x64    MatmulTile = 239
	MatmulTile288x128   MatmulTile = 240
	MatmulTile296x64    MatmulTile = 241
	MatmulTile296x128   MatmulTile = 242
	MatmulTile304x64    MatmulTile = 243
	MatmulTile304x128   MatmulTile = 244
	MatmulTile312x64    MatmulTile = 245
	MatmulTile312x128   MatmulTile = 246
	MatmulTile320x64    MatmulTile = 247
	MatmulTile320x128   MatmulTile = 248
	MatmulTile328x64    MatmulTile = 249
	MatmulTile328x128   MatmulTile = 250
	MatmulTile336x64    MatmulTile = 251
	MatmulTile336x128   MatmulTile = 252
	MatmulTile344x64    MatmulTile = 253
	MatmulTile344x128   MatmulTile = 254
	MatmulTile352x64    MatmulTile = 255
	MatmulTile352x128   MatmulTile = 256
	MatmulTile360x64    MatmulTile = 257
	MatmulTile360x128   MatmulTile = 258
	MatmulTile368x64    MatmulTile = 259
	MatmulTile368x128   MatmulTile = 260
	MatmulTile376x64    MatmulTile = 261
	MatmulTile376x128   MatmulTile = 262
	MatmulTile384x64    MatmulTile = 263
	MatmulTile384x128   MatmulTile = 264
	MatmulTile392x64    MatmulTile = 265
	MatmulTile400x64    MatmulTile = 266
	MatmulTile408x64    MatmulTile = 267
	MatmulTile416x64    MatmulTile = 268
	MatmulTile424x64    MatmulTile = 269
	MatmulTile432x64    MatmulTile = 270
	MatmulTile440x64    MatmulTile = 271
	MatmulTile448x64    MatmulTile = 272
	MatmulTile456x64    MatmulTile = 273
	MatmulTile464x64    MatmulTile = 274
	MatmulTile472x64    MatmulTile = 275
	MatmulTile480x64    MatmulTile = 276
	MatmulTile488x64    MatmulTile = 277
	MatmulTile496x64    MatmulTile = 278
	MatmulTile504x64    MatmulTile = 279
	MatmulTile520x64    MatmulTile = 280
	MatmulTile528x64    MatmulTile = 281
	MatmulTile536x64    MatmulTile = 282
	MatmulTile544x64    MatmulTile = 283
	MatmulTile552x64    MatmulTile = 284
	MatmulTile560x64    MatmulTile = 285
	MatmulTile568x64    MatmulTile = 286
	MatmulTile576x64    MatmulTile = 287
	MatmulTile584x64    MatmulTile = 288
	MatmulTile592x64    MatmulTile = 289
	MatmulTile600x64    MatmulTile = 290
	MatmulTile608x64    MatmulTile = 291
	MatmulTile616x64    MatmulTile = 292
	MatmulTile624x64    MatmulTile = 293
	MatmulTile632x64    MatmulTile = 294
	MatmulTile640x64    MatmulTile = 295
	MatmulTile648x64    MatmulTile = 296
	MatmulTile656x64    MatmulTile = 297
	MatmulTile664x64    MatmulTile = 298
	MatmulTile672x64    MatmulTile = 299
	MatmulTile680x64    MatmulTile = 300
	MatmulTile688x64    MatmulTile = 301
	MatmulTile696x64    MatmulTile = 302
	MatmulTile704x64    MatmulTile = 303
	MatmulTile712x64    MatmulTile = 304
	MatmulTile720x64    MatmulTile = 305
	MatmulTile728x64    MatmulTile = 306
	MatmulTile736x64    MatmulTile = 307
	MatmulTile744x64    MatmulTile = 308
	MatmulTile752x64    MatmulTile = 309
	MatmulTile760x64    MatmulTile = 310
	MatmulTile768x64    MatmulTile = 311
	MatmulTile64x16     MatmulTile = 312
	MatmulTile64x24     MatmulTile = 313
	MatmulTile64x40     MatmulTile = 314
	MatmulTile64x48     MatmulTile = 315
	MatmulTile64x56     MatmulTile = 316
	MatmulTile64x72     MatmulTile = 317
	MatmulTile64x80     MatmulTile = 318
	MatmulTile64x88     MatmulTile = 319
	MatmulTile64x104    MatmulTile = 320
	MatmulTile64x112    MatmulTile = 321
	MatmulTile64x120    MatmulTile = 322
	MatmulTile64x136    MatmulTile = 323
	MatmulTile64x144    MatmulTile = 324
	MatmulTile64x152    MatmulTile = 325
	MatmulTile64x160    MatmulTile = 326
	MatmulTile64x168    MatmulTile = 327
	MatmulTile64x176    MatmulTile = 328
	MatmulTile64x184    MatmulTile = 329
	MatmulTile64x200    MatmulTile = 330
	MatmulTile64x208    MatmulTile = 331
	MatmulTile64x216    MatmulTile = 332
	MatmulTile64x224    MatmulTile = 333
	MatmulTile64x232    MatmulTile = 334
	MatmulTile64x240    MatmulTile = 335
	MatmulTile64x248    MatmulTile = 336
	MatmulTile64x264    MatmulTile = 337
	MatmulTile64x272    MatmulTile = 338
	MatmulTile64x280    MatmulTile = 339
	MatmulTile64x288    MatmulTile = 340
	MatmulTile64x296    MatmulTile = 341
	MatmulTile64x304    MatmulTile = 342
	MatmulTile64x312    MatmulTile = 343
	MatmulTile64x328    MatmulTile = 344
	MatmulTile64x336    MatmulTile = 345
	MatmulTile64x344    MatmulTile = 346
	MatmulTile64x352    MatmulTile = 347
	MatmulTile64x360    MatmulTile = 348
	MatmulTile64x368    MatmulTile = 349
	MatmulTile64x376    MatmulTile = 350
	MatmulTile64x392    MatmulTile = 351
	MatmulTile64x400    MatmulTile = 352
	MatmulTile64x408    MatmulTile = 353
	MatmulTile64x416    MatmulTile = 354
	MatmulTile64x424    MatmulTile = 355
	MatmulTile64x432    MatmulTile = 356
	MatmulTile64x440    MatmulTile = 357
	MatmulTile64x456    MatmulTile = 358
	MatmulTile64x464    MatmulTile = 359
	MatmulTile64x472    MatmulTile = 360
	MatmulTile64x480    MatmulTile = 361
	MatmulTile64x488    MatmulTile = 362
	MatmulTile64x496    MatmulTile = 363
	MatmulTile64x504    MatmulTile = 364
	MatmulTile64x520    MatmulTile = 365
	MatmulTile64x528    MatmulTile = 366
	MatmulTile64x536    MatmulTile = 367
	MatmulTile64x544    MatmulTile = 368
	MatmulTile64x552    MatmulTile = 369
	MatmulTile64x560    MatmulTile = 370
	MatmulTile64x568    MatmulTile = 371
	MatmulTile64x584    MatmulTile = 372
	MatmulTile64x592    MatmulTile = 373
	MatmulTile64x600    MatmulTile = 374
	MatmulTile64x608    MatmulTile = 375
	MatmulTile64x616    MatmulTile = 376
	MatmulTile64x624    MatmulTile = 377
	MatmulTile64x632    MatmulTile = 378
	MatmulTile64x648    MatmulTile = 379
	MatmulTile64x656    MatmulTile = 380
	MatmulTile64x664    MatmulTile = 381
	MatmulTile64x672    MatmulTile = 382
	MatmulTile64x680    MatmulTile = 383
	MatmulTile64x688    MatmulTile = 384
	MatmulTile64x696    MatmulTile = 385
	MatmulTile64x712    MatmulTile = 386
	MatmulTile64x720    MatmulTile = 387
	MatmulTile64x728    MatmulTile = 388
	MatmulTile64x736    MatmulTile = 389
	MatmulTile64x744    MatmulTile = 390
	MatmulTile64x752    MatmulTile = 391
	MatmulTile64x760    MatmulTile = 392
	MatmulTile128x8     MatmulTile = 393
	MatmulTile128x16    MatmulTile = 394
	MatmulTile128x24    MatmulTile = 395
	MatmulTile128x40    MatmulTile = 396
	MatmulTile128x48    MatmulTile = 397
	MatmulTile128x56    MatmulTile = 398
	MatmulTile128x72    MatmulTile = 399
	MatmulTile128x80    MatmulTile = 400
	MatmulTile128x88    MatmulTile = 401
	MatmulTile128x104   MatmulTile = 402
	MatmulTile128x112   MatmulTile = 403
	MatmulTile128x120   MatmulTile = 404
	MatmulTile128x136   MatmulTile = 405
	MatmulTile128x144   MatmulTile = 406
	MatmulTile128x152   MatmulTile = 407
	MatmulTile128x168   MatmulTile = 408
	MatmulTile128x176   MatmulTile = 409
	MatmulTile128x184   MatmulTile = 410
	MatmulTile128x200   MatmulTile = 411
	MatmulTile128x208   MatmulTile = 412
	MatmulTile128x216   MatmulTile = 413
	MatmulTile128x224   MatmulTile = 414
	MatmulTile128x232   MatmulTile = 415
	MatmulTile128x240   MatmulTile = 416
	MatmulTile128x248   MatmulTile = 417
	MatmulTile128x264   MatmulTile = 418
	MatmulTile128x272   MatmulTile = 419
	MatmulTile128x280   MatmulTile = 420
	MatmulTile128x288   MatmulTile = 421
	MatmulTile128x296   MatmulTile = 422
	MatmulTile128x304   MatmulTile = 423
	MatmulTile128x312   MatmulTile = 424
	MatmulTile128x328   MatmulTile = 425
	MatmulTile128x336   MatmulTile = 426
	MatmulTile128x344   MatmulTile = 427
	MatmulTile128x352   MatmulTile = 428
	MatmulTile128x360   MatmulTile = 429
	MatmulTile128x368   MatmulTile = 430
	MatmulTile128x376   MatmulTile = 431
	MatmulTile128x392   MatmulTile = 432
	MatmulTile128x400   MatmulTile = 433
	MatmulTile128x408   MatmulTile = 434
	MatmulTile128x416   MatmulTile = 435
	MatmulTile128x424   MatmulTile = 436
	MatmulTile128x432   MatmulTile = 437
	MatmulTile128x440   MatmulTile = 438
	MatmulTile128x448   MatmulTile = 439
	MatmulTile128x456   MatmulTile = 440
	MatmulTile128x464   MatmulTile = 441
	MatmulTile128x472   MatmulTile = 442
	MatmulTile128x480   MatmulTile = 443
	MatmulTile128x488   MatmulTile = 444
	MatmulTile128x496   MatmulTile = 445
	MatmulTile128x504   MatmulTile = 446
	MatmulTile128x512   MatmulTile = 447
	MatmulTile192x8     MatmulTile = 448
	MatmulTile192x16    MatmulTile = 449
	MatmulTile192x24    MatmulTile = 450
	MatmulTile192x32    MatmulTile = 451
	MatmulTile192x40    MatmulTile = 452
	MatmulTile192x48    MatmulTile = 453
	MatmulTile192x56    MatmulTile = 454
	MatmulTile192x72    MatmulTile = 455
	MatmulTile192x80    MatmulTile = 456
	MatmulTile192x88    MatmulTile = 457
	MatmulTile192x96    MatmulTile = 458
	MatmulTile192x104   MatmulTile = 459
	MatmulTile192x112   MatmulTile = 460
	MatmulTile192x120   MatmulTile = 461
	MatmulTile192x136   MatmulTile = 462
	MatmulTile192x144   MatmulTile = 463
	MatmulTile192x152   MatmulTile = 464
	MatmulTile192x160   MatmulTile = 465
	MatmulTile192x168   MatmulTile = 466
	MatmulTile192x176   MatmulTile = 467
	MatmulTile192x184   MatmulTile = 468
	MatmulTile192x200   MatmulTile = 469
	MatmulTile192x208   MatmulTile = 470
	MatmulTile192x216   MatmulTile = 471
	MatmulTile192x224   MatmulTile = 472
	MatmulTile192x232   MatmulTile = 473
	MatmulTile192x240   MatmulTile = 474
	MatmulTile192x248   MatmulTile = 475
	MatmulTile192x264   MatmulTile = 476
	MatmulTile192x272   MatmulTile = 477
	MatmulTile192x280   MatmulTile = 478
	MatmulTile192x288   MatmulTile = 479
	MatmulTile192x296   MatmulTile = 480
	MatmulTile192x304   MatmulTile = 481
	MatmulTile192x312   MatmulTile = 482
	MatmulTile192x320   MatmulTile = 483
	MatmulTile192x328   MatmulTile = 484
	MatmulTile192x336   MatmulTile = 485
	MatmulTile256x8     MatmulTile = 486
	MatmulTile256x16    MatmulTile = 487
	MatmulTile256x24    MatmulTile = 488
	MatmulTile256x40    MatmulTile = 489
	MatmulTile256x48    MatmulTile = 490
	MatmulTile256x56    MatmulTile = 491
	MatmulTile256x72    MatmulTile = 492
	MatmulTile256x80    MatmulTile = 493
	MatmulTile256x88    MatmulTile = 494
	MatmulTile256x96    MatmulTile = 495
	MatmulTile256x104   MatmulTile = 496
	MatmulTile256x112   MatmulTile = 497
	MatmulTile256x120   MatmulTile = 498
	MatmulTile256x136   MatmulTile = 499
	MatmulTile256x144   MatmulTile = 500
	MatmulTile256x152   MatmulTile = 501
	MatmulTile256x160   MatmulTile = 502
	MatmulTile256x168   MatmulTile = 503
	MatmulTile256x176   MatmulTile = 504
	MatmulTile256x184   MatmulTile = 505
	MatmulTile256x200   MatmulTile = 506
	MatmulTile256x208   MatmulTile = 507
	MatmulTile256x216   MatmulTile = 508
	MatmulTile256x224   MatmulTile = 509
	MatmulTile256x232   MatmulTile = 510
	MatmulTile256x240   MatmulTile = 511
	MatmulTile256x248   MatmulTile = 512
	MatmulTile256x256   MatmulTile = 513
	MatmulTile320x8     MatmulTile = 514
	MatmulTile320x16    MatmulTile = 515
	MatmulTile320x24    MatmulTile = 516
	MatmulTile320x32    MatmulTile = 517
	MatmulTile320x40    MatmulTile = 518
	MatmulTile320x48    MatmulTile = 519
	MatmulTile320x56    MatmulTile = 520
	MatmulTile320x72    MatmulTile = 521
	MatmulTile320x80    MatmulTile = 522
	MatmulTile320x88    MatmulTile = 523
	MatmulTile320x96    MatmulTile = 524
	MatmulTile320x104   MatmulTile = 525
	MatmulTile320x112   MatmulTile = 526
	MatmulTile320x120   MatmulTile = 527
	MatmulTile320x136   MatmulTile = 528
	MatmulTile320x144   MatmulTile = 529
	MatmulTile320x152   MatmulTile = 530
	MatmulTile320x160   MatmulTile = 531
	MatmulTile320x168   MatmulTile = 532
	MatmulTile320x176   MatmulTile = 533
	MatmulTile320x184   MatmulTile = 534
	MatmulTile320x192   MatmulTile = 535
	MatmulTile320x200   MatmulTile = 536
	MatmulTile384x8     MatmulTile = 537
	MatmulTile384x16    MatmulTile = 538
	MatmulTile384x24    MatmulTile = 539
	MatmulTile384x32    MatmulTile = 540
	MatmulTile384x40    MatmulTile = 541
	MatmulTile384x48    MatmulTile = 542
	MatmulTile384x56    MatmulTile = 543
	MatmulTile384x72    MatmulTile = 544
	MatmulTile384x80    MatmulTile = 545
	MatmulTile384x88    MatmulTile = 546
	MatmulTile384x96    MatmulTile = 547
	MatmulTile384x104   MatmulTile = 548
	MatmulTile384x112   MatmulTile = 549
	MatmulTile384x120   MatmulTile = 550
	MatmulTile384x136   MatmulTile = 551
	MatmulTile384x144   MatmulTile = 552
	MatmulTile384x152   MatmulTile = 553
	MatmulTile384x160   MatmulTile = 554
	MatmulTile384x168   MatmulTile = 555
	MatmulTile448x8     MatmulTile = 556
	MatmulTile448x16    MatmulTile = 557
	MatmulTile448x24    MatmulTile = 558
	MatmulTile448x32    MatmulTile = 559
	MatmulTile448x40    MatmulTile = 560
	MatmulTile448x48    MatmulTile = 561
	MatmulTile448x56    MatmulTile = 562
	MatmulTile448x72    MatmulTile = 563
	MatmulTile448x80    MatmulTile = 564
	MatmulTile448x88    MatmulTile = 565
	MatmulTile448x96    MatmulTile = 566
	MatmulTile448x104   MatmulTile = 567
	MatmulTile448x112   MatmulTile = 568
	MatmulTile448x120   MatmulTile = 569
	MatmulTile448x128   MatmulTile = 570
	MatmulTile448x136   MatmulTile = 571
	MatmulTile448x144   MatmulTile = 572
	MatmulTile512x8     MatmulTile = 573
	MatmulTile512x16    MatmulTile = 574
	MatmulTile512x24    MatmulTile = 575
	MatmulTile512x32    MatmulTile = 576
	MatmulTile512x40    MatmulTile = 577
	MatmulTile512x48    MatmulTile = 578
	MatmulTile512x56    MatmulTile = 579
	MatmulTile512x72    MatmulTile = 580
	MatmulTile512x80    MatmulTile = 581
	MatmulTile512x88    MatmulTile = 582
	MatmulTile512x96    MatmulTile = 583
	MatmulTile512x104   MatmulTile = 584
	MatmulTile512x112   MatmulTile = 585
	MatmulTile512x120   MatmulTile = 586
	MatmulTile512x128   MatmulTile = 587
	MatmulTile576x8     MatmulTile = 588
	MatmulTile576x16    MatmulTile = 589
	MatmulTile576x24    MatmulTile = 590
	MatmulTile576x32    MatmulTile = 591
	MatmulTile576x40    MatmulTile = 592
	MatmulTile576x48    MatmulTile = 593
	MatmulTile576x56    MatmulTile = 594
	MatmulTile576x72    MatmulTile = 595
	MatmulTile576x80    MatmulTile = 596
	MatmulTile576x88    MatmulTile = 597
	MatmulTile576x96    MatmulTile = 598
	MatmulTile576x104   MatmulTile = 599
	MatmulTile576x112   MatmulTile = 600
	MatmulTile640x8     MatmulTile = 601
	MatmulTile640x16    MatmulTile = 602
	MatmulTile640x24    MatmulTile = 603
	MatmulTile640x32    MatmulTile = 604
	MatmulTile640x40    MatmulTile = 605
	MatmulTile640x48    MatmulTile = 606
	MatmulTile640x56    MatmulTile = 607
	MatmulTile640x72    MatmulTile = 608
	MatmulTile640x80    MatmulTile = 609
	MatmulTile640x88    MatmulTile = 610
	MatmulTile640x96    MatmulTile = 611
	MatmulTile704x8     MatmulTile = 612
	MatmulTile704x16    MatmulTile = 613
	MatmulTile704x24    MatmulTile = 614
	MatmulTile704x32    MatmulTile = 615
	MatmulTile704x40    MatmulTile = 616
	MatmulTile704x48    MatmulTile = 617
	MatmulTile704x56    MatmulTile = 618
	MatmulTile704x72    MatmulTile = 619
	MatmulTile704x80    MatmulTile = 620
	MatmulTile704x88    MatmulTile = 621
	MatmulTile768x8     MatmulTile = 622
	MatmulTile768x16    MatmulTile = 623
	MatmulTile768x24    MatmulTile = 624
	MatmulTile768x32    MatmulTile = 625
	MatmulTile768x40    MatmulTile = 626
	MatmulTile768x48    MatmulTile = 627
	MatmulTile768x56    MatmulTile = 628
	MatmulTile768x72    MatmulTile = 629
	MatmulTile768x80    MatmulTile = 630
	MatmulTile256x512   MatmulTile = 631
	MatmulTile256x1024  MatmulTile = 632
	MatmulTile512x512   MatmulTile = 633
	MatmulTile512x1024  MatmulTile = 634
	MatmulTile4x1       MatmulTile = 635
	MatmulTile8x1       MatmulTile = 636
	MatmulTile16x1      MatmulTile = 637
	MatmulTile24x1      MatmulTile = 638
	MatmulTile32x1      MatmulTile = 639
	MatmulTile40x1      MatmulTile = 640
	MatmulTile48x1      MatmulTile = 641
	MatmulTile64x1      MatmulTile = 642
	MatmulTile128x1     MatmulTile = 643
	MatmulTile192x1     MatmulTile = 644
	MatmulTile256x1     MatmulTile = 645
	MatmulTileEnd       MatmulTile = 646
)

func (MatmulTile) String

func (e MatmulTile) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatrixLayout

type MatrixLayout uintptr

MatrixLayout is an opaque handle for cublasLtMatrixLayout_t.

func GroupedMatrixLayoutCreate

func GroupedMatrixLayoutCreate(type_ DataType, groupCount int32, rowsArray uintptr, colsArray uintptr, ldArray uintptr) (MatrixLayout, error)

GroupedMatrixLayoutCreate creates a grouped matrix layout descriptor by allocating the memory needed to hold its opaque structure.

This function is experimental.

  • matLayout: Pointer to the structure holding the matrix layout descriptor created by this function. See MatrixLayout
  • type_: Enumerant that specifies the data precision for the matrix layout descriptor this function creates. See cudaDataType_t
  • groupCount: Number of groups in the grouped matrix layout descriptor
  • rowsArray: Pointer to a device array of rows of the grouped matrix layout descriptor
  • colsArray: Pointer to a device array of columns of the grouped matrix layout descriptor
  • ldArray: Pointer to a device array of leading dimensions of the grouped matrix layout descriptor

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtGroupedMatrixLayoutCreate.

func NewMatrixLayout

func NewMatrixLayout(type_ DataType, rows uint64, cols uint64, ld int64) (MatrixLayout, error)

NewMatrixLayout creates a matrix layout descriptor by allocating the memory needed to hold its opaque structure.

  • matLayout: Pointer to the structure holding the matrix layout descriptor created by this function. See MatrixLayout
  • type_: Enumerant that specifies the data precision for the matrix layout descriptor this function creates. See cudaDataType_t
  • rows: Number of rows and columns of the matrix
  • cols: Number of rows and columns of the matrix
  • ld: The leading dimension of the matrix. In column major layout, this is the number of elements to jump to reach the next column. Thus ld >= m (number of rows)

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtMatrixLayoutCreate.

func (MatrixLayout) Attribute

func (m MatrixLayout) Attribute(attr MatrixLayoutAttribute, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

Attribute returns the value of the queried attribute belonging to the specified matrix layout descriptor.

  • attr: The attribute being queried for. See MatrixLayoutAttribute
  • buf: The attribute value returned by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatrixLayoutGetAttribute.

func (*MatrixLayout) Close

func (m *MatrixLayout) Close() error

Close destroys a previously created matrix layout descriptor object.

A nil error means the operation was successful.

If m is zero, Close returns nil. Otherwise Close sets m to zero when the call succeeds and leaves it unchanged when it fails. Only m is zeroed: a copy of it still refers to the released object.

Wraps cublasLtMatrixLayoutDestroy.

func (MatrixLayout) GroupedMatrixLayoutInit_internal

func (m MatrixLayout) GroupedMatrixLayoutInit_internal(size uint, type_ DataType, groupCount int32, rowsArray uintptr, colsArray uintptr, ldArray uintptr) error

GroupedMatrixLayoutInit_internal wraps cublasLtGroupedMatrixLayoutInit_internal.

func (MatrixLayout) Init_internal

func (m MatrixLayout) Init_internal(size uint, type_ DataType, rows uint64, cols uint64, ld int64) error

Init_internal wraps cublasLtMatrixLayoutInit_internal.

func (MatrixLayout) SetAttribute

func (m MatrixLayout) SetAttribute(attr MatrixLayoutAttribute, buf unsafe.Pointer, sizeInBytes uint) error

SetAttribute sets the value of the specified attribute belonging to a previously created matrix layout descriptor.

  • attr: The attribute that will be set by this function. See MatrixLayoutAttribute
  • buf: The value to which the specified attribute should be set
  • sizeInBytes: Size of buf, the attribute buffer

A nil error means attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes doesn’t match size of internal storage for the selected attribute.

Wraps cublasLtMatrixLayoutSetAttribute.

type MatrixLayoutAttribute

type MatrixLayoutAttribute int32

MatrixLayoutAttribute represents attributes of memory layout.

const (
	MatrixLayoutType                             MatrixLayoutAttribute = 0
	MatrixLayoutOrder                            MatrixLayoutAttribute = 1
	MatrixLayoutRows                             MatrixLayoutAttribute = 2
	MatrixLayoutCols                             MatrixLayoutAttribute = 3
	MatrixLayoutLd                               MatrixLayoutAttribute = 4
	MatrixLayoutBatchCount                       MatrixLayoutAttribute = 5
	MatrixLayoutStridedBatchOffset               MatrixLayoutAttribute = 6
	MatrixLayoutPlaneOffset                      MatrixLayoutAttribute = 7
	MatrixLayoutBatchMode                        MatrixLayoutAttribute = 8
	GroupedMatrixLayoutRowsArray                 MatrixLayoutAttribute = 9
	GroupedMatrixLayoutColsArray                 MatrixLayoutAttribute = 10
	GroupedMatrixLayoutLdArray                   MatrixLayoutAttribute = 11
	GroupedMatrixLayoutRowsColsArrayIntegerWidth MatrixLayoutAttribute = 12
	GroupedMatrixLayoutLdArrayIntegerWidth       MatrixLayoutAttribute = 13
)

func (MatrixLayoutAttribute) String

func (e MatrixLayoutAttribute) String() string

String returns the constant name, or a numeric representation for unknown values.

type MatrixLayoutOpaque

type MatrixLayoutOpaque struct {
	Data [14]uint64
}

MatrixLayoutOpaque represents semi-opaque descriptor for matrix memory layout.

type MatrixTransformDesc

type MatrixTransformDesc uintptr

MatrixTransformDesc is an opaque handle for cublasLtMatrixTransformDesc_t.

func NewMatrixTransformDesc

func NewMatrixTransformDesc(scaleType DataType) (MatrixTransformDesc, error)

NewMatrixTransformDesc creates a matrix transform descriptor by allocating the memory needed to hold its opaque structure.

  • transformDesc: Pointer to the structure holding the matrix transform descriptor created by this function. See MatrixTransformDesc
  • scaleType: Enumerant that specifies the data precision for the matrix transform descriptor this function creates. See cudaDataType_t

A nil error means the descriptor was created successfully.

Errors:

Wraps cublasLtMatrixTransformDescCreate.

func (MatrixTransformDesc) Attribute

func (m MatrixTransformDesc) Attribute(attr MatrixTransformDescAttributes, buf unsafe.Pointer, sizeInBytes uint) (uint, error)

Attribute returns the value of the queried attribute belonging to a previously created matrix transform descriptor.

  • attr: The attribute that will be retrieved by this function. See MatrixTransformDescAttributes
  • buf: Memory address containing the attribute value retrieved by this function
  • sizeInBytes: Size of buf buffer (in bytes) for verification
  • sizeWritten: Valid only when the return value is Success. If sizeInBytes is non-zero: then sizeWritten is the number of bytes actually written; if sizeInBytes is 0: then sizeWritten is the number of bytes needed to write full contents

A nil error means attribute’s value was successfully written to user memory.

Errors:

  • ErrInvalidValue: If sizeInBytes is zero and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL, or if sizeInBytes doesn’t match size of internal storage for the selected attribute

Wraps cublasLtMatrixTransformDescGetAttribute.

func (*MatrixTransformDesc) Close

func (m *MatrixTransformDesc) Close() error

Close destroys a previously created matrix transform descriptor object.

A nil error means the operation was successful.

If m is zero, Close returns nil. Otherwise Close sets m to zero when the call succeeds and leaves it unchanged when it fails. Only m is zeroed: a copy of it still refers to the released object.

Wraps cublasLtMatrixTransformDescDestroy.

func (MatrixTransformDesc) Init_internal

func (m MatrixTransformDesc) Init_internal(size uint, scaleType DataType) error

Init_internal wraps cublasLtMatrixTransformDescInit_internal.

func (MatrixTransformDesc) SetAttribute

func (m MatrixTransformDesc) SetAttribute(attr MatrixTransformDescAttributes, buf unsafe.Pointer, sizeInBytes uint) error

SetAttribute sets the value of the specified attribute belonging to a previously created matrix transform descriptor.

  • attr: The attribute that will be set by this function. See MatrixTransformDescAttributes
  • buf: The value to which the specified attribute should be set
  • sizeInBytes: Size of buf buffer (in bytes) for verification

A nil error means the attribute was set successfully.

Errors:

  • ErrInvalidValue: If buf is NULL or sizeInBytes does not match size of the internal storage for the selected attribute.

Wraps cublasLtMatrixTransformDescSetAttribute.

type MatrixTransformDescAttributes

type MatrixTransformDescAttributes int32

MatrixTransformDescAttributes represents matrix transform descriptor attributes to define details of the operation.

const (
	MatrixTransformDescScaleType   MatrixTransformDescAttributes = 0
	MatrixTransformDescPointerMode MatrixTransformDescAttributes = 1
	MatrixTransformDescTransa      MatrixTransformDescAttributes = 2
	MatrixTransformDescTransb      MatrixTransformDescAttributes = 3
)

func (MatrixTransformDescAttributes) String

String returns the constant name, or a numeric representation for unknown values.

type MatrixTransformDescOpaque

type MatrixTransformDescOpaque struct {
	Data [8]uint64
}

MatrixTransformDescOpaque represents semi-opaque descriptor for Handle.MatrixTransform operation details.

type NumericalImplFlags

type NumericalImplFlags uint64

NumericalImplFlags represents implementation details that may affect numerical behavior of algorithms.

const (
	NumericalImplFlagsFma                 NumericalImplFlags = 0x01 << 0
	NumericalImplFlagsHmma                NumericalImplFlags = 0x02 << 0
	NumericalImplFlagsImma                NumericalImplFlags = 0x04 << 0
	NumericalImplFlagsDmma                NumericalImplFlags = 0x08 << 0
	NumericalImplFlagsTensorOpMask        NumericalImplFlags = 0xfe << 0
	NumericalImplFlagsOpTypeMask          NumericalImplFlags = 0xff << 0
	NumericalImplFlagsAccumulator16F      NumericalImplFlags = 0x01 << 8
	NumericalImplFlagsAccumulator32F      NumericalImplFlags = 0x02 << 8
	NumericalImplFlagsAccumulator64F      NumericalImplFlags = 0x04 << 8
	NumericalImplFlagsAccumulator32I      NumericalImplFlags = 0x08 << 8
	NumericalImplFlagsAccumulatorTypeMask NumericalImplFlags = 0xff << 8
	NumericalImplFlagsInput16F            NumericalImplFlags = 0x01 << 16
	NumericalImplFlagsInput16BF           NumericalImplFlags = 0x02 << 16
	NumericalImplFlagsInputTF32           NumericalImplFlags = 0x04 << 16
	NumericalImplFlagsInput32F            NumericalImplFlags = 0x08 << 16
	NumericalImplFlagsInput64F            NumericalImplFlags = 0x10 << 16
	NumericalImplFlagsInput8I             NumericalImplFlags = 0x20 << 16
	NumericalImplFlagsInput8FE4M3         NumericalImplFlags = 0x40 << 16
	NumericalImplFlagsInput8FE5M2         NumericalImplFlags = 0x80 << 16
	NumericalImplFlagsOpInputTypeMask     NumericalImplFlags = 0xff << 16
	NumericalImplFlagsGaussian            NumericalImplFlags = 0x01 << 32
)

func (NumericalImplFlags) String

func (e NumericalImplFlags) String() string

String returns the constant name, or a numeric representation for unknown values.

type Order

type Order int32

Order is an enum for data ordering.

const (
	OrderCol        Order = 0
	OrderRow        Order = 1
	OrderCol32      Order = 2
	OrderCOL44R28C  Order = 3
	OrderCol322R4R4 Order = 4
)

func (Order) String

func (e Order) String() string

String returns the constant name, or a numeric representation for unknown values.

type PointerMode

type PointerMode int32

PointerMode represents pointer mode to use for alpha/beta.

const (
	PointerModeHost                      PointerMode = 0
	PointerModeDevice                    PointerMode = 1
	PointerModeDeviceVector              PointerMode = 2
	PointerModeAlphaDeviceVectorBetaZero PointerMode = 3
	PointerModeAlphaDeviceVectorBetaHost PointerMode = 4
)

func (PointerMode) String

func (e PointerMode) String() string

String returns the constant name, or a numeric representation for unknown values.

type PointerModeMask

type PointerModeMask int32

PointerModeMask represents mask to define pointer mode capability.

const (
	PointerModeMaskHost                      PointerModeMask = 1
	PointerModeMaskDevice                    PointerModeMask = 2
	PointerModeMaskDeviceVector              PointerModeMask = 4
	PointerModeMaskAlphaDeviceVectorBetaZero PointerModeMask = 8
	PointerModeMaskAlphaDeviceVectorBetaHost PointerModeMask = 16
)

func (PointerModeMask) String

func (e PointerModeMask) String() string

String returns the constant name, or a numeric representation for unknown values.

type ReductionScheme

type ReductionScheme int32

ReductionScheme represents reduction scheme for portions of the dot-product calculated in parallel (a. k. a. "split - K").

const (
	ReductionSchemeNone        ReductionScheme = 0
	ReductionSchemeInplace     ReductionScheme = 1
	ReductionSchemeComputeType ReductionScheme = 2
	ReductionSchemeOutputType  ReductionScheme = 4
	ReductionSchemeMask        ReductionScheme = 0x7
)

func (ReductionScheme) String

func (e ReductionScheme) String() string

String returns the constant name, or a numeric representation for unknown values.

type Result

type Result int32

Result represents a cublasLt API error code (cublasStatus_t).

When the library is loaded, Result.Error returns rich messages from GetStatusName and GetStatusString. When the library is not loaded, it falls back to the numeric error code and Go-defined name.

const (
	Success            Result = 0
	ErrNotInitialized  Result = 1
	ErrAllocFailed     Result = 3
	ErrInvalidValue    Result = 7
	ErrArchMismatch    Result = 8
	ErrMappingError    Result = 11
	ErrExecutionFailed Result = 13
	ErrInternalError   Result = 14
	ErrNotSupported    Result = 15
	ErrLicenseError    Result = 16
)

cublasLt error codes from cublasLt.h.

func (Result) Code

func (r Result) Code() int32

Code returns the underlying result code for programmatic error handling.

func (Result) Error

func (r Result) Error() string

Error implements the error interface. When the library is loaded, it returns the error description from GetStatusName and GetStatusString. Otherwise it returns a fallback string with the Go constant name and numeric code.

func (Result) String

func (r Result) String() string

String returns the Go constant name of the result.

type Scalar

type Scalar struct {
	// contains filtered or unexported fields
}

A Scalar is a value, such as the alpha and beta of a matrix product, that the library reads through a pointer. Make one for a value in host memory with Float16BitsScalar, Float32Scalar, Float64Scalar, Complex64Scalar, Complex128Scalar, or Int32Scalar, or for a value in device memory with DeviceScalar.

A call copies a host value into memory of its own, passes the library a pointer to the copy, and reuses that memory once the call returns, so a Scalar never reaches the library and can live anywhere.

cuBLASLt reads a host scalar before the call returns, as cuBLAS does (cuBLAS documentation, section 2.1.5), and a call captured into a CUDA graph keeps the value: "In the case of CUBLAS(LT)_POINTER_MODE_HOST, coefficient values are captured in the graph" (section 2.1.12).

The kind of a host Scalar must be the type the library reads. Where a call names that type in another parameter, a Scalar of another kind is a *ScalarError; where the type is in a descriptor, the call cannot check it. The zero Scalar is a host zero of every kind.

func Complex64Scalar

func Complex64Scalar(x complex64) Scalar

Complex64Scalar returns a host Scalar holding the complex64 x.

func Complex128Scalar

func Complex128Scalar(x complex128) Scalar

Complex128Scalar returns a host Scalar holding the complex128 x.

func DeviceScalar

func DeviceScalar(p driver.DevicePtr) Scalar

DeviceScalar returns a Scalar the library reads from device memory at p. A call passes p unchanged, which the library reads as an address only under a descriptor pointer mode (MatmulDescPointerMode, MatrixTransformDescPointerMode) other than PointerModeHost. The device memory must stay valid until the stream work completes. A DeviceScalar has no kind, so no call checks it.

func Float16BitsScalar

func Float16BitsScalar(b uint16) Scalar

Float16BitsScalar returns a host Scalar holding the IEEE 754 half-precision value with bit pattern b.

func Float32Scalar

func Float32Scalar(x float32) Scalar

Float32Scalar returns a host Scalar holding the float32 x.

func Float64Scalar

func Float64Scalar(x float64) Scalar

Float64Scalar returns a host Scalar holding the float64 x.

func Int32Scalar

func Int32Scalar(x int32) Scalar

Int32Scalar returns a host Scalar holding the int32 x.

type ScalarError

type ScalarError struct {
	Func  string // the C symbol called
	Param string // the scalar parameter
	Kind  string // the Scalar's kind, such as "float32"
	Want  string // the kinds the call allows, such as "float64 or complex128"
}

A ScalarError reports a host Scalar whose kind is not the type the call names for it in another parameter.

func (*ScalarError) Error

func (e *ScalarError) Error() string

type SymbolError

type SymbolError struct {
	Symbol string
	Err    error
}

SymbolError reports that a symbol is not callable.

Err distinguishes the two ways that happens. A nil Err means the loaded library does not export the symbol, which is what an installation older than the symbol looks like. A non-nil Err means the library does export it and the binding itself failed; the library is not at fault.

func (*SymbolError) Error

func (e *SymbolError) Error() string

Error reports the uncallable library symbol and, when the symbol was present but could not be bound, why.

func (*SymbolError) Unwrap

func (e *SymbolError) Unwrap() error

Unwrap returns the reason the symbol could not be bound, or nil when the loaded library does not export it.

type VersionMismatchError

type VersionMismatchError struct {
	Path string // the library that was opened
	Want int    // major version these bindings were generated for
	Got  int    // major version the library reports
	Raw  int    // the version value the library reported, undecoded
}

VersionMismatchError reports that the shared library that opened is not from the version train cublaslt was generated for. dlsym matches on name alone, so a library from a neighbouring train opens and resolves nearly every symbol; asking it its own version is what tells the two apart.

func (*VersionMismatchError) Error

func (e *VersionMismatchError) Error() string

Error reports which library was opened and the two majors that disagree.

A decoder is only a decoder for the version schemes it was measured against, and a library from a train that predates the scheme can report a value it does not decode. Naming a major of 0 in that case would attribute to the library a claim it never made, so the raw value is reported instead.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL