clBLAS  2.11
 All Functions Typedefs Enumerations Enumerator Groups Pages
Functions
GEMM - General matrix-matrix multiplication

Functions

clblasStatus clblasSgemm (clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, cl_float alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_float beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue *commandQueues, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)
 Matrix-matrix product of general rectangular matrices with float elements. Extended version. More...
 
clblasStatus clblasDgemm (clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, cl_double alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_double beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue *commandQueues, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)
 Matrix-matrix product of general rectangular matrices with double elements. Extended version. More...
 
clblasStatus clblasCgemm (clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, FloatComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue *commandQueues, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)
 Matrix-matrix product of general rectangular matrices with float complex elements. Extended version. More...
 
clblasStatus clblasZgemm (clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, DoubleComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue *commandQueues, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)
 Matrix-matrix product of general rectangular matrices with double complex elements. Exteneded version. More...
 

Detailed Description

Function Documentation

clblasStatus clblasCgemm ( clblasOrder  order,
clblasTranspose  transA,
clblasTranspose  transB,
size_t  M,
size_t  N,
size_t  K,
FloatComplex  alpha,
const cl_mem  A,
size_t  offA,
size_t  lda,
const cl_mem  B,
size_t  offB,
size_t  ldb,
FloatComplex  beta,
cl_mem  C,
size_t  offC,
size_t  ldc,
cl_uint  numCommandQueues,
cl_command_queue *  commandQueues,
cl_uint  numEventsInWaitList,
const cl_event *  eventWaitList,
cl_event *  events 
)

Matrix-matrix product of general rectangular matrices with float complex elements. Extended version.

Note
This function is not thread-safe.

Matrix-matrix products:

  • \( C \leftarrow \alpha A B + \beta C \)
  • \( C \leftarrow \alpha A^T B + \beta C \)
  • \( C \leftarrow \alpha A B^T + \beta C \)
  • \( C \leftarrow \alpha A^T B^T + \beta C \)
Parameters
[in]orderRow/column order.
[in]transAHow matrix A is to be transposed.
[in]transBHow matrix B is to be transposed.
[in]MNumber of rows in matrix A.
[in]NNumber of columns in matrix B.
[in]KNumber of columns in matrix A and rows in matrix B.
[in]alphaThe factor of matrix A.
[in]ABuffer object storing matrix A.
[in]offAOffset of the first element of the matrix A in the buffer object. Counted in elements.
[in]ldaLeading dimension of matrix A. For detailed description, see clblasSgemm().
[in]BBuffer object storing matrix B.
[in]offBOffset of the first element of the matrix B in the buffer object. Counted in elements.
[in]ldbLeading dimension of matrix B. For detailed description, see clblasSgemm().
[in]betaThe factor of matrix C.
[out]CBuffer object storing matrix C.
[in]offCOffset of the first element of the matrix C in the buffer object. Counted in elements.
[in]ldcLeading dimension of matrix C. For detailed description, see clblasSgemm().
[in]numCommandQueuesNumber of OpenCL command queues in which the task is to be performed.
[in]commandQueuesOpenCL command queues.
[in]numEventsInWaitListNumber of events in the event wait list.
[in]eventWaitListEvent wait list.
[in]eventsEvent objects per each command queue that identify a particular kernel execution instance.
Returns
  • clblasSuccess on success;
  • clblasInvalidValue if either offA, offB or offC exceeds the size of the respective buffer object;
  • the same error codes as the clblasSgemm() function otherwise.
clblasStatus clblasDgemm ( clblasOrder  order,
clblasTranspose  transA,
clblasTranspose  transB,
size_t  M,
size_t  N,
size_t  K,
cl_double  alpha,
const cl_mem  A,
size_t  offA,
size_t  lda,
const cl_mem  B,
size_t  offB,
size_t  ldb,
cl_double  beta,
cl_mem  C,
size_t  offC,
size_t  ldc,
cl_uint  numCommandQueues,
cl_command_queue *  commandQueues,
cl_uint  numEventsInWaitList,
const cl_event *  eventWaitList,
cl_event *  events 
)

Matrix-matrix product of general rectangular matrices with double elements. Extended version.

Note
This function is not thread-safe.

Matrix-matrix products:

  • \( C \leftarrow \alpha A B + \beta C \)
  • \( C \leftarrow \alpha A^T B + \beta C \)
  • \( C \leftarrow \alpha A B^T + \beta C \)
  • \( C \leftarrow \alpha A^T B^T + \beta C \)
Parameters
[in]orderRow/column order.
[in]transAHow matrix A is to be transposed.
[in]transBHow matrix B is to be transposed.
[in]MNumber of rows in matrix A.
[in]NNumber of columns in matrix B.
[in]KNumber of columns in matrix A and rows in matrix B.
[in]alphaThe factor of matrix A.
[in]ABuffer object storing matrix A.
[in]offAOffset of the first element of the matrix A in the buffer object. Counted in elements.
[in]ldaLeading dimension of matrix A. For detailed description, see clblasSgemm().
[in]BBuffer object storing matrix B.
[in]offBOffset of the first element of the matrix B in the buffer object. Counted in elements.
[in]ldbLeading dimension of matrix B. For detailed description, see clblasSgemm().
[in]betaThe factor of matrix C.
[out]CBuffer object storing matrix C.
[in]offCOffset of the first element of the matrix C in the buffer object. Counted in elements.
[in]ldcLeading dimension of matrix C. For detailed description, see clblasSgemm().
[in]numCommandQueuesNumber of OpenCL command queues in which the task is to be performed.
[in]commandQueuesOpenCL command queues.
[in]numEventsInWaitListNumber of events in the event wait list.
[in]eventWaitListEvent wait list.
[in]eventsEvent objects per each command queue that identify a particular kernel execution instance.
Returns
  • clblasSuccess on success;
  • clblasInvalidDevice if a target device does not support floating point arithmetic with double precision;
  • clblasInvalidValue if either offA, offB or offC exceeds the size of the respective buffer object;
  • the same error codes as the clblasSgemm() function otherwise.
