Library/ManagedCuda/CudaSolve/CudaSolveSparse.cs
/// <summary>
/// The batched sparse QR factorization is used to solve either a set of least-squares
/// problems or a set of linear systems
/// </summary>
/// <param name="m">number of rows of each matrix Aj.</param>
/// <param name="n">number of columns of each matrix Aj.</param>
/// <param name="nnz">number of nonzeros of each matrix Aj. It is the size csrColIndA.</param>
/// <param name="descrA">the descriptor of matrix A. The supported matrix type is
/// CUSPARSE_MATRIX_TYPE_GENERAL. Also, the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE.</param>
/// <param name="csrValA">array of nnzA*batchSize nonzero 
/// elements of matrices A0, A1, .... All matrices are aggregated one after another.</param>
/// <param name="csrRowPtrA">integer array of m+1 elements that contains the
/// start of every row and the end of the last row plus one.</param>
/// <param name="csrColIndA">integer array of nnzAcolumn indices of the nonzero elements of each matrix Aj.</param>
/// <param name="b">array of m*batchSize of right-hand-side vectors b0, b1, .... All vectors are aggregated one after another.</param>
/// <param name="x">array of m*batchSize of solution vectors x0, x1, .... All vectors are aggregated one after another.</param>
/// <param name="batchSize">number of systems to be solved.</param>
/// <param name="info">opaque structure for QR factorization.</param>
/// <param name="pBuffer">buffer allocated by the user, the size is returned
/// by cusolverSpXcsrqrBufferInfoBatched().</param>
The batched sparse QR factorization is used to solve either a set of least-squares
problems or a set of linear systems
The batched sparse QR factorization is used to solve either a set of least - squares problems or a set of linear systems
public void CsrqrsvBatched(int m, int n, int nnz, CudaSparseMatrixDescriptor descrA, CudaDeviceVariable<cuDoubleComplex> csrValA, CudaDeviceVariable<int> csrRowPtrA, CudaDeviceVariable<int> csrColIndA, CudaDeviceVariable<cuDoubleComplex> b, CudaDeviceVariable<cuDoubleComplex> x, int batchSize, CsrQrInfo info, CudaDeviceVariable<byte> pBuffer)
		{
			res = CudaSolveNativeMethods.Sparse.cusolverSpZcsrqrsvBatched(_handle, m, n, nnz, descrA.Descriptor, csrValA.DevicePointer, csrRowPtrA.DevicePointer, csrColIndA.DevicePointer, b.DevicePointer, x.DevicePointer, batchSize, info.Info, pBuffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpZcsrqrsvBatched", res));
			if (res != cusolverStatus.Success) throw new CudaSolveException(res);
		}
public void CsrqrsvBatched ( int m , int n , int nnz , CudaSparseMatrixDescriptor descrA , CudaDeviceVariable < cuDoubleComplex > csrValA , CudaDeviceVariable < int > csrRowPtrA , CudaDeviceVariable < int > csrColIndA , CudaDeviceVariable < cuDoubleComplex > b , CudaDeviceVariable < cuDoubleComplex > x , int batchSize , CsrQrInfo info , CudaDeviceVariable < byte > pBuffer ) { res = CudaSolveNativeMethods . Sparse . cusolverSpZcsrqrsvBatched ( _handle , m , n , nnz , descrA . Descriptor , csrValA . DevicePointer , csrRowPtrA . DevicePointer , csrColIndA . DevicePointer , b . DevicePointer , x . DevicePointer , batchSize , info . Info , pBuffer . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cusolverStatus . Success ) throw new CudaSolveException ( res ) ; }
The batched sparse QR factorization is used to solve either a set of least-squares
problems or a set of linear systems
The batched sparse QR factorization is used to solve either a set of least - squares problems or a set of linear systems
m
int
number of rows of each matrix Aj.
number of rows of each matrix Aj .
n
int
number of columns of each matrix Aj.
number of columns of each matrix Aj .
nnz
int
number of nonzeros of each matrix Aj. It is the size csrColIndA.
number of nonzeros of each matrix Aj . It is the size csrColIndA .
descrA
CudaSparseMatrixDescriptor
the descriptor of matrix A. The supported matrix type is
CUSPARSE_MATRIX_TYPE_GENERAL. Also, the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE.
the descriptor of matrix A . The supported matrix type is CUSPARSE_MATRIX_TYPE_GENERAL . Also the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE .
csrValA
CudaDeviceVariable<cuDoubleComplex>
array of nnzA*batchSize nonzero
elements of matrices A0, A1, .... All matrices are aggregated one after another.
array of nnzA * batchSize nonzero elements of matrices A0 A1 .... All matrices are aggregated one after another .
csrRowPtrA
CudaDeviceVariable<int>
integer array of m+1 elements that contains the
start of every row and the end of the last row plus one.
integer array of m + 1 elements that contains the start of every row and the end of the last row plus one .
csrColIndA
CudaDeviceVariable<int>
integer array of nnzAcolumn indices of the nonzero elements of each matrix Aj.
integer array of nnzAcolumn indices of the nonzero elements of each matrix Aj .
b
CudaDeviceVariable<cuDoubleComplex>
array of m*batchSize of right-hand-side vectors b0, b1, .... All vectors are aggregated one after another.
array of m * batchSize of right - hand - side vectors b0 b1 .... All vectors are aggregated one after another .
x
CudaDeviceVariable<cuDoubleComplex>
array of m*batchSize of solution vectors x0, x1, .... All vectors are aggregated one after another.
array of m * batchSize of solution vectors x0 x1 .... All vectors are aggregated one after another .
batchSize
int
number of systems to be solved.
number of systems to be solved .
info
CsrQrInfo
opaque structure for QR factorization.
opaque structure for QR factorization .
pBuffer
CudaDeviceVariable<byte>
buffer allocated by the user, the size is returned
by cusolverSpXcsrqrBufferInfoBatched().
buffer allocated by the user the size is returned by cusolverSpXcsrqrBufferInfoBatched () .