Skip to content

Commit

Permalink
Fix host access of device vector. And add shell file for pointing cma…
Browse files Browse the repository at this point in the history
…ke to a cuda toolkit. (#1788)

Co-authored-by: Aaron Lattanzi <[email protected]>
  • Loading branch information
AMLattanzi and Aaron Lattanzi authored Sep 4, 2024
1 parent 2e9c874 commit 4afdc81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Build/cmake_cuda_SpecifyToolKit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Example CMake config script for an OSX laptop with OpenMPI

cmake -DCMAKE_INSTALL_PREFIX:PATH=./install \
-DMPIEXEC_PREFLAGS:STRING=--oversubscribe \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DERF_DIM:STRING=3 \
-DERF_ENABLE_MPI:BOOL=ON \
-DERF_ENABLE_CUDA:BOOL=ON \
-DERF_ENABLE_TESTS:BOOL=ON \
-DERF_ENABLE_FCOMPARE:BOOL=ON \
-DERF_ENABLE_DOCUMENTATION:BOOL=OFF \
-DCUDAToolkit_ROOT=/usr/local/cuda-12.4/bin \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
.. && make -j8
4 changes: 2 additions & 2 deletions Source/BoundaryConditions/BoundaryConditions_cons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
if (m_z_phys_nd) {
const auto& bx_lo = lbound(bx);
const auto& bx_hi = ubound(bx);

const BCRec* bc_ptr_h = bcrs.data();
// Neumann conditions (d<var>/dn = 0) must be aware of the surface normal with terrain.
// An additional source term arises from d<var>/dx & d<var>/dy & met_h_xi/eta/zeta.
//=====================================================================================
Expand All @@ -420,7 +420,7 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
for (int n = 0; n < ncomp; n++) {
// Hit for Neumann condition at kmin
int dest_comp = icomp+n;
int l_bc_type = bc_ptr[n].lo(2);
int l_bc_type = bc_ptr_h[n].lo(2);
if(l_bc_type == ERFBCType::foextrap)
{
// Loop over ghost cells in bottom XY-plane (valid box)
Expand Down

0 comments on commit 4afdc81

Please sign in to comment.