コード例 #1
0
        public static cusparseMatDescr DefaultTriangular()
        {
            cusparseMatDescr descr = new cusparseMatDescr();
            descr.MatrixType = cusparseMatrixType.Triangular;
            descr.FillMode = cusparseFillMode.Lower;
            descr.DiagType = cusparseDiagType.NonUnit;
            descr.IndexBase = cusparseIndexBase.Zero;

            return descr;
        }
コード例 #2
0
ファイル: cusparseMatDescr.cs プロジェクト: rblenis/cudafy
        public static cusparseMatDescr DefaultTriangular()
        {
            cusparseMatDescr descr = new cusparseMatDescr();

            descr.MatrixType = cusparseMatrixType.Triangular;
            descr.FillMode   = cusparseFillMode.Lower;
            descr.DiagType   = cusparseDiagType.NonUnit;
            descr.IndexBase  = cusparseIndexBase.Zero;

            return(descr);
        }
コード例 #3
0
ファイル: CudaSPARSE.cs プロジェクト: rblenis/cudafy
        public override int NNZ(int m, int n, double[] A, int[] vector, cusparseMatDescr descrA, cusparseDirection dirA = cusparseDirection.Row, int lda = 0)
        {
            lda = (lda == 0 ? m : lda);

            CUdeviceptr ptra = GetDeviceMemory(A);
            CUdeviceptr ptrv = GetDeviceMemory(vector);

            int nzz = 0;

            LastStatus = _driver.CusparseDnnz(_sparse, dirA, m, n, descrA, ptra.Pointer, lda, ptrv.Pointer, ref nzz);

            return(nzz);
        }
コード例 #4
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDdense2csc(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerCol, IntPtr cscValA, IntPtr cscRowIndA, IntPtr cscColPtrA)
 {
     return cusparseDdense2csc(handle, m, n, descrA, A, lda, nnzPerCol, cscValA, cscRowIndA, cscColPtrA);
 }
コード例 #5
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseSetMatFillMode(cusparseMatDescr descrA, cusparseFillMode fillMode)
 {
     return(cusparseSetMatFillMode(descrA, fillMode));
 }
コード例 #6
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDcsrsv_solve(cusparseHandle handle, cusparseOperation transA, int m, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, cusparseSolveAnalysisInfo info, IntPtr x, IntPtr y)
 {
     return(cusparseDcsrsv_solve_v2(handle, transA, m, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, info, x, y));
 }
コード例 #7
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern cusparseIndexBase cusparseGetMatIndexBase(cusparseMatDescr descrA);
コード例 #8
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseDestroyMatDescr(cusparseMatDescr descrA);
コード例 #9
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern cusparseFillMode cusparseGetMatFillMode(cusparseMatDescr descrA);
コード例 #10
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDcsrsv_analysis(cusparseHandle handle, cusparseOperation transA, int m, int nnz, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, cusparseSolveAnalysisInfo info)
 {
     return cusparseDcsrsv_analysis_v2(handle, transA, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, info); ;
 }
コード例 #11
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseCreateMatDescr(ref cusparseMatDescr descrA);
コード例 #12
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDcsrmv(cusparseHandle handle, cusparseOperation transA, int m, int n, int nnz, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr x, ref double beta, IntPtr y)
 {
     return cusparseDcsrmv_v2(handle, transA, m, n, nnz, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, x, ref beta, y);
 }
コード例 #13
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseSetMatFillMode(cusparseMatDescr descrA, cusparseFillMode fillMode);
コード例 #14
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern cusparseMatrixType cusparseGetMatType(cusparseMatDescr descrA);
コード例 #15
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseSetMatType(cusparseMatDescr descrA, cusparseMatrixType type);
コード例 #16
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseDestroyMatDescr(cusparseMatDescr descrA);
コード例 #17
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseSetMatDiagType(cusparseMatDescr descrA, cusparseDiagType diagType)
 {
     return(cusparseSetMatDiagType(descrA, diagType));
 }