clblasStatus clblasSgemm ( clblasOrder  order,
clblasTranspose  transA,
clblasTranspose  transB,
size_t  M,
size_t  N,
size_t  K,
cl_float  alpha,
const cl_mem  A,
size_t  offA,
size_t  lda,
const cl_mem  B,
size_t  offB,
size_t  ldb,
cl_float  beta,
cl_mem  C,
size_t  offC,
size_t  ldc,
cl_uint  numCommandQueues,
cl_command_queue *  commandQueues,
cl_uint  numEventsInWaitList,
const cl_event *  eventWaitList,
cl_event *  events 
)

Matrix-matrix product of general rectangular matrices with float elements. Extended version.

Note
This function is not thread-safe.

Matrix-matrix products:

  • \( C \leftarrow \alpha A B + \beta C \)
  • \( C \leftarrow \alpha A^T B + \beta C \)
  • \( C \leftarrow \alpha A B^T + \beta C \)
  • \( C \leftarrow \alpha A^T B^T + \beta C \)
Parameters
[in]orderRow/column order.
[in]transAHow matrix A is to be transposed.
[in]transBHow matrix B is to be transposed.
[in]MNumber of rows in matrix A.
[in]NNumber of columns in matrix B.
[in]KNumber of columns in matrix A and rows in matrix B.
[in]alphaThe factor of matrix A.
[in]ABuffer object storing matrix A.
[in]offAOffset of the first element of the matrix A in the buffer object. Counted in elements.
[in]ldaLeading dimension of matrix A. It cannot be less than K when the order parameter is set to clblasRowMajor,
or less than M when the parameter is set to clblasColumnMajor.
[in]BBuffer object storing matrix B.
[in]offBOffset of the first element of the matrix B in the buffer object. Counted in elements.
[in]ldbLeading dimension of matrix B. It cannot be less than N when the order parameter is set to clblasRowMajor,
or less than K when it is set to clblasColumnMajor.
[in]betaThe factor of matrix C.
[out]CBuffer object storing matrix C.
[in]offCOffset of the first element of the matrix C in the buffer object. Counted in elements.
[in]ldcLeading dimension of matrix C. It cannot be less than N when the order parameter is set to clblasRowMajor,
or less than M when it is set to clblasColumnMajorOrder.
[in]numCommandQueuesNumber of OpenCL command queues in which the task is to be performed.
[in]commandQueuesOpenCL command queues.
[in]numEventsInWaitListNumber of events in the event wait list.
[in]eventWaitListEvent wait list.
[in]eventsEvent objects per each command queue that identify a particular kernel execution instance.
Returns
  • clblasSuccess on success;
  • clblasInvalidValue if either offA, offB or offC exceeds the size of the respective buffer object;
  • the same error codes as clblasSgemm() otherwise.
Examples:
example_sgemm.c.
clblasStatus clblasZgemm ( clblasOrder  order,
clblasTranspose  transA,
clblasTranspose  transB,
size_t  M,
size_t  N,
size_t  K,
DoubleComplex  alpha,
const cl_mem  A,
size_t  offA,
size_t  lda,
const cl_mem  B,
size_t  offB,
size_t  ldb,
DoubleComplex  beta,
cl_mem  C,
size_t  offC,
size_t  ldc,
cl_uint  numCommandQueues,
cl_command_queue *  commandQueues,
cl_uint  numEventsInWaitList,
const cl_event *  eventWaitList,
cl_event *  events 
)

Matrix-matrix product of general rectangular matrices with double complex elements. Exteneded version.

Note
This function is not thread-safe.

Matrix-matrix products:

  • \( C \leftarrow \alpha A B + \beta C \)
  • \( C \leftarrow \alpha A^T B + \beta C \)
  • \( C \leftarrow \alpha A B^T + \beta C \)
  • \( C \leftarrow \alpha A^T B^T + \beta C \)
Parameters
[in]orderRow/column order.
[in]transAHow matrix A is to be transposed.
[in]transBHow matrix B is to be transposed.
[in]MNumber of rows in matrix A.
[in]NNumber of columns in matrix B.
[in]KNumber of columns in matrix A and rows in matrix B.
[in]alphaThe factor of matrix A.
[in]ABuffer object storing matrix A.
[in]offAOffset of the first element of the matrix A in the buffer object. Counted in elements.
[in]ldaLeading dimension of matrix A. For detailed description, see clblasSgemm().
[in]BBuffer object storing matrix B.
[in]offBOffset of the first element of the matrix B in the buffer object. Counted in elements.
[in]ldbLeading dimension of matrix B. For detailed description, see clblasSgemm().
[in]betaThe factor of matrix C.
[out]CBuffer object storing matrix C.
[in]offCOffset of the first element of the matrix C in the buffer object. Counted in elements.
[in]ldcLeading dimension of matrix C. For detailed description, see clblasSgemm().
[in]numCommandQueuesNumber of OpenCL command queues in which the task is to be performed.
[in]commandQueuesOpenCL command queues.
[in]numEventsInWaitListNumber of events in the event wait list.
[in]eventWaitListEvent wait list.
[in]eventsEvent objects per each command queue that identify a particular kernel execution instance.
Returns
  • clblasSuccess on success;
  • clblasInvalidDevice if a target device does not support floating point arithmetic with double precision;
  • clblasInvalidValue if either offA, offB or offC exceeds the size of the respective buffer object;
  • the same error codes as the clblasSgemm() function otherwise.