Class CudaSolveNativeMethods.Refactorization
The cuSolverRF library was designed to accelerate solution of sets of linear systems by fast re-factorization when given new coefficients in the same sparsity pattern A_i x_i = f_i
Inheritance
Inherited Members
Namespace: ManagedCuda.CudaSolve
Assembly: CudaSolve.dll
Syntax
public static class Refactorization
Methods
cusolverRfAccessBundledFactorsDevice(cusolverRfHandle, ref Int32, ref CUdeviceptr, ref CUdeviceptr, ref CUdeviceptr)
This routine allows direct access to the lower L and upper U triangular factors stored in the cuSolverRF library handle. The factors are compressed into a single matrix M=(LI)+ U, where the unitary diagonal of L is not stored. It is assumed that a prior call to the cusolverRfRefactor() was done in order to generate these triangular factors.
Declaration
public static cusolverStatus cusolverRfAccessBundledFactorsDevice(cusolverRfHandle handle, ref int nnzM, ref CUdeviceptr Mp, ref CUdeviceptr Mi, ref CUdeviceptr Mx)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Int32 | nnzM | the number of non-zero elements of matrix M. |
| CUdeviceptr | Mp | the array of offsets corresponding to the start of each row in the arrays Mi and Mx. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix $M$. The array size is n+1. |
| CUdeviceptr | Mi | the array of column indices corresponding to the non-zero elements in the matrix M. It is assumed that this array is sorted by row and by column within each row. The array size is nnzM. |
| CUdeviceptr | Mx | the array of values corresponding to the non-zero elements in the matrix M. It is assumed that this array is sorted by row and by column within each row. The array size is nnzM. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfAnalyze(cusolverRfHandle)
This routine performs the appropriate analysis of parallelism available in the LU refactorization depending upon the algorithm chosen by the user.
Declaration
public static cusolverStatus cusolverRfAnalyze(cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchAnalyze(cusolverRfHandle)
This routine performs the appropriate analysis of parallelism available in the batched LU re-factorization.
Declaration
public static cusolverStatus cusolverRfBatchAnalyze(cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchRefactor(cusolverRfHandle)
This routine performs the LU re-factorization
Declaration
public static cusolverStatus cusolverRfBatchRefactor(cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchResetValues(Int32, Int32, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr[], CUdeviceptr, CUdeviceptr, cusolverRfHandle)
This routine updates internal data structures with the values of the new coefficient matrix. It is assumed that the arrays csrRowPtrA, csrColIndA, P and Q have not changed since the last call to the cusolverRfbatch_setup_host routine.
Declaration
public static cusolverStatus cusolverRfBatchResetValues(int batchSize, int n, int nnzA, CUdeviceptr csrRowPtrA, CUdeviceptr csrColIndA, CUdeviceptr[] csrValA_array, CUdeviceptr P, CUdeviceptr Q, cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | batchSize | the number of matrices in batched mode. |
| System.Int32 | n | the number of rows (and columns) of matrix A. |
| System.Int32 | nnzA | the number of non-zero elements of matrix A. |
| CUdeviceptr | csrRowPtrA | the array of offsets corresponding to the start of each row in the arrays csrColIndA and csrValA. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix. The array size is n+1. |
| CUdeviceptr | csrColIndA | the array of column indices corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| CUdeviceptr[] | csrValA_array | array of pointers of size batchSize, each pointer points to the array of values corresponding to the non-zero elements in the matrix. |
| CUdeviceptr | P | the left permutation (often associated with pivoting). The array size in n. |
| CUdeviceptr | Q | the right permutation (often associated with reordering). The array size in n. |
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchSetupHost(Int32, Int32, Int32, Int32[], Int32[], IntPtr[], Int32, Int32[], Int32[], Double[], Int32, Int32[], Int32[], Double[], Int32[], Int32[], cusolverRfHandle)
This routine assembles the internal data structures of the cuSolverRF library for batched operation. It is called after the call to the cusolverRfCreate() routine, and before any other batched routines.
Declaration
public static cusolverStatus cusolverRfBatchSetupHost(int batchSize, int n, int nnzA, int[] h_csrRowPtrA, int[] h_csrColIndA, IntPtr[] h_csrValA_array, int nnzL, int[] h_csrRowPtrL, int[] h_csrColIndL, double[] h_csrValL, int nnzU, int[] h_csrRowPtrU, int[] h_csrColIndU, double[] h_csrValU, int[] h_P, int[] h_Q, cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | batchSize | the number of matrices in the batched mode. |
| System.Int32 | n | the number of rows (and columns) of matrix A. |
| System.Int32 | nnzA | the number of non-zero elements of matrix A. |
| System.Int32[] | h_csrRowPtrA | the array of offsets corresponding to the start of each row in the arrays h_csrColIndA and h_csrValA. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix. The array size is n+1. |
| System.Int32[] | h_csrColIndA | the array of column indices corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| System.IntPtr[] | h_csrValA_array | array of pointers of size batchSize, each pointer points to the array of values corresponding to the non-zero elements in the matrix. |
| System.Int32 | nnzL | the number of non-zero elements of matrix L. |
| System.Int32[] | h_csrRowPtrL | the array of offsets corresponding to the start of each row in the arrays h_csrColIndL and h_csrValL. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix L. The array size is n+1. |
| System.Int32[] | h_csrColIndL | the array of column indices corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| System.Double[] | h_csrValL | the array of values corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| System.Int32 | nnzU | the number of non-zero elements of matrix U. |
| System.Int32[] | h_csrRowPtrU | the array of offsets corresponding to the start of each row in the arrays h_csrColIndU and h_csrValU. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix U. The array size is n+1. |
| System.Int32[] | h_csrColIndU | the array of column indices corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| System.Double[] | h_csrValU | the array of values corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| System.Int32[] | h_P | the left permutation (often associated with pivoting). The array size in n. |
| System.Int32[] | h_Q | the right permutation (often associated with reordering). The array size in n. |
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchSolve(cusolverRfHandle, CUdeviceptr, CUdeviceptr, Int32, Double[], Int32, IntPtr[], Int32)
To solve A_j * x_j = b_j, first we reform the equation by M_j * Q * x_j = P * b_j. Then do refactorization by cusolverRfBatch_Refactor(). Further cusolverRfBatch_Solve() takes over the remaining steps.
Declaration
public static cusolverStatus cusolverRfBatchSolve(cusolverRfHandle handle, CUdeviceptr P, CUdeviceptr Q, int nrhs, double[] Temp, int ldt, IntPtr[] XF_array, int ldxf)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| CUdeviceptr | P | the left permutation (often associated with pivoting). The array size in n. |
| CUdeviceptr | Q | the right permutation (often associated with reordering). The array size in n. |
| System.Int32 | nrhs | the number right-hand-sides to be solved. |
| System.Double[] | Temp | the dense matrix that contains temporary workspace (of size ldt*nrhs). |
| System.Int32 | ldt | the leading dimension of dense matrix Temp (ldt >= n). |
| System.IntPtr[] | XF_array | array of pointers of size batchSize, each pointer points to the dense matrix that contains the right-hand-sides F and solutions X (of size ldxf*nrhs). |
| System.Int32 | ldxf | the leading dimension of dense matrix XF (ldxf >= n). |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfBatchZeroPivot(cusolverRfHandle, Int32[])
The user can query which matrix failed LU refactorization by checking corresponding value in position array. The input parameter position is an integer array of size batchSize.
Declaration
public static cusolverStatus cusolverRfBatchZeroPivot(cusolverRfHandle handle, int[] position)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Int32[] | position | integer array of size batchSize. The value of position(j) reports singularity of matrix Aj, -1 if no structural / numerical zero, k >= 0 if Aj(k,k) is either structural zero or numerical zero. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfCreate(ref cusolverRfHandle)
This routine initializes the cuSolverRF library. It allocates required resources and must be called prior to any other cuSolverRF library routine.
Declaration
public static cusolverStatus cusolverRfCreate(ref cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfDestroy(cusolverRfHandle)
This routine shuts down the cuSolverRF library. It releases acquired resources and must be called after all the cuSolverRF library routines.
Declaration
public static cusolverStatus cusolverRfDestroy(cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfExtractBundledFactorsHost(cusolverRfHandle, ref Int32, ref IntPtr, ref IntPtr, ref IntPtr)
This routine allows direct access to the lower L and upper U triangular factors stored in the cuSolverRF library handle. The factors are compressed into a single matrix M=(LI)+ U, where the unitary diagonal of L is not stored. It is assumed that a prior call to the cusolverRfRefactor() was done in order to generate these triangular factors.
Declaration
public static cusolverStatus cusolverRfExtractBundledFactorsHost(cusolverRfHandle handle, ref int h_nnzM, ref IntPtr h_Mp, ref IntPtr h_Mi, ref IntPtr h_Mx)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Int32 | h_nnzM | the number of non-zero elements of matrix M. |
| System.IntPtr | h_Mp | the array of offsets corresponding to the start of each row in the arrays Mi and Mx. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix $M$. The array size is n+1. |
| System.IntPtr | h_Mi | the array of column indices corresponding to the non-zero elements in the matrix M. It is assumed that this array is sorted by row and by column within each row. The array size is nnzM. |
| System.IntPtr | h_Mx | the array of values corresponding to the non-zero elements in the matrix M. It is assumed that this array is sorted by row and by column within each row. The array size is nnzM. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfExtractSplitFactorsHost(cusolverRfHandle, ref Int32, ref IntPtr, ref IntPtr, ref IntPtr, ref Int32, ref IntPtr, ref IntPtr, ref IntPtr)
This routine extracts lower (L) and upper (U) triangular factors from the cuSolverRF library handle into the host memory. It is assumed that a prior call to the cusolverRfRefactor() was done in order to generate these triangular factors.
Declaration
public static cusolverStatus cusolverRfExtractSplitFactorsHost(cusolverRfHandle handle, ref int h_nnzL, ref IntPtr h_csrRowPtrL, ref IntPtr h_csrColIndL, ref IntPtr h_csrValL, ref int h_nnzU, ref IntPtr h_csrRowPtrU, ref IntPtr h_csrColIndU, ref IntPtr h_csrValU)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Int32 | h_nnzL | the number of non-zero elements of matrix L. |
| System.IntPtr | h_csrRowPtrL | the array of offsets corresponding to the start of each row in the arrays h_Li and h_Lx. This array has also an extra entry at the end that stores the number of nonzero elements in the matrix L. The array size is n+1. |
| System.IntPtr | h_csrColIndL | the array of column indices corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is h_nnzL. |
| System.IntPtr | h_csrValL | the array of values corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is h_nnzL. |
| System.Int32 | h_nnzU | the number of non-zero elements of matrix U. |
| System.IntPtr | h_csrRowPtrU | the array of offsets corresponding to the start of each row in the arrays h_Ui and h_Ux. This array has also an extra entry at the end that stores the number of nonzero elements in the matrix U. The array size is n+1. |
| System.IntPtr | h_csrColIndU | the array of column indices corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is h_nnzU. |
| System.IntPtr | h_csrValU | the array of values corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is h_nnzU. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfGetAlgs(cusolverRfHandle, ref Factorization, ref TriangularSolve)
This routine gets the algorithm used for the refactorization in cusolverRfRefactor() and the triangular solve in cusolverRfSolve(). It may be called once prior to cusolverRfAnalyze() routine.
Declaration
public static cusolverStatus cusolverRfGetAlgs(cusolverRfHandle handle, ref Factorization factAlg, ref TriangularSolve solveAlg)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| Factorization | factAlg | the enumerated algorithm type. |
| TriangularSolve | solveAlg | the enumerated algorithm type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfGetMatrixFormat(cusolverRfHandle, ref MatrixFormat, ref UnitDiagonal)
This routine gets the matrix format used in the cusolverRfSetup(), cusolverRfSetupHost(), cusolverRfResetValues(), cusolverRfExtractBundledFactorsHost() and cusolverRfExtractSplitFactorsHost() routines.
Declaration
public static cusolverStatus cusolverRfGetMatrixFormat(cusolverRfHandle handle, ref MatrixFormat format, ref UnitDiagonal diag)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| MatrixFormat | format | the enumerated matrix format type. |
| UnitDiagonal | diag | the enumerated unit diagonal type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfGetNumericBoostReport(cusolverRfHandle, ref NumericBoostReport)
This routine gets the report whether numeric boosting was used in the cusolverRfRefactor() and cusolverRfSolve() routines.
Declaration
public static cusolverStatus cusolverRfGetNumericBoostReport(cusolverRfHandle handle, ref NumericBoostReport report)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| NumericBoostReport | report | the enumerated boosting report type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfGetNumericProperties(cusolverRfHandle, ref Double, ref Double)
This routine gets the numeric values used for checking for "zero" pivot and for boosting it in the cusolverRfRefactor() and cusolverRfSolve() routines. It may be called multiple times prior to cusolverRfRefactor() and cusolverRfSolve() routines. The numeric boosting will be used only if boost > 0.0.
Declaration
public static cusolverStatus cusolverRfGetNumericProperties(cusolverRfHandle handle, ref double zero, ref double boost)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Double | zero | the value below which zero pivot is flagged. |
| System.Double | boost | the value which is substituted for zero pivot (if the later is flagged). |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfGetResetValuesFastMode(cusolverRfHandle, ref ResetValuesFastMode)
This routine gets the mode used in the cusolverRfResetValues routine.
Declaration
public static cusolverStatus cusolverRfGetResetValuesFastMode(cusolverRfHandle handle, ref ResetValuesFastMode fastMode)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| ResetValuesFastMode | fastMode | the enumerated mode type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfRefactor(cusolverRfHandle)
This routine performs the LU re-factorization
Declaration
public static cusolverStatus cusolverRfRefactor(cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfResetValues(Int32, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, cusolverRfHandle)
This routine updates internal data structures with the values of the new coefficient matrix. It is assumed that the arrays csrRowPtrA, csrColIndA, P and Q have not changed since the last call to the cusolverRfSetup[Host] routine. This assumption reflects the fact that the sparsity pattern of coefficient matrices as well as reordering to minimize fill-in and pivoting remain the same in the set of linear systems
Declaration
public static cusolverStatus cusolverRfResetValues(int n, int nnzA, CUdeviceptr csrRowPtrA, CUdeviceptr csrColIndA, CUdeviceptr csrValA, CUdeviceptr P, CUdeviceptr Q, cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | the number of rows (and columns) of matrix A. |
| System.Int32 | nnzA | the number of non-zero elements of matrix A. |
| CUdeviceptr | csrRowPtrA | the array of offsets corresponding to the start of each row in the arrays csrColIndA and csrValA. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix. The array size is n+1. |
| CUdeviceptr | csrColIndA | the array of column indices corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| CUdeviceptr | csrValA | the array of values corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| CUdeviceptr | P | the left permutation (often associated with pivoting). The array size in n. |
| CUdeviceptr | Q | the right permutation (often associated with reordering). The array size in n. |
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetAlgs(cusolverRfHandle, Factorization, TriangularSolve)
This routine sets the algorithm used for the refactorization in cusolverRfRefactor() and the triangular solve in cusolverRfSolve(). It may be called once prior to cusolverRfAnalyze() routine.
Declaration
public static cusolverStatus cusolverRfSetAlgs(cusolverRfHandle handle, Factorization factAlg, TriangularSolve solveAlg)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| Factorization | factAlg | the enumerated algorithm type. |
| TriangularSolve | solveAlg | the enumerated algorithm type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetMatrixFormat(cusolverRfHandle, MatrixFormat, UnitDiagonal)
This routine sets the matrix format used in the cusolverRfSetup(), cusolverRfSetupHost(), cusolverRfResetValues(), cusolverRfExtractBundledFactorsHost() and cusolverRfExtractSplitFactorsHost() routines.
Declaration
public static cusolverStatus cusolverRfSetMatrixFormat(cusolverRfHandle handle, MatrixFormat format, UnitDiagonal diag)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| MatrixFormat | format | the enumerated matrix format type. |
| UnitDiagonal | diag | the enumerated unit diagonal type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetNumericProperties(cusolverRfHandle, Double, Double)
This routine sets the numeric values used for checking for "zero" pivot and for boosting it in the cusolverRfRefactor() and cusolverRfSolve() routines. It may be called multiple times prior to cusolverRfRefactor() and cusolverRfSolve() routines. The numeric boosting will be used only if boost > 0.0.
Declaration
public static cusolverStatus cusolverRfSetNumericProperties(cusolverRfHandle handle, double zero, double boost)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| System.Double | zero | the value below which zero pivot is flagged. |
| System.Double | boost | the value which is substituted for zero pivot (if the later is flagged). |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetResetValuesFastMode(cusolverRfHandle, ResetValuesFastMode)
This routine sets the mode used in the cusolverRfResetValues routine.
Declaration
public static cusolverStatus cusolverRfSetResetValuesFastMode(cusolverRfHandle handle, ResetValuesFastMode fastMode)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| ResetValuesFastMode | fastMode | the enumerated mode type. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetupDevice(Int32, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, cusolverRfHandle)
This routine assembles the internal data structures of the cuSolverRF library. It is often the first routine to be called after the call to the cusolverRfCreate() routine.
Declaration
public static cusolverStatus cusolverRfSetupDevice(int n, int nnzA, CUdeviceptr csrRowPtrA, CUdeviceptr csrColIndA, CUdeviceptr csrValA, int nnzL, CUdeviceptr csrRowPtrL, CUdeviceptr csrColIndL, CUdeviceptr csrValL, int nnzU, CUdeviceptr csrRowPtrU, CUdeviceptr csrColIndU, CUdeviceptr csrValU, CUdeviceptr P, CUdeviceptr Q, cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | the number of rows (and columns) of matrix A. |
| System.Int32 | nnzA | the number of non-zero elements of matrix A. |
| CUdeviceptr | csrRowPtrA | the array of offsets corresponding to the start of each row in the arrays h_csrColIndA and h_csrValA. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix. The array size is n+1. |
| CUdeviceptr | csrColIndA | the array of column indices corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| CUdeviceptr | csrValA | the array of values corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| System.Int32 | nnzL | the number of non-zero elements of matrix L. |
| CUdeviceptr | csrRowPtrL | the array of offsets corresponding to the start of each row in the arrays h_csrColIndL and h_csrValL. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix L. The array size is n+1. |
| CUdeviceptr | csrColIndL | the array of column indices corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| CUdeviceptr | csrValL | the array of values corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| System.Int32 | nnzU | the number of non-zero elements of matrix U. |
| CUdeviceptr | csrRowPtrU | the array of offsets corresponding to the start of each row in the arrays h_csrColIndU and h_csrValU. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix U. The array size is n+1. |
| CUdeviceptr | csrColIndU | the array of column indices corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| CUdeviceptr | csrValU | the array of values corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| CUdeviceptr | P | the left permutation (often associated with pivoting). The array size in n. |
| CUdeviceptr | Q | the right permutation (often associated with reordering). The array size in n. |
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSetupHost(Int32, Int32, Int32[], Int32[], Double[], Int32, Int32[], Int32[], Double[], Int32, Int32[], Int32[], Double[], Int32[], Int32[], cusolverRfHandle)
This routine assembles the internal data structures of the cuSolverRF library. It is often the first routine to be called after the call to the cusolverRfCreate() routine.
Declaration
public static cusolverStatus cusolverRfSetupHost(int n, int nnzA, int[] h_csrRowPtrA, int[] h_csrColIndA, double[] h_csrValA, int nnzL, int[] h_csrRowPtrL, int[] h_csrColIndL, double[] h_csrValL, int nnzU, int[] h_csrRowPtrU, int[] h_csrColIndU, double[] h_csrValU, int[] h_P, int[] h_Q, cusolverRfHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | the number of rows (and columns) of matrix A. |
| System.Int32 | nnzA | the number of non-zero elements of matrix A. |
| System.Int32[] | h_csrRowPtrA | the array of offsets corresponding to the start of each row in the arrays h_csrColIndA and h_csrValA. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix. The array size is n+1. |
| System.Int32[] | h_csrColIndA | the array of column indices corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| System.Double[] | h_csrValA | the array of values corresponding to the non-zero elements in the matrix. It is assumed that this array is sorted by row and by column within each row. The array size is nnzA. |
| System.Int32 | nnzL | the number of non-zero elements of matrix L. |
| System.Int32[] | h_csrRowPtrL | the array of offsets corresponding to the start of each row in the arrays h_csrColIndL and h_csrValL. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix L. The array size is n+1. |
| System.Int32[] | h_csrColIndL | the array of column indices corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| System.Double[] | h_csrValL | the array of values corresponding to the non-zero elements in the matrix L. It is assumed that this array is sorted by row and by column within each row. The array size is nnzL. |
| System.Int32 | nnzU | the number of non-zero elements of matrix U. |
| System.Int32[] | h_csrRowPtrU | the array of offsets corresponding to the start of each row in the arrays h_csrColIndU and h_csrValU. This array has also an extra entry at the end that stores the number of non-zero elements in the matrix U. The array size is n+1. |
| System.Int32[] | h_csrColIndU | the array of column indices corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| System.Double[] | h_csrValU | the array of values corresponding to the non-zero elements in the matrix U. It is assumed that this array is sorted by row and by column within each row. The array size is nnzU. |
| System.Int32[] | h_P | the left permutation (often associated with pivoting). The array size in n. |
| System.Int32[] | h_Q | the right permutation (often associated with reordering). The array size in n. |
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
Returns
| Type | Description |
|---|---|
| cusolverStatus |
cusolverRfSolve(cusolverRfHandle, CUdeviceptr, CUdeviceptr, Int32, Double[], Int32, Double[], Int32)
This routine performs the forward and backward solve with the lower and upper triangular factors resulting from the LU re-factorization
Declaration
public static cusolverStatus cusolverRfSolve(cusolverRfHandle handle, CUdeviceptr P, CUdeviceptr Q, int nrhs, double[] Temp, int ldt, double[] XF, int ldxf)
Parameters
| Type | Name | Description |
|---|---|---|
| cusolverRfHandle | handle | the pointer to the cuSolverRF library handle. |
| CUdeviceptr | P | the left permutation (often associated with pivoting). The array size in n. |
| CUdeviceptr | Q | the right permutation (often associated with reordering). The array size in n. |
| System.Int32 | nrhs | the number right-hand-sides to be solved. |
| System.Double[] | Temp | the dense matrix that contains temporary workspace (of size ldt*nrhs). |
| System.Int32 | ldt | the leading dimension of dense matrix Temp (ldt >= n). |
| System.Double[] | XF | the dense matrix that contains the righthand-sides F and solutions X (of size ldxf*nrhs). |
| System.Int32 | ldxf | the leading dimension of dense matrix XF (ldxf >= n). |
Returns
| Type | Description |
|---|---|
| cusolverStatus |