コード例 #18
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDcsrsv_solve(cusparseHandle handle, cusparseOperation transA, int m, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, cusparseSolveAnalysisInfo info, IntPtr x, IntPtr y)
 {
     return cusparseDcsrsv_solve_v2(handle, transA, m, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, info, x, y);
 }
コード例 #19
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseSetMatIndexBase(cusparseMatDescr descrA, cusparseIndexBase ibase)
 {
     return(cusparseSetMatIndexBase(descrA, ibase));
 }
コード例 #20
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern cusparseFillMode cusparseGetMatFillMode(cusparseMatDescr descrA);
コード例 #21
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDdense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerRow, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA)
 {
     return(cusparseDdense2csr(handle, m, n, descrA, A, lda, nnzPerRow, csrValA, csrRowPtrA, csrColIndA));
 }
コード例 #22
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDcsrmm(cusparseHandle handle, cusparseOperation transA, int m, int n, int k, int nnz, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr B, int ldb, ref double beta, IntPtr C, int ldc)
 {
     return cusparseDcsrmm_v2(handle, transA, m, n, k, nnz, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, B, ldb, ref beta, C, ldc);
 }
コード例 #23
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 public CUSPARSEStatus CusparseDcsc2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr cscValA, IntPtr cscRowIndA, IntPtr cscColPtrA, IntPtr A, int lda)
 {
     return cusparseDcsc2dense(handle, m, n, descrA, cscValA, cscRowIndA, cscColPtrA, A, lda);
 }
コード例 #24
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseSetMatDiagType(cusparseMatDescr descrA, cusparseDiagType diagType);
コード例 #25
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseSetMatDiagType(cusparseMatDescr descrA, cusparseDiagType diagType);
コード例 #26
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern cusparseDiagType cusparseGetMatDiagType(cusparseMatDescr descrA);
コード例 #27
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDcsrmm(cusparseHandle handle, cusparseOperation transA, int m, int n, int k, int nnz, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr B, int ldb, ref double beta, IntPtr C, int ldc)
 {
     return(cusparseDcsrmm_v2(handle, transA, m, n, k, nnz, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, B, ldb, ref beta, C, ldc));
 }
コード例 #28
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseSetMatIndexBase(cusparseMatDescr descrA, cusparseIndexBase ibase);
コード例 #29
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseDdense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerRow, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA);
コード例 #30
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern cusparseIndexBase cusparseGetMatIndexBase(cusparseMatDescr descrA);
コード例 #31
0
 /// <summary>
 /// Performs matrix-matrix operations. A is CSR format matrix and B, C is dense format.
 /// C = alpha * op(A) * B + beta * C
 /// </summary>
 /// <param name="m">number of rows of matrix A; m must be at least zero.</param>
 /// <param name="k">number of columns of matrix A; k must be at least zero.</param>
 /// <param name="n">number of columns of matrices B and C; n must be at least zero.</param>
 /// <param name="nnz">number of non-zero elements of matrix A.</param>
 /// <param name="alpha">scalar multiplier applied to op(A) * B.</param>
 /// <param name="csrValA">array of nnz elements, where nnz is the number of non-zero elements and can be obtained from csrRowA[m] - csrRowA[0].</param>
 /// <param name="csrRowA">array of m+1 index elements.</param>
 /// <param name="csrColA">array of nnz column indices.</param>
 /// <param name="B">array of dimension (ldb, n).</param>
 /// <param name="beta">scalar multiplier applied to C. If beta is zero, C does not have to be a valid input.</param>
 /// <param name="C">array of dimension (ldc, n).</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="op">specifies op(A).</param>
 /// <param name="ldb">leading dimension of B.</param>
 /// <param name="ldc">leading dimension of C.</param>
 public abstract void CSRMM(int m, int k, int n, int nnz, ref double alpha, double[] csrValA, int[] csrRowA, int[] csrColA, double[] B, ref double beta, double[] C, cusparseMatDescr descrA, cusparseOperation op = cusparseOperation.NonTranspose, int ldb = 0, int ldc = 0);
コード例 #32
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseDnnz(cusparseHandle handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzperVector, ref int nnzHostPtr);
コード例 #33
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public cusparseFillMode CusparseGetMatFillMode(cusparseMatDescr descrA)
 {
     return(cusparseGetMatFillMode(descrA));
 }
