Skip to content

Commit be813d0

Browse files
authored
Hypre: add version check (#2865)
These HYPRE_SetSp* are only available in hypre >= 22500.
1 parent 8fb23ec commit be813d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Src/Base/AMReX.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,13 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
551551
HYPRE_SetGPUMemoryPoolSize( mempool_bin_growth, mempool_min_bin,
552552
mempool_max_bin, mempool_max_cached_bytes );
553553
#endif
554-
/* This API below used to be HYPRE_SetSpGemmUseCusparse(). This was changed in commit
555-
Hypre master commit dfdd1cd12f */
554+
#if (HYPRE_RELEASE_NUMBER >= 22500)
556555
HYPRE_SetSpGemmUseVendor(hypre_spgemm_use_vendor);
557556
HYPRE_SetSpMVUseVendor(hypre_spmv_use_vendor);
558557
HYPRE_SetSpTransUseVendor(hypre_sptrans_use_vendor);
558+
#elif (HYPRE_USING_CUDA)
559+
HYPRE_SetSpGemmUseCusparse(hypre_spgemm_use_vendor);
560+
#endif
559561
HYPRE_SetMemoryLocation(HYPRE_MEMORY_DEVICE);
560562
HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE);
561563
HYPRE_SetUseGpuRand(true);

0 commit comments

Comments
 (0)