Library/ManagedCuda/CudaBlas/CudaBlasHandler.cs
/// <summary>
/// This function performs the complex matrix-matrix multiplication, using Gauss complexity reduction algorithm. This can lead to an increase in performance up to 25% <para/>
/// C = a op(A ) op(B ) +  C <para/>
/// where a and b are scalars, and A , B and C are matrices stored in column-major format with dimensions op(A ) m k, op ( B ) k n and C m n, respectively. Also, for matrix A
/// op(A ) = A if  transa == CUBLAS_OP_N A T if  transa == CUBLAS_OP_T A H if  transa == CUBLAS_OP_C
/// and op(B ) is defined similarly for matrix B. <para/>
/// Note: These 2 routines are only supported on GPUs with architecture capabilities equal or greater than 5.0 
/// </summary>
/// <param name="transa">operation op(A[i]) that is non- or (conj.) transpose.</param>
/// <param name="transb">operation op(B[i]) that is non- or (conj.) transpose.</param>
/// <param name="m">number of rows of matrix op(A[i]) and C[i].</param>
/// <param name="n">number of columns of op(B[i]) and C[i].</param>
/// <param name="k">number of columns of op(A[i]) and rows of op(B[i]).</param>
/// <param name="alpha">scalar used for multiplication.</param>
/// <param name="Aarray">array of device pointers, with each array/device pointer of dim. lda x k with lda>=max(1,m) if
/// transa==CUBLAS_OP_N and lda x m with lda>=max(1,k) otherwise.</param>
/// <param name="lda">leading dimension of two-dimensional array used to store each matrix A[i].</param>
/// <param name="Barray">array of device pointers, with each array of dim. ldb x n with ldb>=max(1,k) if
/// transa==CUBLAS_OP_N and ldb x k with ldb>=max(1,n) max(1,) otherwise.</param>
/// <param name="ldb">leading dimension of two-dimensional array used to store each matrix B[i].</param>
/// <param name="beta">scalar used for multiplication. If beta == 0, C does not have to be a valid input.</param>
/// <param name="Carray">array of device pointers. It has dimensions ldc x n with ldc>=max(1,m).</param>
/// <param name="ldc">leading dimension of two-dimensional array used to store each matrix C[i].</param>
/// <param name="batchCount">number of pointers contained in A, B and C.</param>
This function performs the complex matrix-matrix multiplication, using Gauss complexity reduction algorithm. This can lead to an increase in performance up to 25%
C = a op(A ) op(B ) +  C
where a and b are scalars, and A , B and C are matrices stored in column-major format with dimensions op(A ) m k, op ( B ) k n and C m n, respectively.
This function performs the complex matrix - matrix multiplication using Gauss complexity reduction algorithm . This can lead to an increase in performance up to 25% C = a op ( A ) op ( B ) + C where a and b are scalars and A B and C are matrices stored in column - major format with dimensions op ( A ) m k op ( B ) k n and C m n respectively .
public void Gemm3mBatched(Operation transa, Operation transb, int m, int n, int k, cuFloatComplex alpha,
            CudaDeviceVariable<CUdeviceptr> Aarray, int lda, CudaDeviceVariable<CUdeviceptr> Barray, int ldb,
            cuFloatComplex beta, CudaDeviceVariable<CUdeviceptr> Carray, int ldc, int batchCount)
        {
            _status = CudaBlasNativeMethods.cublasCgemm3mBatched(_blasHandle, transa, transb, m, n, k, ref alpha, Aarray.DevicePointer, lda, Barray.DevicePointer, ldb, ref beta, Carray.DevicePointer, ldc, batchCount);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cublasCgemm3mBatched", _status));
            if (_status != CublasStatus.Success) throw new CudaBlasException(_status);
        }
public void Gemm3mBatched ( Operation transa , Operation transb , int m , int n , int k , cuFloatComplex alpha , CudaDeviceVariable < CUdeviceptr > Aarray , int lda , CudaDeviceVariable < CUdeviceptr > Barray , int ldb , cuFloatComplex beta , CudaDeviceVariable < CUdeviceptr > Carray , int ldc , int batchCount ) { _status = CudaBlasNativeMethods . cublasCgemm3mBatched ( _blasHandle , transa , transb , m , n , k , ref alpha , Aarray . DevicePointer , lda , Barray . DevicePointer , ldb , ref beta , Carray . DevicePointer , ldc , batchCount ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , _status ) ) ; if ( _status != CublasStatus . Success ) throw new CudaBlasException ( _status ) ; }
This function performs the complex matrix-matrix multiplication, using Gauss complexity reduction algorithm.
This function performs the complex matrix - matrix multiplication using Gauss complexity reduction algorithm .
transa
Operation
operation op(A[i]) that is non- or (conj.) transpose.
operation op ( A [ i ] ) that is non - or ( conj . ) transpose .
transb
Operation
operation op(B[i]) that is non- or (conj.) transpose.
operation op ( B [ i ] ) that is non - or ( conj . ) transpose .
m
int
number of rows of matrix op(A[i]) and C[i].
number of rows of matrix op ( A [ i ] ) and C [ i ] .
n
int
number of columns of op(B[i]) and C[i].
number of columns of op ( B [ i ] ) and C [ i ] .
k
int
number of columns of op(A[i]) and rows of op(B[i]).
number of columns of op ( A [ i ] ) and rows of op ( B [ i ] ) .
alpha
cuFloatComplex
scalar used for multiplication.
scalar used for multiplication .
Aarray
CudaDeviceVariable<CUdeviceptr>
array of device pointers, with each array/device pointer of dim. lda x k with lda>=max(1,m) if
transa==CUBLAS_OP_N and lda x m with lda>=max(1,k) otherwise.
array of device pointers with each array / device pointer of dim . lda x k with lda > = max ( 1 m ) if transa == CUBLAS_OP_N and lda x m with lda > = max ( 1 k ) otherwise .
lda
int
leading dimension of two-dimensional array used to store each matrix A[i].
leading dimension of two - dimensional array used to store each matrix A [ i ] .
Barray
CudaDeviceVariable<CUdeviceptr>
array of device pointers, with each array of dim. ldb x n with ldb>=max(1,k) if
transa==CUBLAS_OP_N and ldb x k with ldb>=max(1,n) max(1,) otherwise.
array of device pointers with each array of dim . ldb x n with ldb > = max ( 1 k ) if transa == CUBLAS_OP_N and ldb x k with ldb > = max ( 1 n ) max ( 1 ) otherwise .
ldb
int
leading dimension of two-dimensional array used to store each matrix B[i].
leading dimension of two - dimensional array used to store each matrix B [ i ] .
beta
cuFloatComplex
scalar used for multiplication. If beta == 0, C does not have to be a valid input.
scalar used for multiplication . If beta == 0 C does not have to be a valid input .
Carray
CudaDeviceVariable<CUdeviceptr>
array of device pointers. It has dimensions ldc x n with ldc>=max(1,m).
array of device pointers . It has dimensions ldc x n with ldc > = max ( 1 m ) .
ldc
int
leading dimension of two-dimensional array used to store each matrix C[i].
leading dimension of two - dimensional array used to store each matrix C [ i ] .
batchCount
int
number of pointers contained in A, B and C.
number of pointers contained in A B and C .