public static extern cusparseStatus cusparseCbsric02(cusparseContext handle,
											  cusparseDirection dirA,
											  int mb,
											  int nnzb,
											  cusparseMatDescr descrA,
											  CUdeviceptr bsrVal,
											  CUdeviceptr bsrRowPtr,
											  CUdeviceptr bsrColInd,
											  int blockDim,
											  bsric02Info info,
											  cusparseSolvePolicy policy,
											  CUdeviceptr pBuffer);
        public static extern cusparseStatus cusparseCbsr2csr(cusparseContext handle,
											cusparseDirection dirA,
											int mb,
											int nb,
											cusparseMatDescr descrA,
											CUdeviceptr bsrValA,
											CUdeviceptr bsrRowPtrA,
											CUdeviceptr bsrColIndA,
											int blockDim,
											cusparseMatDescr descrC,
											CUdeviceptr csrValC,
											CUdeviceptr csrRowPtrC,
											CUdeviceptr csrColIndC);
		public static extern cusparseStatus cusparseZnnz(cusparseContext handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, CUdeviceptr A, int lda, CUdeviceptr nnzPerRowCol, CUdeviceptr nnzTotalDevHostPtr);
		public static extern cusparseStatus cusparseZbsric02_bufferSize(cusparseContext handle,
														 cusparseDirection dirA,
														 int mb,
														 int nnzb,
														 cusparseMatDescr descrA,
														 CUdeviceptr bsrVal,
														 CUdeviceptr bsrRowPtr,
														 CUdeviceptr bsrColInd,
														 int blockDim,
														 bsric02Info info,
														 ref int pBufferSize);
		public static extern cusparseStatus cusparseZbsrsm2_solve(cusparseContext handle,
												   cusparseDirection dirA,
												   cusparseOperation transA,
												   cusparseOperation transXY,
												   int mb,
												   int n,
												   int nnzb,
												   CUdeviceptr alpha,
												   cusparseMatDescr descrA,
												   CUdeviceptr bsrVal,
												   CUdeviceptr bsrRowPtr,
												   CUdeviceptr bsrColInd,
												   int blockSize,
												   bsrsm2Info info,
												   CUdeviceptr X,
												   int ldx,
												   CUdeviceptr Y,
												   int ldy,
												   cusparseSolvePolicy policy,
												   CUdeviceptr pBuffer);
		public static extern cusparseStatus cusparseZgebsr2gebsr(cusparseContext handle,
												  cusparseDirection dirA,
												  int mb,
												  int nb,
												  int nnzb,
												  cusparseMatDescr descrA,
												  CUdeviceptr bsrValA,
												  CUdeviceptr bsrRowPtrA,
												  CUdeviceptr bsrColIndA,
												  int rowBlockDimA,
												  int colBlockDimA,
												  cusparseMatDescr descrC,
												  CUdeviceptr bsrValC,
												  CUdeviceptr bsrRowPtrC,
												  CUdeviceptr bsrColIndC,
												  int rowBlockDimC,
												  int colBlockDimC,
												  CUdeviceptr pBuffer);
		public static extern cusparseStatus cusparseCgebsr2gebsr_bufferSizeExt(cusparseContext handle,
															 cusparseDirection dirA,
															 int mb,
															 int nb,
															 int nnzb,
															 cusparseMatDescr descrA,
															 CUdeviceptr bsrValA,
															 CUdeviceptr bsrRowPtrA,
															 CUdeviceptr bsrColIndA,
															 int rowBlockDimA,
															 int colBlockDimA,
															 int rowBlockDimC,
															 int colBlockDimC,
															 ref SizeT pBufferSize);
		public static extern cusparseStatus cusparseZbsrxmv(cusparseContext handle,
											cusparseDirection dirA,
											cusparseOperation transA,
											int sizeOfMask,
											int mb,
											int nb,
											int nnzb,
											CUdeviceptr alpha,
											cusparseMatDescr descrA,
											CUdeviceptr bsrValA,
											CUdeviceptr bsrMaskPtrA,
											CUdeviceptr bsrRowPtrA,
											CUdeviceptr bsrEndPtrA,
											CUdeviceptr bsrColIndA,
											int blockDim,
											CUdeviceptr x,
											CUdeviceptr beta,
											CUdeviceptr y);
 /// <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="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 int NNZ(int m, int n, double[] A, int[] vector, cusparseDirection dirA = cusparseDirection.Row, int lda = 0)
 {
     return NNZ(m, n, A, vector, defaultMatDescr, dirA, lda);
 }
Exemple #10
0
        public override int NNZ(int m, int n, float[] 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.CusparseSnnz(_sparse, dirA, m, n, descrA, ptra.Pointer, lda, ptrv.Pointer, ref nzz);

            return(nzz);
        }
 private static extern CUSPARSEStatus cusparseDnnz(cusparseHandle handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzperVector, ref int nnzHostPtr);
 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));
 }
