jcuda.jcusparse.JCusparse Java Examples

The following examples show how to use jcuda.jcusparse.JCusparse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JCusolverSp_LinearSolver_Direct.java    From jcuda-samples with MIT License 6 votes vote down vote up
public static void main(String[] args)
{
    JCuda.setExceptionsEnabled(true);;
    JCusparse.setExceptionsEnabled(true);
    JCusolver.setExceptionsEnabled(true);

    String path = "src/main/resources/data/jcusolver/";
    String fileName = path + "lap2D_5pt_n100.mtx";
    String testFunc = "chol"; // "chol", "lu", "qr"
    String reorder = "symrcm"; // "symrcm", "symamd", null

    runTest(
        "-F="+fileName,
        "-R="+testFunc,
        "-P="+reorder);
}
 
Example #2
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrmv(cusparseHandle handle, int transA, int m, int n, int nnz, Pointer alpha,
		cusparseMatDescr descrA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer x, Pointer beta,
		Pointer y) {
	return JCusparse.cusparseDcsrmv(handle, transA, m, n, nnz, alpha, 
			descrA, csrValA, csrRowPtrA, csrColIndA, x, beta, y);
}
 
Example #3
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgeam(cusparseHandle handle, int m, int n, Pointer alpha, cusparseMatDescr descrA, int nnzA,
		Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer beta, cusparseMatDescr descrB, int nnzB,
		Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB, cusparseMatDescr descrC, Pointer csrValC,
		Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseScsrgeam(handle, m, n, alpha, descrA, nnzA, 
			csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, 
			csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC);
}
 
Example #4
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int	cusparsecsrmm2(cusparseHandle handle, int transa, int transb, int m, int n, int k, int nnz, jcuda.Pointer alpha, cusparseMatDescr descrA, 
		jcuda.Pointer csrValA, jcuda.Pointer csrRowPtrA, jcuda.Pointer csrColIndA, 
		jcuda.Pointer B, int ldb, jcuda.Pointer beta, jcuda.Pointer C, int ldc) {
	return JCusparse.cusparseScsrmm2(handle, transa, transb, m, n, k, nnz, alpha, descrA, csrValA, 
			csrRowPtrA, csrColIndA, B, ldb, beta, C, ldc);
}
 
Example #5
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrmv(cusparseHandle handle, int transA, int m, int n, int nnz, Pointer alpha,
		cusparseMatDescr descrA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer x, Pointer beta,
		Pointer y) {
	return JCusparse.cusparseScsrmv(handle, transA, m, n, nnz, alpha, 
			descrA, csrValA, csrRowPtrA, csrColIndA, x, beta, y);
}
 
Example #6
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgemm(cusparseHandle handle, int transA, int transB, int m, int n, int k,
		cusparseMatDescr descrA, int nnzA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA,
		cusparseMatDescr descrB, int nnzB, Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB,
		cusparseMatDescr descrC, Pointer csrValC, Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseScsrgemm(handle, transA,  transB,  m,  n,  k,
			 descrA,  nnzA,  csrValA,  csrRowPtrA,  csrColIndA,
			 descrB,  nnzB,  csrValB,  csrRowPtrB,  csrColIndB,
			 descrC,  csrValC,  csrRowPtrC,  csrColIndC);
}
 
Example #7
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgeam(cusparseHandle handle, int m, int n, Pointer alpha, cusparseMatDescr descrA, int nnzA,
		Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer beta, cusparseMatDescr descrB, int nnzB,
		Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB, cusparseMatDescr descrC, Pointer csrValC,
		Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseDcsrgeam(handle, m, n, alpha, descrA, nnzA, 
			csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, 
			csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC);
}
 
Example #8
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int	cusparsecsrmm2(cusparseHandle handle, int transa, int transb, int m, int n, int k, int nnz, jcuda.Pointer alpha, cusparseMatDescr descrA, 
		jcuda.Pointer csrValA, jcuda.Pointer csrRowPtrA, jcuda.Pointer csrColIndA, 
		jcuda.Pointer B, int ldb, jcuda.Pointer beta, jcuda.Pointer C, int ldc) {
	return JCusparse.cusparseDcsrmm2(handle, transa, transb, m, n, k, nnz, alpha, descrA, csrValA, 
			csrRowPtrA, csrColIndA, B, ldb, beta, C, ldc);
}
 
Example #9
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrmv(cusparseHandle handle, int transA, int m, int n, int nnz, Pointer alpha,
		cusparseMatDescr descrA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer x, Pointer beta,
		Pointer y) {
	return JCusparse.cusparseDcsrmv(handle, transA, m, n, nnz, alpha, 
			descrA, csrValA, csrRowPtrA, csrColIndA, x, beta, y);
}
 
