Add CUSPARSE_NEWSPMM_VERSION (#743)

This PR adds a new macro for driving the choice of cusparse's SpMV and SpMM algorithm types used in hypre.
This commit is contained in:
Victor A. Paludetto Magri 2022-10-03 13:05:21 -07:00 committed by GitHub
parent 8dc524e8a1
commit 51cabfbd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -17,9 +17,14 @@
#if defined(HYPRE_USING_GPU)
#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION
#if CUSPARSE_VERSION >= CUSPARSE_NEWSPMM_VERSION
#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_SPMV_CSR_ALG2
#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_SPMM_CSR_ALG3
#elif CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION
#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_CSRMV_ALG2
#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_SPMM_CSR_ALG1
#else
#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_CSRMV_ALG2
#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_CSRMM_ALG1
@ -265,6 +270,7 @@ hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans,
dBuffer = hypre_TAlloc(char, bufferSize, HYPRE_MEMORY_DEVICE);
hypre_CSRMatrixGPUMatSpMVBuffer(A) = dBuffer;
#if CUSPARSE_VERSION >= CUSPARSE_NEWSPMM_VERSION
if (num_vectors > 1)
{
HYPRE_CUSPARSE_CALL( cusparseSpMM_preprocess(handle,
@ -279,6 +285,7 @@ hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans,
HYPRE_CUSPARSE_SPMM_ALG,
dBuffer) );
}
#endif
}
if (num_vectors == 1)

View File

@ -96,6 +96,7 @@ using hypre_DeviceItem = void*;
#endif
#define CUSPARSE_NEWAPI_VERSION 11000
#define CUSPARSE_NEWSPMM_VERSION 11201
#define CUDA_MALLOCASYNC_VERSION 11020
#define THRUST_CALL_BLOCKING 1

View File

@ -39,6 +39,7 @@ using hypre_DeviceItem = void*;
#endif
#define CUSPARSE_NEWAPI_VERSION 11000
#define CUSPARSE_NEWSPMM_VERSION 11201
#define CUDA_MALLOCASYNC_VERSION 11020
#define THRUST_CALL_BLOCKING 1