コード例 #34
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseDdense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerRow, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA);
コード例 #35
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public cusparseDiagType CusparseGetMatDiagType(cusparseMatDescr descrA)
 {
     return(cusparseGetMatDiagType(descrA));
 }
コード例 #36
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseDcsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr A, int lda);
コード例 #37
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public cusparseIndexBase CusparseGetMatIndexBase(cusparseMatDescr descrA)
 {
     return(cusparseGetMatIndexBase(descrA));
 }
コード例 #38
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseDdense2csc(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerCol, IntPtr cscValA, IntPtr cscRowIndA, IntPtr cscColPtrA);
コード例 #39
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDnnz(cusparseHandle handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerVector, ref int nnzHostPtr)
 {
     return(cusparseDnnz(handle, dirA, m, n, descrA, A, lda, nnzPerVector, ref nnzHostPtr));
 }
コード例 #40
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDcsc2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr cscValA, IntPtr cscRowIndA, IntPtr cscColPtrA, IntPtr A, int lda)
 {
     return(cusparseDcsc2dense(handle, m, n, descrA, cscValA, cscRowIndA, cscColPtrA, A, lda));
 }
コード例 #41
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseScsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr A, int lda)
 {
     return(cusparseScsr2dense(handle, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, A, lda));
 }
コード例 #42
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern cusparseMatrixType cusparseGetMatType(cusparseMatDescr descrA);
コード例 #43
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDdense2csc(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzPerCol, IntPtr cscValA, IntPtr cscRowIndA, IntPtr cscColPtrA)
 {
     return(cusparseDdense2csc(handle, m, n, descrA, A, lda, nnzPerCol, cscValA, cscRowIndA, cscColPtrA));
 }
コード例 #44
0
ファイル: CUSPARSEDriver.cs プロジェクト: JustasB/cudafy
 private static extern CUSPARSEStatus cusparseCreateMatDescr(ref cusparseMatDescr descrA);
コード例 #45
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseSetMatType(cusparseMatDescr descrA, cusparseMatrixType type);
コード例 #46
0
 /// <summary>
 /// Computes the number of non-zero elements per row or column and the total number of non-zero elements.
 /// </summary>
 /// <param name="m">number of rows of the matrix A; m must be at least zero.</param>
 /// <param name="n">number of columns of the matrix A; n must be at least zero.</param>
 /// <param name="A">array of dimension (lda, n)</param>
 /// <param name="vector">array of size m or n containing the number of non-zero elements per row or column, respectively.</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="dirA">indicates whether to count the number of non-zero elements per row or per column, respectively.</param>
 /// <param name="lda">leading dimension of A. If lda is 0, automatically be m.</param>
 /// <returns>total number of non-zero elements.</returns>
 public abstract int NNZ(int m, int n, double[] A, int[] vector, cusparseMatDescr descrA, cusparseDirection dirA = cusparseDirection.Row, int lda = 0);
コード例 #47
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseSetMatFillMode(cusparseMatDescr descrA, cusparseFillMode fillMode);
コード例 #48
0
 /// <summary>
 /// Converts the matrix A in dense format into a matrix in CSR format. All the parameters are pre-allocated by the user, and the arrays are filled in based on nnzPerRow.
 /// </summary>
 /// <param name="m">number of rows of the matrix A; m must be at least zero.</param>
 /// <param name="n">number of columns of the matrix A; n must be at least zero.</param>
 /// <param name="A">array of dimension (lda, n)</param>
 /// <param name="nnzPerRow">array of size m containing the number of non-zero elements per row.</param>
 /// <param name="csrValA">array of nnz elements to be filled.</param>
 /// <param name="csrRowA">array of m+1 index elements.</param>
 /// <param name="csrColIndA">array of nnz column indices, corresponding to the non-zero elements in the matrix.</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="lda">leading dimension of A. If lda is 0, automatically be m.</param>
 public abstract void Dense2CSR(int m, int n, double[] A, int[] nnzPerRow, double[] csrValA, int[] csrRowA, int[] csrColIndA, cusparseMatDescr descrA, int lda = 0);
