Skip to content

Commit

Permalink
fix for GPU (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Mar 16, 2024
1 parent e03a7a8 commit e74fe6c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Initialization/ERF_init_from_wrfinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,14 @@ verify_terrain_top_boundary (const Real& z_top,
for (int idx = 0; idx < nboxes; idx++) {
Gpu::HostVector <Real> MaxMax_h(2);
Gpu::DeviceVector<Real> MaxMax_d;
MaxMax_d.push_back(-1.0e16);
MaxMax_d.push_back(-1.0e16);
MaxMax_d.resize(2);
MaxMax_h.push_back(-1.0e16);
MaxMax_h.push_back(-1.0e16);
#ifdef AMREX_USE_GPU
Gpu::htod_memcpy_async(MaxMax_d.data(), MaxMax_h.data(), sizeof(Real)*2);
#else
std::memcpy(MaxMax_d.data(), MaxMax_h.data(), sizeof(Real)*2);
#endif
Real* mm_d = MaxMax_d.data();

Box Fab2dBox_hi (NC_PHB_fab[idx].box()); Fab2dBox_hi.makeSlab(2,Fab2dBox_hi.bigEnd(2));
Expand Down

0 comments on commit e74fe6c

Please sign in to comment.