diff --git a/Source/Maestro.H b/Source/Maestro.H index e43dfd734..76091993b 100644 --- a/Source/Maestro.H +++ b/Source/Maestro.H @@ -28,9 +28,9 @@ using namespace maestro; #include #include -/// Define Real vector types for CUDA-compatability. If `AMREX_USE_CUDA`, then -/// this will be stored in CUDA managed memory. -#ifdef AMREX_USE_CUDA +/// Define Real vector types for GPU-compatability. If `AMREX_USE_GPU`, then +/// this will be stored in GPU managed memory. +#ifdef AMREX_USE_GPU using RealVector = amrex::Gpu::ManagedVector; using IntVector = amrex::Gpu::ManagedVector; #else diff --git a/Source/MaestroAverage.cpp b/Source/MaestroAverage.cpp index dbd49e1c2..cf5a19441 100644 --- a/Source/MaestroAverage.cpp +++ b/Source/MaestroAverage.cpp @@ -53,7 +53,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, const Array4 phi_arr = phi[lev].array(mfi, comp); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU // Atomic::Add is non-deterministic on the GPU. If this flag is true, // run on the CPU instead bool launched; @@ -70,7 +70,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, phi_arr(i, j, k)); }); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true); @@ -231,7 +231,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, bool use_mask = !(lev == fine_lev - 1); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU // Atomic::Add is non-deterministic on the GPU. If this flag is true, // run on the CPU instead bool launched; @@ -280,7 +280,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, } }); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true); diff --git a/Source/MaestroDt.cpp b/Source/MaestroDt.cpp index 9d0d3661f..33a7de33b 100644 --- a/Source/MaestroDt.cpp +++ b/Source/MaestroDt.cpp @@ -1,7 +1,7 @@ #include -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU #include #include #endif diff --git a/Source/MaestroFill3dData.cpp b/Source/MaestroFill3dData.cpp index e2b4556e9..5db42033c 100644 --- a/Source/MaestroFill3dData.cpp +++ b/Source/MaestroFill3dData.cpp @@ -423,7 +423,7 @@ void Maestro::Addw0(Vector >& u_edge, } if (finest_level == 0) { -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU // FillBoundary can be non-deterministic on the GPU for non-cell // centered data (like u_edge here). If this flag is true, run // on the CPU instead @@ -441,7 +441,7 @@ void Maestro::Addw0(Vector >& u_edge, } } -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true); diff --git a/Source/MaestroMakeEta.cpp b/Source/MaestroMakeEta.cpp index 1797bdeed..a0823d3e5 100644 --- a/Source/MaestroMakeEta.cpp +++ b/Source/MaestroMakeEta.cpp @@ -8,7 +8,7 @@ void Maestro::MakeEtarho(const Vector& etarho_flux) { // timer for profiling BL_PROFILE_VAR("Maestro::MakeEtarho()", MakeEtarho); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU bool launched; if (deterministic_nodal_solve) { launched = !Gpu::notInLaunchRegion(); @@ -161,7 +161,7 @@ void Maestro::MakeEtarho(const Vector& etarho_flux) { RestrictBase(etarho_cc, true); FillGhostBase(etarho_cc, true); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true); diff --git a/Source/MaestroNodalProj.cpp b/Source/MaestroNodalProj.cpp index b86ffe738..a7bb50fc5 100644 --- a/Source/MaestroNodalProj.cpp +++ b/Source/MaestroNodalProj.cpp @@ -212,7 +212,7 @@ void Maestro::NodalProj(int proj_type, Vector& rhcc, rhcc[lev].mult(-1.0, 0, 1, 1); } -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU // compRHS is non-deterministic on the GPU. If this flag is true, run // on the CPU instead bool launched; @@ -228,7 +228,7 @@ void Maestro::NodalProj(int proj_type, Vector& rhcc, mlndlap.compRHS(amrex::GetVecOfPtrs(rhstotal), amrex::GetVecOfPtrs(Vproj), {}, // pass in null rhnd amrex::GetVecOfPtrs(rhcc)); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true); @@ -288,7 +288,7 @@ void Maestro::NodalProj(int proj_type, Vector& rhcc, // solve for phi Print() << "Calling nodal solver" << std::endl; -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { launched = !Gpu::notInLaunchRegion(); // turn off GPU @@ -297,7 +297,7 @@ void Maestro::NodalProj(int proj_type, Vector& rhcc, #endif mlmg.solve(amrex::GetVecOfPtrs(phi), amrex::GetVecOfConstPtrs(rhstotal), rel_tol, abs_tol); -#ifdef AMREX_USE_CUDA +#ifdef AMREX_USE_GPU if (deterministic_nodal_solve) { // turn GPU back on if (launched) Gpu::setLaunchRegion(true);