Skip to content

Commit 978ef64

Browse files
committed
fix: unblock --debug/--reldebug GPU builds (guard host s_mpi_abort out of device code)
s_compute_fast_magnetosonic_speed is a GPU routine (acc routine seq) but its MFC_DEBUG diagnostic block called host s_mpi_abort, which is illegal in device code without IPO inlining. Debug/reldebug builds disable IPO, so --gpu acc/mp debug builds failed with NVFORTRAN-S-1061. Guard the abort with #ifndef MFC_GPU, keeping the device-legal diagnostic print. CPU and Release builds are unchanged.
1 parent 4a73bf3 commit 978ef64

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/common/m_variables_conversion.fpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,11 @@ contains
13321332
#ifdef MFC_DEBUG
13331333
if (disc < 0._wp) then
13341334
print *, 'rho, c, Bx, By, Bz, h, term, disc:', rho, c, B(1), B(2), B(3), h, term, disc
1335+
! s_mpi_abort is a host routine and cannot be called from device code
1336+
! (this is a GPU routine); on GPU builds, emit the diagnostic print only.
1337+
#ifndef MFC_GPU
13351338
call s_mpi_abort('Error: negative discriminant in s_compute_fast_magnetosonic_speed')
1339+
#endif
13361340
end if
13371341
#endif
13381342

0 commit comments

Comments
 (0)