Example #10
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgemm(cusparseHandle handle, int transA, int transB, int m, int n, int k,
		cusparseMatDescr descrA, int nnzA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA,
		cusparseMatDescr descrB, int nnzB, Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB,
		cusparseMatDescr descrC, Pointer csrValC, Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseDcsrgemm(handle, transA,  transB,  m,  n,  k,
			 descrA,  nnzA,  csrValA,  csrRowPtrA,  csrColIndA,
			 descrB,  nnzB,  csrValB,  csrRowPtrB,  csrColIndB,
			 descrC,  csrValC,  csrRowPtrC,  csrColIndC);
}
 
Example #11
Source File: JCusolverDn_LinearSolver_Direct.java    From jcuda-samples with MIT License 5 votes vote down vote up
public static void main(String args[])
{
    JCuda.setExceptionsEnabled(true);;
    JCusparse.setExceptionsEnabled(true);
    JCusolver.setExceptionsEnabled(true);

    String path = "src/main/resources/data/jcusolver/";
    String fileName = path + "gr_900_900_crg.mtx";
    String testFunc = "chol"; // "chol", "lu", "qr"

    runTest(
        "-F="+fileName,
        "-R="+testFunc);
}
 
Example #12
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgeam(cusparseHandle handle, int m, int n, Pointer alpha, cusparseMatDescr descrA, int nnzA,
		Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer beta, cusparseMatDescr descrB, int nnzB,
		Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB, cusparseMatDescr descrC, Pointer csrValC,
		Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseScsrgeam(handle, m, n, alpha, descrA, nnzA, 
			csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, 
			csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC);
}
 
Example #13
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int	cusparsecsrmm2(cusparseHandle handle, int transa, int transb, int m, int n, int k, int nnz, jcuda.Pointer alpha, cusparseMatDescr descrA, 
		jcuda.Pointer csrValA, jcuda.Pointer csrRowPtrA, jcuda.Pointer csrColIndA, 
		jcuda.Pointer B, int ldb, jcuda.Pointer beta, jcuda.Pointer C, int ldc) {
	return JCusparse.cusparseScsrmm2(handle, transa, transb, m, n, k, nnz, alpha, descrA, csrValA, 
			csrRowPtrA, csrColIndA, B, ldb, beta, C, ldc);
}
 
Example #14
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrmv(cusparseHandle handle, int transA, int m, int n, int nnz, Pointer alpha,
		cusparseMatDescr descrA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer x, Pointer beta,
		Pointer y) {
	return JCusparse.cusparseScsrmv(handle, transA, m, n, nnz, alpha, 
			descrA, csrValA, csrRowPtrA, csrColIndA, x, beta, y);
}
 
Example #15
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgemm(cusparseHandle handle, int transA, int transB, int m, int n, int k,
		cusparseMatDescr descrA, int nnzA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA,
		cusparseMatDescr descrB, int nnzB, Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB,
		cusparseMatDescr descrC, Pointer csrValC, Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseScsrgemm(handle, transA,  transB,  m,  n,  k,
			 descrA,  nnzA,  csrValA,  csrRowPtrA,  csrColIndA,
			 descrB,  nnzB,  csrValB,  csrRowPtrB,  csrColIndB,
			 descrC,  csrValC,  csrRowPtrC,  csrColIndC);
}
 
Example #16
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgemm(cusparseHandle handle, int transA, int transB, int m, int n, int k,
		cusparseMatDescr descrA, int nnzA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA,
		cusparseMatDescr descrB, int nnzB, Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB,
		cusparseMatDescr descrC, Pointer csrValC, Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseDcsrgemm(handle, transA,  transB,  m,  n,  k,
			 descrA,  nnzA,  csrValA,  csrRowPtrA,  csrColIndA,
			 descrB,  nnzB,  csrValB,  csrRowPtrB,  csrColIndB,
			 descrC,  csrValC,  csrRowPtrC,  csrColIndC);
}
 
Example #17
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int	cusparsecsrmm2(cusparseHandle handle, int transa, int transb, int m, int n, int k, int nnz, jcuda.Pointer alpha, cusparseMatDescr descrA, 
		jcuda.Pointer csrValA, jcuda.Pointer csrRowPtrA, jcuda.Pointer csrColIndA, 
		jcuda.Pointer B, int ldb, jcuda.Pointer beta, jcuda.Pointer C, int ldc) {
	return JCusparse.cusparseDcsrmm2(handle, transa, transb, m, n, k, nnz, alpha, descrA, csrValA, 
			csrRowPtrA, csrColIndA, B, ldb, beta, C, ldc);
}
 
