Documentation
¶
Overview ¶
Package cublas provides bindings for the CUDA cuBLAS library.
Index ¶
- type Handle
- func (h *Handle) Dasum(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) Daxpy(n int, alpha interface{}, x cuda.Buffer, incx int, y cuda.Buffer, incy int) error
- func (h *Handle) Ddgmm(mode SideMode, m, n int, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, ...) error
- func (h *Handle) Ddot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int, result interface{}) error
- func (h *Handle) Dgemm(transA, transB Operation, m, n, k int, alpha interface{}, matA cuda.Buffer, ...) error
- func (h *Handle) Dgemv(trans Operation, m, n int, alpha interface{}, matA cuda.Buffer, lda int, ...) error
- func (h *Handle) Dnrm2(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) Dscal(n int, alpha interface{}, x cuda.Buffer, incx int) error
- func (h *Handle) Idamax(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) Isamax(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) PointerMode() PointerMode
- func (h *Handle) Sasum(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) Saxpy(n int, alpha interface{}, x cuda.Buffer, incx int, y cuda.Buffer, incy int) error
- func (h *Handle) Sdgmm(mode SideMode, m, n int, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, ...) error
- func (h *Handle) Sdot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int, result interface{}) error
- func (h *Handle) SetPointerMode(p PointerMode) error
- func (h *Handle) SetStream(s *cuda.Stream) error
- func (h *Handle) Sgemm(transA, transB Operation, m, n, k int, alpha interface{}, matA cuda.Buffer, ...) error
- func (h *Handle) Sgemv(trans Operation, m, n int, alpha interface{}, matA cuda.Buffer, lda int, ...) error
- func (h *Handle) Snrm2(n int, x cuda.Buffer, incx int, result interface{}) error
- func (h *Handle) Sscal(n int, alpha interface{}, x cuda.Buffer, incx int) error
- type Operation
- type PointerMode
- type SideMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
A Handle is used to make cuBLAS calls.
A given Handle is bound to a specific cuda.Context.
func NewHandle ¶
NewHandle creates a new cuBLAS handle.
This must be called inside the cuda.Context.
func (*Handle) Dasum ¶
Dasum is like Sasum, but for double-precision.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *float64. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Daxpy ¶
func (h *Handle) Daxpy(n int, alpha interface{}, x cuda.Buffer, incx int, y cuda.Buffer, incy int) error
Daxpy is like Saxpy, but for double-precision.
The argument alpha's type depends on the pointer mode. In the Host pointer mode, use float64 or *float64. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Ddgmm ¶
func (h *Handle) Ddgmm(mode SideMode, m, n int, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, matC cuda.Buffer, ldc int) error
Ddgmm is like Sdgmm, but for double-precision.
The mode argument indicates on which side the diagonal matrix should be placed.
This must be called inside the cuda.Context.
func (*Handle) Ddot ¶
func (h *Handle) Ddot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int, result interface{}) error
Ddot performs a double-precision dot product.
The result argument's type depends on the pointer mode. In the Host pointer mode, it should be *float64. In the Device pointer mode, it should be a cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Dgemm ¶
func (h *Handle) Dgemm(transA, transB Operation, m, n, k int, alpha interface{}, matA cuda.Buffer, lda int, matB cuda.Buffer, ldb int, beta interface{}, matC cuda.Buffer, ldc int) error
Dgemm is like Sgemm, but for double-precision.
The type of alpha and beta depends on the pointer mode. In Host mode, use float64 or *float64. In Device mode, user cuda.Buffer.
This must be called inside the cuda.Context
func (*Handle) Dgemv ¶
func (h *Handle) Dgemv(trans Operation, m, n int, alpha interface{}, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, beta interface{}, y cuda.Buffer, incy int) error
Dgemv performs double-precision matrix-vector multiplication.
Matrices are stored in column-major order.
The leading dimension lda may not be 0.
The type of alpha and beta depends on the pointer mode. In Host mode, use float64 or *float64. In Device mode, user cuda.Buffer.
This must be called inside the cuda.Context
func (*Handle) Dnrm2 ¶
Dnrm2 is like Snrm2, but for double-precision.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *float64. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Dscal ¶
Dscal is like Sscal, but for double-precision.
The argument alpha's type depends on the pointer mode. In the Host pointer mode, use float64 or *float64. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Idamax ¶
Idamax is like Isamax, but for double-precision.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *int. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Isamax ¶
Isamax gets the index of the first single-precision vector component with the max absolute value. The resulting indices start at one, not zero.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *int. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) PointerMode ¶
func (h *Handle) PointerMode() PointerMode
PointerMode returns the current PointerMode.
This must be called inside the cuda.Context.
func (*Handle) Sasum ¶
Sasum sums the absolute values of the components in a single-precision vector.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *float32. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Saxpy ¶
func (h *Handle) Saxpy(n int, alpha interface{}, x cuda.Buffer, incx int, y cuda.Buffer, incy int) error
Saxpy computes single-precision "ax plus y".
The argument alpha's type depends on the pointer mode. In the Host pointer mode, use float32 or *float32. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) Sdgmm ¶
func (h *Handle) Sdgmm(mode SideMode, m, n int, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, matC cuda.Buffer, ldc int) error
Sdgmm multiplies a dense matrix by a diagonal matrix.
The mode argument indicates on which side the diagonal matrix should be placed.
This must be called inside the cuda.Context.
func (*Handle) Sdot ¶
func (h *Handle) Sdot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int, result interface{}) error
Sdot performs a single-precision dot product.
The result argument's type depends on the pointer mode. In the Host pointer mode, it should be *float32. In the Device pointer mode, it should be a cuda.Buffer.
This must be called inside the cuda.Context.
func (*Handle) SetPointerMode ¶
func (h *Handle) SetPointerMode(p PointerMode) error
SetPointerMode updates the current PointerMode.
This must be called inside the cuda.Context.
func (*Handle) SetStream ¶
SetStream tells the handle which stream to use for its computations.
this must be called inside the cuda.Context.
func (*Handle) Sgemm ¶
func (h *Handle) Sgemm(transA, transB Operation, m, n, k int, alpha interface{}, matA cuda.Buffer, lda int, matB cuda.Buffer, ldb int, beta interface{}, matC cuda.Buffer, ldc int) error
Sgemm performs single-precision matrix multiplication.
Matrices are stored in column-major order.
The leading dimensions lda, ldb, and ldc may not be 0.
The type of alpha and beta depends on the pointer mode. In Host mode, use float32 or *float32. In Device mode, user cuda.Buffer.
This must be called inside the cuda.Context
func (*Handle) Sgemv ¶
func (h *Handle) Sgemv(trans Operation, m, n int, alpha interface{}, matA cuda.Buffer, lda int, x cuda.Buffer, incx int, beta interface{}, y cuda.Buffer, incy int) error
Sgemv performs single-precision matrix-vector multiplication.
Matrices are stored in column-major order.
The leading dimension lda may not be 0.
The type of alpha and beta depends on the pointer mode. In Host mode, use float32 or *float32. In Device mode, user cuda.Buffer.
This must be called inside the cuda.Context
func (*Handle) Snrm2 ¶
Snrm2 computes the Euclidean norm of a single-precision vector.
The result argument's type depends on the pointer mode. In the Host pointer mode, use *float32. In the Device pointer mode, use cuda.Buffer.
This must be called inside the cuda.Context.
type PointerMode ¶
type PointerMode int
PointerMode determines how BLAS APIs receive and return scaler values.
There are two types of scaler values in the API: scaler inputs and scaler return values. The current pointer mode affects both types of values.
If the pointer mode is Device, then all scaler inputs and outputs must be cuda.Buffer objects.
If the pointer mode is Host, then all scaler inputs must be float32, float64, *float32, or *float64; all scaler outputs must be *float32 or *float64.
const ( Host PointerMode = iota Device )