Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypre Algorithm Options #2859

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ namespace {
#ifdef AMREX_USE_HYPRE
namespace {
int init_hypre = 1;
#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)
int hypre_spgemm_use_vendor = 0;
int hypre_spmv_use_vendor = 0;
int hypre_sptrans_use_vendor = 0;
#endif
}
#endif

Expand Down Expand Up @@ -489,6 +494,11 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,

#ifdef AMREX_USE_HYPRE
pp.queryAdd("init_hypre", init_hypre);
#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)
pp.queryAdd("hypre_spgemm_use_vendor", hypre_spgemm_use_vendor);
pp.queryAdd("hypre_spmv_use_vendor", hypre_spmv_use_vendor);
pp.queryAdd("hypre_sptrans_use_vendor", hypre_sptrans_use_vendor);
#endif
#endif
}

Expand Down Expand Up @@ -526,7 +536,7 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
#ifdef AMREX_USE_HYPRE
if (init_hypre) {
HYPRE_Init();
#ifdef HYPRE_USING_CUDA
#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)

#if defined(HYPRE_RELEASE_NUMBER) && (HYPRE_RELEASE_NUMBER >= 22400)

Expand All @@ -543,7 +553,9 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
#endif
/* This API below used to be HYPRE_SetSpGemmUseCusparse(). This was changed in commit
Hypre master commit dfdd1cd12f */
HYPRE_SetSpGemmUseVendor(false);
HYPRE_SetSpGemmUseVendor(hypre_spgemm_use_vendor);
HYPRE_SetSpMVUseVendor(hypre_spmv_use_vendor);
HYPRE_SetSpTransUseVendor(hypre_sptrans_use_vendor);
HYPRE_SetMemoryLocation(HYPRE_MEMORY_DEVICE);
HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE);
HYPRE_SetUseGpuRand(true);
Expand Down