Documentation
¶
Overview ¶
Package cublas provides Pure-Go (CGO_ENABLED=0) dynamic bindings to NVIDIA's cuBLAS library (libcublas.so.13 / libcublas.so.12 / libcublas.so) built on top of internal/dynlib.
Index ¶
- Variables
- type API
- func (a *API) Create() (Handle, error)
- func (a *API) Destroy(h Handle) error
- func (a *API) GemmEx(h Handle, transa, transb Operation, m, n, k int32, alpha unsafe.Pointer, ...) error
- func (a *API) GemmStridedBatchedEx(h Handle, transa, transb Operation, m, n, k int32, alpha unsafe.Pointer, ...) error
- func (a *API) LibraryPath() string
- func (a *API) SetMathMode(h Handle, mode MathMode) error
- func (a *API) SetStream(h Handle, s driver.Stream) error
- func (a *API) Version(h Handle) (int, error)
- type ComputeType
- type DataType
- type Error
- type GemmAlgo
- type Handle
- type MathMode
- type Operation
- type Status
Constants ¶
This section is empty.
Variables ¶
ErrUnavailable is returned when libcublas cannot be loaded on the current host.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API holds dynamically bound cuBLAS library function pointers.
func (*API) GemmEx ¶
func (a *API) GemmEx( h Handle, transa, transb Operation, m, n, k int32, alpha unsafe.Pointer, A driver.DevicePtr, Atype DataType, lda int32, B driver.DevicePtr, Btype DataType, ldb int32, beta unsafe.Pointer, C driver.DevicePtr, Ctype DataType, ldc int32, computeType ComputeType, algo GemmAlgo, ) error
GemmEx executes C = alpha * op(A) * op(B) + beta * C in column-major layout.
func (*API) GemmStridedBatchedEx ¶
func (a *API) GemmStridedBatchedEx( h Handle, transa, transb Operation, m, n, k int32, alpha unsafe.Pointer, A driver.DevicePtr, Atype DataType, lda int32, strideA int64, B driver.DevicePtr, Btype DataType, ldb int32, strideB int64, beta unsafe.Pointer, C driver.DevicePtr, Ctype DataType, ldc int32, strideC int64, batchCount int32, computeType ComputeType, algo GemmAlgo, ) error
GemmStridedBatchedEx executes a strided batch of GEMMs in column-major layout.
func (*API) LibraryPath ¶
LibraryPath returns the dynamic library path that was loaded.
func (*API) SetMathMode ¶
SetMathMode sets the cuBLAS math mode on the handle.
type ComputeType ¶
type ComputeType int32
ComputeType represents cublasComputeType_t (from cublas_api.h).
const ( Compute16F ComputeType = 64 Compute16FPedantic ComputeType = 65 Compute32F ComputeType = 68 Compute32FPedantic ComputeType = 69 Compute64F ComputeType = 70 Compute64FPedantic ComputeType = 71 Compute32I ComputeType = 72 Compute32FFast16F ComputeType = 74 Compute32FFast16BF ComputeType = 75 Compute32FFastTF32 ComputeType = 77 )
type Status ¶
type Status int32
Status represents cublasStatus_t.
const ( StatusSuccess Status = 0 StatusNotInitialized Status = 1 StatusAllocFailed Status = 3 StatusInvalidValue Status = 7 StatusArchMismatch Status = 8 StatusMappingError Status = 11 StatusExecutionFail Status = 13 StatusInternalError Status = 14 StatusNotSupported Status = 15 StatusLicenseError Status = 16 )