Skip to content

Commit 4afdc81

Browse files
AMLattanziAaron Lattanzi
and
Aaron Lattanzi
authored
Fix host access of device vector. And add shell file for pointing cmake to a cuda toolkit. (#1788)
Co-authored-by: Aaron Lattanzi <[email protected]>
1 parent 2e9c874 commit 4afdc81

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Build/cmake_cuda_SpecifyToolKit.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Example CMake config script for an OSX laptop with OpenMPI
4+
5+
cmake -DCMAKE_INSTALL_PREFIX:PATH=./install \
6+
-DMPIEXEC_PREFLAGS:STRING=--oversubscribe \
7+
-DCMAKE_BUILD_TYPE:STRING=Release \
8+
-DERF_DIM:STRING=3 \
9+
-DERF_ENABLE_MPI:BOOL=ON \
10+
-DERF_ENABLE_CUDA:BOOL=ON \
11+
-DERF_ENABLE_TESTS:BOOL=ON \
12+
-DERF_ENABLE_FCOMPARE:BOOL=ON \
13+
-DERF_ENABLE_DOCUMENTATION:BOOL=OFF \
14+
-DCUDAToolkit_ROOT=/usr/local/cuda-12.4/bin \
15+
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
16+
.. && make -j8

Source/BoundaryConditions/BoundaryConditions_cons.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
411411
if (m_z_phys_nd) {
412412
const auto& bx_lo = lbound(bx);
413413
const auto& bx_hi = ubound(bx);
414-
414+
const BCRec* bc_ptr_h = bcrs.data();
415415
// Neumann conditions (d<var>/dn = 0) must be aware of the surface normal with terrain.
416416
// An additional source term arises from d<var>/dx & d<var>/dy & met_h_xi/eta/zeta.
417417
//=====================================================================================
@@ -420,7 +420,7 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
420420
for (int n = 0; n < ncomp; n++) {
421421
// Hit for Neumann condition at kmin
422422
int dest_comp = icomp+n;
423-
int l_bc_type = bc_ptr[n].lo(2);
423+
int l_bc_type = bc_ptr_h[n].lo(2);
424424
if(l_bc_type == ERFBCType::foextrap)
425425
{
426426
// Loop over ghost cells in bottom XY-plane (valid box)

0 commit comments

Comments
 (0)