コード例 #49
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDcsrmv(cusparseHandle handle, cusparseOperation transA, int m, int n, int nnz, ref double alpha, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr x, ref double beta, IntPtr y)
 {
     return(cusparseDcsrmv_v2(handle, transA, m, n, nnz, ref alpha, descrA, csrValA, csrRowPtrA, csrColIndA, x, ref beta, y));
 }
コード例 #50
0
 /// <summary>
 /// Converts the matrix in CSR format defined by the three arrays csrValA, csrRowA and csrColA into a matrix A in dense format.
 /// </summary>
 /// <param name="m">number of rows of the matrix A; m must be at least zero.</param>
 /// <param name="n">number of columns of the matrix A; n must be at least zero.</param>
 /// <param name="csrValA">array of nnz elements, where nnz is the number of non-zero elements and can be obtained from csrRowA[m] - csrRowA[0].</param>
 /// <param name="csrRowsA">array of m+1 index elements.</param>
 /// <param name="csrColsA">array of nnz column indices.</param>
 /// <param name="A">array of dimension (lda, n)</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="lda">leading dimension of A. If lda is 0, automatically be m.</param>
 public abstract void CSR2Dense(int m, int n, float[] csrValA, int[] csrRowA, int[] csrColA, float[] A, cusparseMatDescr descrA, int lda = 0);
コード例 #51
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 public CUSPARSEStatus CusparseDcsrsv_analysis(cusparseHandle handle, cusparseOperation transA, int m, int nnz, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, cusparseSolveAnalysisInfo info)
 {
     return(cusparseDcsrsv_analysis_v2(handle, transA, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, info));;
 }
コード例 #52
0
 /// <summary>
 /// Converts the matrix A in dense format into a matrix in CSC format. All the parameters are pre-allocated by the user, and the arrays are filled in based nnzPerCol.
 /// </summary>
 /// <param name="m">number of rows of the matrix A; m must be at least zero.</param>
 /// <param name="n">number of columns of the matrix A; n must be at least zero.</param>
 /// <param name="A">array of dimension (lda, n)</param>
 /// <param name="nnzPerCol">>array of size m containing the number of non-zero elements per column.</param>
 /// <param name="cscValA">array of nnz elements to be filled.</param>
 /// <param name="cscRowIndA">array of nnz row indices, corresponding to the non-zero elements in the matrix.</param>
 /// <param name="cscColA">array of n+1 index elements.</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="lda">leading dimension of A. If lda is 0, automatically be m.</param>
 public abstract void Dense2CSC(int m, int n, double[] A, int[] nnzPerCol, double[] cscValA, int[] cscRowIndA, int[] cscColA, cusparseMatDescr descrA, int lda = 0);
コード例 #53
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern cusparseDiagType cusparseGetMatDiagType(cusparseMatDescr descrA);
コード例 #54
0
 /// <summary>
 /// Converts the matrix in CSC format defined by the three arrays cscValA, cscColA and cscRowA into matrix A in dense format. The dense matrix A is filled in with the values of the sparse matrix and with zeros elsewhere.
 /// </summary>
 /// <param name="m">number of rows of the matrix A; m must be at least zero.</param>
 /// <param name="n">number of columns of the matrix A; n must be at least zero.</param>
 /// <param name="cscValA">array of nnz elements, where nnz is the number of non-zero elements and can be obtained from csrColA[m] - csrColA[0].</param>
 /// <param name="cscRowA">array of nnz row indices.</param>
 /// <param name="cscColA">array of n+1 index elements.</param>
 /// <param name="A">array of dimension (lda, n)</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="lda">leading dimension of A. If lda is 0, automatically be m.</param>
 public abstract void CSC2Dense(int m, int n, double[] cscValA, int[] cscRowA, int[] cscColA, double[] A, cusparseMatDescr descrA, int lda = 0);
