From be813d024e6b314e41c727734b8e53481898e08e Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Fri, 1 Jul 2022 10:29:13 -0700 Subject: [PATCH] Hypre: add version check (#2865) These HYPRE_SetSp* are only available in hypre >= 22500. --- Src/Base/AMReX.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/Base/AMReX.cpp b/Src/Base/AMReX.cpp index 2c454166126..76488bf81e0 100644 --- a/Src/Base/AMReX.cpp +++ b/Src/Base/AMReX.cpp @@ -551,11 +551,13 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse, HYPRE_SetGPUMemoryPoolSize( mempool_bin_growth, mempool_min_bin, mempool_max_bin, mempool_max_cached_bytes ); #endif - /* This API below used to be HYPRE_SetSpGemmUseCusparse(). This was changed in commit - Hypre master commit dfdd1cd12f */ +#if (HYPRE_RELEASE_NUMBER >= 22500) HYPRE_SetSpGemmUseVendor(hypre_spgemm_use_vendor); HYPRE_SetSpMVUseVendor(hypre_spmv_use_vendor); HYPRE_SetSpTransUseVendor(hypre_sptrans_use_vendor); +#elif (HYPRE_USING_CUDA) + HYPRE_SetSpGemmUseCusparse(hypre_spgemm_use_vendor); +#endif HYPRE_SetMemoryLocation(HYPRE_MEMORY_DEVICE); HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE); HYPRE_SetUseGpuRand(true);