Example #18
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 5 votes vote down vote up
@Override
public int cusparsecsrgeam(cusparseHandle handle, int m, int n, Pointer alpha, cusparseMatDescr descrA, int nnzA,
		Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer beta, cusparseMatDescr descrB, int nnzB,
		Pointer csrValB, Pointer csrRowPtrB, Pointer csrColIndB, cusparseMatDescr descrC, Pointer csrValC,
		Pointer csrRowPtrC, Pointer csrColIndC) {
	return JCusparse.cusparseDcsrgeam(handle, m, n, alpha, descrA, nnzA, 
			csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, 
			csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC);
}
 
Example #19
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer csrValA,
		Pointer csrRowPtrA, Pointer csrColIndA, Pointer A, int lda) {
	return JCusparse.cusparseDcsr2dense(handle, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, A, lda);
}
 
Example #20
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsennz(cusparseHandle handle, int dirA, int m, int n, cusparseMatDescr descrA, Pointer A, int lda,
		Pointer nnzPerRowCol, Pointer nnzTotalDevHostPtr) {
	return JCusparse.cusparseSnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowCol, nnzTotalDevHostPtr);
}
 
Example #21
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsedense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer A, int lda,
		Pointer nnzPerRow, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA) {
	return JCusparse.cusparseSdense2csr(handle, m, n, descrA, A, lda, nnzPerRow, csrValA, csrRowPtrA, csrColIndA);
}
 
Example #22
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer csrValA,
		Pointer csrRowPtrA, Pointer csrColIndA, Pointer A, int lda) {
	return JCusparse.cusparseScsr2dense(handle, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, A, lda);
}
 
Example #23
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2csc(cusparseHandle handle, int m, int n, int nnz, Pointer csrVal, Pointer csrRowPtr,
		Pointer csrColInd, Pointer cscVal, Pointer cscRowInd, Pointer cscColPtr, int copyValues, int idxBase) {
	return JCusparse.cusparseScsr2csc(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscRowInd, cscColPtr, copyValues, idxBase);
}
 
Example #24
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2csc(cusparseHandle handle, int m, int n, int nnz, Pointer csrVal, Pointer csrRowPtr,
		Pointer csrColInd, Pointer cscVal, Pointer cscRowInd, Pointer cscColPtr, int copyValues, int idxBase) {
	return JCusparse.cusparseDcsr2csc(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscRowInd, cscColPtr, copyValues, idxBase);
}
 
Example #25
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsennz(cusparseHandle handle, int dirA, int m, int n, cusparseMatDescr descrA, Pointer A, int lda,
		Pointer nnzPerRowCol, Pointer nnzTotalDevHostPtr) {
	return JCusparse.cusparseDnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowCol, nnzTotalDevHostPtr);
}
 
Example #26
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsedense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer A, int lda,
		Pointer nnzPerRow, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA) {
	return JCusparse.cusparseDdense2csr(handle, m, n, descrA, A, lda, nnzPerRow, csrValA, csrRowPtrA, csrColIndA);
}
 
Example #27
Source File: SinglePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2csc(cusparseHandle handle, int m, int n, int nnz, Pointer csrVal, Pointer csrRowPtr,
		Pointer csrColInd, Pointer cscVal, Pointer cscRowInd, Pointer cscColPtr, int copyValues, int idxBase) {
	return JCusparse.cusparseScsr2csc(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscRowInd, cscColPtr, copyValues, idxBase);
}
 
Example #28
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2dense(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer csrValA,
		Pointer csrRowPtrA, Pointer csrColIndA, Pointer A, int lda) {
	return JCusparse.cusparseDcsr2dense(handle, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, A, lda);
}
 
Example #29
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsecsr2csc(cusparseHandle handle, int m, int n, int nnz, Pointer csrVal, Pointer csrRowPtr,
		Pointer csrColInd, Pointer cscVal, Pointer cscRowInd, Pointer cscColPtr, int copyValues, int idxBase) {
	return JCusparse.cusparseDcsr2csc(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscRowInd, cscColPtr, copyValues, idxBase);
}
 
Example #30
Source File: DoublePrecisionCudaSupportFunctions.java    From systemds with Apache License 2.0 4 votes vote down vote up
@Override
public int cusparsedense2csr(cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer A, int lda,
		Pointer nnzPerRow, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA) {
	return JCusparse.cusparseDdense2csr(handle, m, n, descrA, A, lda, nnzPerRow, csrValA, csrRowPtrA, csrColIndA);
}