/// <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="csrVal">array of nnzA*batchSize nonzero /// elements of matrices A0, A1, .... All matrices are aggregated one after another.</param> /// <param name="csrRowPtr">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="csrColInd">integer array of nnzAcolumn indices of the nonzero elements of each matrix Aj.</param> /// <param name="batchSize">number of systems to be solved.</param> /// <param name="info">opaque structure for QR factorization.</param> /// <param name="internalDataInBytes">number of bytes of the internal data.</param> /// <param name="workspaceInBytes">number of bytes of the buffer in numerical factorization.</param> public void CsrqrBufferInfoBatched(int m, int n, int nnz, CudaSparseMatrixDescriptor descrA, CudaDeviceVariable<cuDoubleComplex> csrVal, CudaDeviceVariable<int> csrRowPtr, CudaDeviceVariable<int> csrColInd, int batchSize, CsrQrInfo info, ref SizeT internalDataInBytes, ref SizeT workspaceInBytes) { res = CudaSolveNativeMethods.Sparse.cusolverSpZcsrqrBufferInfoBatched(_handle, m, n, nnz, descrA.Descriptor, csrVal.DevicePointer, csrRowPtr.DevicePointer, csrColInd.DevicePointer, batchSize, info.Info, ref internalDataInBytes, ref workspaceInBytes); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpZcsrqrBufferInfoBatched", res)); if (res != cusolverStatus.Success) throw new CudaSolveException(res); }
/// <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> 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); }
/// <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="nnzA">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="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="info">opaque structure for QR factorization.</param> public void CsrqrAnalysisBatched(int m, int n, int nnzA, CudaSparseMatrixDescriptor descrA, CudaDeviceVariable<int> csrRowPtrA, CudaDeviceVariable<int> csrColIndA, CsrQrInfo info) { res = CudaSolveNativeMethods.Sparse.cusolverSpXcsrqrAnalysisBatched(_handle, m, n, nnzA, descrA.Descriptor, csrRowPtrA.DevicePointer, csrColIndA.DevicePointer, info.Info); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpXcsrqrAnalysisBatched", res)); if (res != cusolverStatus.Success) throw new CudaSolveException(res); }