Exemple #13
0
 private static extern CUSPARSEStatus cusparseDnnz(cusparseHandle handle, cusparseDirection dirA, int m, int n, cusparseMatDescr descrA, IntPtr A, int lda, IntPtr nnzperVector, ref int nnzHostPtr);
Exemple #14
0
 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);
 }
		public static extern cusparseStatus cusparseXcsr2bsrNnz(cusparseContext handle,
											cusparseDirection dirA,
											int m,
											int n,
											cusparseMatDescr descrA,
											CUdeviceptr csrRowPtrA,
											CUdeviceptr csrColIndA,
											int blockDim,
											cusparseMatDescr descrC,
											CUdeviceptr bsrRowPtrC,
											ref int nnzTotalDevHostPtr);
		public static extern cusparseStatus cusparseZbsrmv(cusparseContext handle,
											cusparseDirection dirA,
											cusparseOperation transA,
											int mb,
											int nb,
											int nnzb,
											ref cuDoubleComplex alpha,
											cusparseMatDescr descrA,
											CUdeviceptr bsrValA,
											CUdeviceptr bsrRowPtrA,
											CUdeviceptr bsrColIndA,
											int blockDim,
											CUdeviceptr x,
											ref cuDoubleComplex beta,
											CUdeviceptr y);
 /// <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);
		public static extern cusparseStatus cusparseZcsr2gebsr_bufferSize(cusparseContext handle,
														   cusparseDirection dirA,
														   int m,
														   int n,
														   cusparseMatDescr descrA,
														   CUdeviceptr csrValA,
														   CUdeviceptr csrRowPtrA,
														   CUdeviceptr csrColIndA,
														   int rowBlockDim,
														   int colBlockDim,
														   ref int pBufferSize);
		public static extern cusparseStatus cusparseCbsrsv2_solve(cusparseContext handle,
												   cusparseDirection dirA,
												   cusparseOperation transA,
												   int mb,
												   int nnzb,
												   CUdeviceptr alpha,
												   cusparseMatDescr descrA,
												   CUdeviceptr bsrVal,
												   CUdeviceptr bsrRowPtr,
												   CUdeviceptr bsrColInd,
												   int blockDim,
												   bsrsv2Info info,
												   CUdeviceptr x,
												   CUdeviceptr y,
												   cusparseSolvePolicy policy,
												   CUdeviceptr pBuffer);
		public static extern cusparseStatus cusparseXgebsr2gebsrNnz(cusparseContext handle,
													 cusparseDirection dirA,
													 int mb,
													 int nb,
													 int nnzb,
													 cusparseMatDescr descrA,
													 CUdeviceptr bsrRowPtrA,
													 CUdeviceptr bsrColIndA,
													 int rowBlockDimA,
													 int colBlockDimA,
													 cusparseMatDescr descrC,
													 CUdeviceptr bsrRowPtrC,
													 int rowBlockDimC,
													 int colBlockDimC,
													 CUdeviceptr nnzTotalDevHostPtr,
													 CUdeviceptr pBuffer);
		public static extern cusparseStatus cusparseZbsrsm2_bufferSize(cusparseContext handle,
                                                        cusparseDirection dirA,
                                                        cusparseOperation transA,
                                                        cusparseOperation transXY,
                                                        int mb,
                                                        int n,
                                                        int nnzb,
                                                        cusparseMatDescr descrA,
														CUdeviceptr bsrVal,
														CUdeviceptr bsrRowPtr,
														CUdeviceptr bsrColInd,
                                                        int blockSize,
                                                        bsrsm2Info info,
														ref int pBufferSizeInBytes);
		public static extern cusparseStatus cusparseZbsrsv2_bufferSizeExt(cusparseContext handle,
														cusparseDirection dirA,
														cusparseOperation transA,
														int mb,
														int nnzb,
														cusparseMatDescr descrA,
														CUdeviceptr bsrVal,
														CUdeviceptr bsrRowPtr,
														CUdeviceptr bsrColInd,
														int blockDim,
														bsrsv2Info info,
														ref SizeT pBufferSize);
		public static extern cusparseStatus cusparseZbsrmm(cusparseContext handle,
											cusparseDirection dirA,
											cusparseOperation transA,
											cusparseOperation transB,
											int mb,
											int n,
											int kb,
											int nnzb,
											CUdeviceptr alpha,
											cusparseMatDescr descrA,
											CUdeviceptr bsrValA,
											CUdeviceptr bsrRowPtrA,
											CUdeviceptr bsrColIndA,
											int blockSize,
											CUdeviceptr B,
											int ldb,
											CUdeviceptr beta,
											CUdeviceptr C,
											int ldc);