From 49ee6b02621ce3d7c1674b35dc7ccf61329d47ab Mon Sep 17 00:00:00 2001 From: Tanush Prathi Date: Tue, 8 Jul 2025 18:37:29 -0400 Subject: [PATCH] Fix kernels bug hopefully --- docs/documentation/readme.md | 1 + src/simulation/m_data_output.fpp | 14 +++++++------- src/simulation/m_time_steppers.fpp | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/documentation/readme.md b/docs/documentation/readme.md index 267ab5ebf8..8bd2957332 100644 --- a/docs/documentation/readme.md +++ b/docs/documentation/readme.md @@ -9,6 +9,7 @@ - [Running MFC](running.md) - [Flow Visualization](visualization.md) - [Performance](expectedPerformance.md) +- [GPU Parallelization](gpuParallelization.md) - [MFC's Authors](authors.md) - [References](references.md) diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 87a59c8866..dbf9f42552 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -316,14 +316,14 @@ contains Rc_min_loc = minval(Rc_sf) end if #else - !$acc kernels - icfl_max_loc = maxval(icfl_sf) - !$acc end kernels + #:call GPU_PARALLEL(copyout='[icfl_max_loc]', copyin='[icfl_sf]') + icfl_max_loc = maxval(icfl_sf) + #:endcall GPU_PARALLEL if (viscous) then - !$acc kernels - vcfl_max_loc = maxval(vcfl_sf) - Rc_min_loc = minval(Rc_sf) - !$acc end kernels + #:call GPU_PARALLEL(copyout='[vcfl_max_loc, Rc_min_loc]', copyin='[vcfl_sf,Rc_sf]') + vcfl_max_loc = maxval(vcfl_sf) + Rc_min_loc = minval(Rc_sf) + #:endcall GPU_PARALLEL end if #endif diff --git a/src/simulation/m_time_steppers.fpp b/src/simulation/m_time_steppers.fpp index 761ebdd792..53965cf464 100644 --- a/src/simulation/m_time_steppers.fpp +++ b/src/simulation/m_time_steppers.fpp @@ -993,9 +993,9 @@ contains end do end do - !$acc kernels - dt_local = minval(max_dt) - !$acc end kernels + #:call GPU_PARALLEL(copyout='[dt_local]', copyin='[max_dt]') + dt_local = minval(max_dt) + #:endcall GPU_PARALLEL if (num_procs == 1) then dt = dt_local