コード例 #55
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseSetMatIndexBase(cusparseMatDescr descrA, cusparseIndexBase ibase);
コード例 #56
0
 /// <summary>
 /// Performs one of the matrix-vector operations.
 /// y = alpha * op(A) * x + beta * y
 /// </summary>
 /// <param name="m">specifies the number of rows of matrix A; m mmust be at least zero.</param>
 /// <param name="n">specifies the number of columns of matrix A; n mmust be at least zero.</param>
 /// <param name="nnz">number of non-zero elements of matrix A.</param>
 /// <param name="alpha">scalar multiplier applied to op(A) * x.</param>
 /// <param name="csrValA">array of nnz elements, where nnz is the number of non-zero elements and can be ontained from csrRow[m] - csrRow[0].</param>
 /// <param name="csrRowA">array of m+1 index elements.</param>
 /// <param name="csrColA">array of nnz column indices.</param>
 /// <param name="x">vector of n elements if op(A) = A, and m elements if op(A) = transpose(A).</param>
 /// <param name="beta">scalar multiplier applied to y. If beta is zero, y does not have to be a valid input.</param>
 /// <param name="y">vector of m elements if op(A) = A, and n elements if op(A) = transpose(A).</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 /// <param name="op">specifies op(A).</param>
 public abstract void CSRMV(int m, int n, int nnz, ref double alpha, double[] csrValA, int[] csrRowA, int[] csrColA, double[] x, ref double beta, double[] y, cusparseMatDescr descrA, cusparseOperation op = cusparseOperation.NonTranspose);
コード例 #57
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseDnnz(cusparseHandle handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzperVector, ref int nnzHostPtr);
コード例 #58
0
 /// <summary>
 /// Performs the analysis phase of the solution of a sparse triangular linear system.
 /// op(A) * y = alpha * x
 /// </summary>
 /// <param name="m">specifies the number of rows and columns of matrix A; m must be at least zero.</param>
 /// <param name="nnz">number of non-zero elements of matrix A.</param>
 /// <param name="csrValA">array of nnz elements, where nnz is the number of non-zero elements and can be obtained from csrRow[m] - csrRow[0].</param>
 /// <param name="csrRowA">array of m+1 index elements.</param>
 /// <param name="csrColA">array of nnz column indices.</param>
 /// <param name="op">specifies op(A).</param>
 /// <param name="info">structure that stores the information collected during the analysis phase. It should be passed to the solve phase unchanged.</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 public abstract void CSRSV_ANALYSIS(int m, int nnz, double[] csrValA, int[] csrRowA, int[] csrColA, cusparseOperation op, cusparseSolveAnalysisInfo info, cusparseMatDescr descrA);
コード例 #59
0
ファイル: CUSPARSEDriver.cs プロジェクト: ingted/Cudafy
 private static extern CUSPARSEStatus cusparseDcsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, IntPtr csrValA, IntPtr csrRowPtrA, IntPtr csrColIndA, IntPtr A, int lda);
コード例 #60
0
 /// <summary>
 /// Performs the solve phase of the solution of a sparse triangular linear system.
 /// op(A) * y = alpha * x
 /// </summary>
 /// <param name="m">specifies the number of rows and columns of matrix A; m must be at least zero.</param>
 /// <param name="alpha">scalar multiplier applied to x.</param>
 /// <param name="csrValA">array of nnz elements, where nnz is the number of non-zero elements and can be obtained from csrRow[m] - csrRow[0].</param>
 /// <param name="csrRowA">array of m+1 index elements.</param>
 /// <param name="csrColA">array of nnz column indices.</param>
 /// <param name="x">vector of m elements.</param>
 /// <param name="y">vector of m elements. updated according to op(A) * y = alpha * x</param>
 /// <param name="op">specifies op(A).</param>
 /// <param name="info">structure that stores the information collected during the analysis phase. It should be passed to the solve phase unchanged.</param>
 /// <param name="descrA">descriptor of matrix A.</param>
 public abstract void CSRSV_SOLVE(int m, ref double alpha, double[] csrValA, int[] csrRowA, int[] csrColA, double[] x, double[] y, cusparseOperation op, cusparseSolveAnalysisInfo info, cusparseMatDescr descrA);