Library/ManagedCuda/CudaBlas/CudaBlasHandler.cs
/// <summary>
/// Aarray and Carray are arrays of pointers to matrices stored in column-major format
/// with dimensions n*n and leading dimension lda and ldc respectively.
/// This function performs the inversion of matrices A[i] for i = 0, ..., batchSize-1.<para/>
/// Prior to calling GetriBatched, the matrix A[i] must be factorized first using
/// the routine GetrfBatched. After the call of GetrfBatched, the matrix
/// pointing by Aarray[i] will contain the LU factors of the matrix A[i] and the vector
/// pointing by (PivotArray+i) will contain the pivoting sequence.<para/>
/// Following the LU factorization, GetriBatched uses forward and backward
/// triangular solvers to complete inversion of matrices A[i] for i = 0, ..., batchSize-1. The
/// inversion is out-of-place, so memory space of Carray[i] cannot overlap memory space of
/// Array[i].
/// </summary>
/// <param name="n">number of rows and columns of Aarray[i].</param>
/// <param name="Aarray">array of pointers to array, with each array of dimension n*n with lda>=max(1,n).</param>
/// <param name="lda">leading dimension of two-dimensional array used to store each matrix Aarray[i].</param>
/// <param name="P">array of size n*batchSize that contains the pivoting sequence of each factorization of Aarray[i] stored in a linear fashion.</param>
/// <param name="Carray">array of pointers to array, with each array of dimension n*n with ldc>=max(1,n).</param>
/// <param name="ldc">leading dimension of two-dimensional array used to store each matrix Carray[i].</param>
/// <param name="INFO">array of size batchSize that info(=infoArray[i]) contains the information of inversion of A[i].<para/>
/// If info=0, the execution is successful.<para/>
/// If info = k, U(k,k) is 0. The U is exactly singular and the inversion failed.</param>
/// <param name="batchSize">number of pointers contained in A</param>
Aarray and Carray are arrays of pointers to matrices stored in column-major format
with dimensions n*n and leading dimension lda and ldc respectively.
This function performs the inversion of matrices A[i] for i = 0, ..., batchSize-1.
Prior to calling GetriBatched, the matrix A[i] must be factorized first using
the routine GetrfBatched. After the call of GetrfBatched, the matrix
pointing by Aarray[i] will contain the LU factors of the matrix A[i] and the vector
pointing by (PivotArray+i) will contain the pivoting sequence.
Following the LU factorization, GetriBatched uses forward and backward
triangular solvers to complete inversion of matrices A[i] for i = 0, ..., batchSize-1. The
inversion is out-of-place, so memory space of Carray[i] cannot overlap memory space of
Array[i].
Aarray and Carray are arrays of pointers to matrices stored in column - major format with dimensions n * n and leading dimension lda and ldc respectively . This function performs the inversion of matrices A [ i ] for i = 0 ... batchSize - 1 . Prior to calling GetriBatched the matrix A [ i ] must be factorized first using the routine GetrfBatched . After the call of GetrfBatched the matrix pointing by Aarray [ i ] will contain the LU factors of the matrix A [ i ] and the vector pointing by ( PivotArray + i ) will contain the pivoting sequence . Following the LU factorization GetriBatched uses forward and backward triangular solvers to complete inversion of matrices A [ i ] for i = 0 ... batchSize - 1 . The inversion is out - of - place so memory space of Carray [ i ] cannot overlap memory space of Array [ i ] .
public void GetriBatchedS(int n, CudaDeviceVariable<CUdeviceptr> Aarray, int lda, CudaDeviceVariable<int> P,
			CudaDeviceVariable<CUdeviceptr> Carray, int ldc, CudaDeviceVariable<int> INFO, int batchSize)
		{
			_status = CudaBlasNativeMethods.cublasSgetriBatched(_blasHandle, n, Aarray.DevicePointer, lda, P.DevicePointer, Carray.DevicePointer, ldc, INFO.DevicePointer, batchSize);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cublasSgetriBatched", _status));
			if (_status != CublasStatus.Success) throw new CudaBlasException(_status);
		}
public void GetriBatchedS ( int n , CudaDeviceVariable < CUdeviceptr > Aarray , int lda , CudaDeviceVariable < int > P , CudaDeviceVariable < CUdeviceptr > Carray , int ldc , CudaDeviceVariable < int > INFO , int batchSize ) { _status = CudaBlasNativeMethods . cublasSgetriBatched ( _blasHandle , n , Aarray . DevicePointer , lda , P . DevicePointer , Carray . DevicePointer , ldc , INFO . DevicePointer , batchSize ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , _status ) ) ; if ( _status != CublasStatus . Success ) throw new CudaBlasException ( _status ) ; }
Aarray and Carray are arrays of pointers to matrices stored in column-major format
with dimensions n*n and leading dimension lda and ldc respectively.
Aarray and Carray are arrays of pointers to matrices stored in column - major format with dimensions n * n and leading dimension lda and ldc respectively .
n
int
number of rows and columns of Aarray[i].
number of rows and columns of Aarray [ i ] .
Aarray
CudaDeviceVariable<CUdeviceptr>
array of pointers to array, with each array of dimension n*n with lda>=max(1,n).
array of pointers to array with each array of dimension n * n with lda > = max ( 1 n ) .
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 ] .
P
CudaDeviceVariable<int>
array of size n*batchSize that contains the pivoting sequence of each factorization of Aarray[i] stored in a linear fashion.
array of size n * batchSize that contains the pivoting sequence of each factorization of Aarray [ i ] stored in a linear fashion .
Carray
CudaDeviceVariable<CUdeviceptr>
array of pointers to array, with each array of dimension n*n with ldc>=max(1,n).
array of pointers to array with each array of dimension n * n with ldc > = max ( 1 n ) .
ldc
int
leading dimension of two-dimensional array used to store each matrix Carray[i].
leading dimension of two - dimensional array used to store each matrix Carray [ i ] .
INFO
CudaDeviceVariable<int>
array of size batchSize that info(=infoArray[i]) contains the information of inversion of A[i].
If info=0, the execution is successful.
array of size batchSize that info ( = infoArray [ i ] ) contains the information of inversion of A [ i ] . If info = 0 the execution is successful .
batchSize
int
number of pointers contained in A
number of pointers contained in A