Library/ManagedCuda/CudaBlas/CudaBlasHandler.cs
/// <summary>
/// This function solves an array of systems of linear equations of the form:<para/>
/// op(A[i]) X[i] = a B[i]<para/>
/// where A[i] is a matrix which has been LU factorized with pivoting, X[i] and B[i] are
/// n x nrhs matrices.<para/>
/// This function is intended to be used for matrices of small sizes where the launch
/// overhead is a significant factor.
/// </summary>
/// <param name="trans">operation op(A) that is non- or (conj.) transpose.</param>
/// <param name="n">number of rows and columns of Aarray[i].</param>
/// <param name="nrhs">number of columns of Barray[i].</param>
/// <param name="Aarray">array of pointers to array, with each array of dim. n 
/// x n with lda&gt;=max(1,n).</param>
/// <param name="lda">leading dimension of two-dimensional array used to store
/// each matrix Aarray[i].</param>
/// <param name="devIpiv">array of size n x batchSize that contains the pivoting
/// sequence of each factorization of Aarray[i] stored in a
/// linear fashion. If devIpiv is nil, pivoting for all Aarray[i]
/// is ignored.</param>
/// <param name="Barray">array of pointers to array, with each array of dim. n
/// x nrhs with ldb&gt;=max(1,n).</param>
/// <param name="ldb">leading dimension of two-dimensional array used to store
/// each solution matrix Barray[i].</param>
/// <param name="batchSize">number of pointers contained in A</param>
/// <returns>If info=0, the execution is successful. If info = -j, the j-th parameter had an illegal value.</returns>
This function solves an array of systems of linear equations of the form:
op(A[i]) X[i] = a B[i]
where A[i] is a matrix which has been LU factorized with pivoting, X[i] and B[i] are
n x nrhs matrices.
This function is intended to be used for matrices of small sizes where the launch
overhead is a significant factor.
This function solves an array of systems of linear equations of the form : op ( A [ i ] ) X [ i ] = a B [ i ] where A [ i ] is a matrix which has been LU factorized with pivoting X [ i ] and B [ i ] are n x nrhs matrices . This function is intended to be used for matrices of small sizes where the launch overhead is a significant factor .
public int GetrsBatchedS(Operation trans, int n, int nrhs, CudaDeviceVariable<CUdeviceptr> Aarray, int lda, CudaDeviceVariable<int> devIpiv,
			CudaDeviceVariable<CUdeviceptr> Barray, int ldb, int batchSize)
		{
			int info = 0;
			_status = CudaBlasNativeMethods.cublasSgetrsBatched(_blasHandle, trans, n, nrhs, Aarray.DevicePointer, lda, devIpiv.DevicePointer, Barray.DevicePointer, ldb, ref info, batchSize);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cublasSgetrsBatched", _status));
			if (_status != CublasStatus.Success) throw new CudaBlasException(_status);
			return info;
		}
public int GetrsBatchedS ( Operation trans , int n , int nrhs , CudaDeviceVariable < CUdeviceptr > Aarray , int lda , CudaDeviceVariable < int > devIpiv , CudaDeviceVariable < CUdeviceptr > Barray , int ldb , int batchSize ) { int info = 0 ; _status = CudaBlasNativeMethods . cublasSgetrsBatched ( _blasHandle , trans , n , nrhs , Aarray . DevicePointer , lda , devIpiv . DevicePointer , Barray . DevicePointer , ldb , ref info , batchSize ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , _status ) ) ; if ( _status != CublasStatus . Success ) throw new CudaBlasException ( _status ) ; return info ; }
This function solves an array of systems of linear equations of the form:
op(A[i]) X[i] = a B[i]
where A[i] is a matrix which has been LU factorized with pivoting, X[i] and B[i] are
n x nrhs matrices.
This function solves an array of systems of linear equations of the form : op ( A [ i ] ) X [ i ] = a B [ i ] where A [ i ] is a matrix which has been LU factorized with pivoting X [ i ] and B [ i ] are n x nrhs matrices .
If info=0, the execution is successful. If info = -j, the j-th parameter had an illegal value.
If info = 0 the execution is successful . If info = - j the j - th parameter had an illegal value .
trans
Operation
operation op(A) that is non- or (conj.) transpose.
operation op ( A ) that is non - or ( conj . ) transpose .
n
int
number of rows and columns of Aarray[i].
number of rows and columns of Aarray [ i ] .
nrhs
int
number of columns of Barray[i].
number of columns of Barray [ i ] .
Aarray
CudaDeviceVariable<CUdeviceptr>
array of pointers to array, with each array of dim.
array of pointers to array with each array of dim .
lda
int
leading dimension of two-dimensional array used to store
each matrix Aarray[i].
leading dimension of two - dimensional array used to store each matrix Aarray [ i ] .
devIpiv
CudaDeviceVariable<int>
array of size n x batchSize that contains the pivoting
sequence of each factorization of Aarray[i] stored in a
linear fashion. If devIpiv is nil, pivoting for all Aarray[i]
is ignored.
array of size n x batchSize that contains the pivoting sequence of each factorization of Aarray [ i ] stored in a linear fashion . If devIpiv is nil pivoting for all Aarray [ i ] is ignored .
Barray
CudaDeviceVariable<CUdeviceptr>
array of pointers to array, with each array of dim. n
x nrhs with ldb>=max(1,n).
array of pointers to array with each array of dim . n x nrhs with ldb > = max ( 1 n ) .
ldb
int
leading dimension of two-dimensional array used to store
each solution matrix Barray[i].
leading dimension of two - dimensional array used to store each solution matrix Barray [ i ] .
batchSize
int
number of pointers contained in A
number of pointers contained in A