GEMM - General matrix-matrix multiplication

pyclblas.clblasCgemm(order, transA, transB, M, N, K, alpha, A, offA, lda, B, offB, ldb, beta, C, offC, ldc, commandQueues, eventWaitList)

wraps: clblasCgemm

Matrix-matrix product of general rectangular matrices with float complex elements. Extended version. <dl class=”section note”> <dt> Note </dt> <dd> This function is not thread-safe. </dd> </dl> Matrix-matrix products:

  • ( C ← α A B + β C )
  • ( C ← α ATB + β C )
  • ( C ← α A BT+ β C )
  • ( C ← α ATBT+ β C )
Parameters:
  • order (clblasOrder [in]) – Row/column order.
  • transA (clblasTranspose [in]) – How matrix A is to be transposed.
  • transB (clblasTranspose [in]) – How matrix B is to be transposed.
  • M (int [in]) – Number of rows in matrix A.
  • N (int [in]) – Number of columns in matrix B.
  • K (int [in]) – Number of columns in matrix A and rows in matrix B.
  • alpha (complex [in]) – The factor of matrix A.
  • A (pyopencl.Buffer [in]) – Buffer object storing matrix A.
  • offA (int [in]) – Offset of the first element of the matrix A in the buffer object. Counted in elements.
  • lda (int [in]) – Leading dimension of matrix A.
  • B (pyopencl.Buffer [in]) – Buffer object storing matrix B.
  • offB (int [in]) – Offset of the first element of the matrix B in the buffer object. Counted in elements.
  • ldb (int [in]) – Leading dimension of matrix B.
  • beta (complex [in]) – The factor of matrix C.
  • C (pyopencl.Buffer [out]) – Buffer object storing matrix C.
  • offC (int [in]) – Offset of the first element of the matrix C in the buffer object. Counted in elements.
  • ldc (int [in]) – Leading dimension of matrix C.
  • commandQueues (pyopencl.CommandQueue [in]) – OpenCL command queues. A list, tuple, or single instance of pyopencl.CommandQueue. Must not be None.
  • eventWaitList (pyopencl.Event [in]) – Event wait list. A list, tuple, or single instance of pyopencl.Event. May be None.
Returns:

A tuple of pyopencl.Event instances, one for each commandQueue supplied.

pyclblas.clblasDgemm(order, transA, transB, M, N, K, alpha, A, offA, lda, B, offB, ldb, beta, C, offC, ldc, commandQueues, eventWaitList)

wraps: clblasDgemm

Matrix-matrix product of general rectangular matrices with double elements. Extended version. <dl class=”section note”> <dt> Note </dt> <dd> This function is not thread-safe. </dd> </dl> Matrix-matrix products:

  • ( C ← α A B + β C )
  • ( C ← α ATB + β C )
  • ( C ← α A BT+ β C )
  • ( C ← α ATBT+ β C )
Parameters:
  • order (clblasOrder [in]) – Row/column order.
  • transA (clblasTranspose [in]) – How matrix A is to be transposed.
  • transB (clblasTranspose [in]) – How matrix B is to be transposed.
  • M (int [in]) – Number of rows in matrix A.
  • N (int [in]) – Number of columns in matrix B.
  • K (int [in]) – Number of columns in matrix A and rows in matrix B.
  • alpha (float [in]) – The factor of matrix A.
  • A (pyopencl.Buffer [in]) – Buffer object storing matrix A.
  • offA (int [in]) – Offset of the first element of the matrix A in the buffer object. Counted in elements.
  • lda (int [in]) – Leading dimension of matrix A.
  • B (pyopencl.Buffer [in]) – Buffer object storing matrix B.
  • offB (int [in]) – Offset of the first element of the matrix B in the buffer object. Counted in elements.
  • ldb (int [in]) – Leading dimension of matrix B.
  • beta (float [in]) – The factor of matrix C.
  • C (pyopencl.Buffer [out]) – Buffer object storing matrix C.
  • offC (int [in]) – Offset of the first element of the matrix C in the buffer object. Counted in elements.
  • ldc (int [in]) – Leading dimension of matrix C.
  • commandQueues (pyopencl.CommandQueue [in]) – OpenCL command queues. A list, tuple, or single instance of pyopencl.CommandQueue. Must not be None.
  • eventWaitList (pyopencl.Event [in]) – Event wait list. A list, tuple, or single instance of pyopencl.Event. May be None.
Returns:

A tuple of pyopencl.Event instances, one for each commandQueue supplied.

pyclblas.clblasSgemm(order, transA, transB, M, N, K, alpha, A, offA, lda, B, offB, ldb, beta, C, offC, ldc, commandQueues, eventWaitList)

wraps: clblasSgemm

Matrix-matrix product of general rectangular matrices with float elements. Extended version. <dl class=”section note”> <dt> Note </dt> <dd> This function is not thread-safe. </dd> </dl> Matrix-matrix products:

  • ( C ← α A B + β C )
  • ( C ← α ATB + β C )
  • ( C ← α A BT+ β C )
  • ( C ← α ATBT+ β C )
Parameters:
  • order (clblasOrder [in]) – Row/column order.
  • transA (clblasTranspose [in]) – How matrix A is to be transposed.
  • transB (clblasTranspose [in]) – How matrix B is to be transposed.
  • M (int [in]) – Number of rows in matrix A.
  • N (int [in]) – Number of columns in matrix B.
  • K (int [in]) – Number of columns in matrix A and rows in matrix B.
  • alpha (float [in]) – The factor of matrix A.
  • A (pyopencl.Buffer [in]) – Buffer object storing matrix A.
  • offA (int [in]) – Offset of the first element of the matrix A in the buffer object. Counted in elements.
  • lda (int [in]) – Leading 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.
  • B (pyopencl.Buffer [in]) – Buffer object storing matrix B.
  • offB (int [in]) – Offset of the first element of the matrix B in the buffer object. Counted in elements.
  • ldb (int [in]) – Leading 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.
  • beta (float [in]) – The factor of matrix C.
  • C (pyopencl.Buffer [out]) – Buffer object storing matrix C.
  • offC (int [in]) – Offset of the first element of the matrix C in the buffer object. Counted in elements.
  • ldc (int [in]) – Leading 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.
  • commandQueues (pyopencl.CommandQueue [in]) – OpenCL command queues. A list, tuple, or single instance of pyopencl.CommandQueue. Must not be None.
  • eventWaitList (pyopencl.Event [in]) – Event wait list. A list, tuple, or single instance of pyopencl.Event. May be None.
Returns:

A tuple of pyopencl.Event instances, one for each commandQueue supplied.

pyclblas.clblasZgemm(order, transA, transB, M, N, K, alpha, A, offA, lda, B, offB, ldb, beta, C, offC, ldc, commandQueues, eventWaitList)

wraps: clblasZgemm

Matrix-matrix product of general rectangular matrices with double complex elements. Exteneded version. <dl class=”section note”> <dt> Note </dt> <dd> This function is not thread-safe. </dd> </dl> Matrix-matrix products:

  • ( C ← α A B + β C )
  • ( C ← α ATB + β C )
  • ( C ← α A BT+ β C )
  • ( C ← α ATBT+ β C )
Parameters:
  • order (clblasOrder [in]) – Row/column order.
  • transA (clblasTranspose [in]) – How matrix A is to be transposed.
  • transB (clblasTranspose [in]) – How matrix B is to be transposed.
  • M (int [in]) – Number of rows in matrix A.
  • N (int [in]) – Number of columns in matrix B.
  • K (int [in]) – Number of columns in matrix A and rows in matrix B.
  • alpha (complex [in]) – The factor of matrix A.
  • A (pyopencl.Buffer [in]) – Buffer object storing matrix A.
  • offA (int [in]) – Offset of the first element of the matrix A in the buffer object. Counted in elements.
  • lda (int [in]) – Leading dimension of matrix A.
  • B (pyopencl.Buffer [in]) – Buffer object storing matrix B.
  • offB (int [in]) – Offset of the first element of the matrix B in the buffer object. Counted in elements.
  • ldb (int [in]) – Leading dimension of matrix B.
  • beta (complex [in]) – The factor of matrix C.
  • C (pyopencl.Buffer [out]) – Buffer object storing matrix C.
  • offC (int [in]) – Offset of the first element of the matrix C in the buffer object. Counted in elements.
  • ldc (int [in]) – Leading dimension of matrix C.
  • commandQueues (pyopencl.CommandQueue [in]) – OpenCL command queues. A list, tuple, or single instance of pyopencl.CommandQueue. Must not be None.
  • eventWaitList (pyopencl.Event [in]) – Event wait list. A list, tuple, or single instance of pyopencl.Event. May be None.
Returns:

A tuple of pyopencl.Event instances, one for each commandQueue supplied.