Repository navigation
Host-capture Re_size in viscous and non-Newtonian device code - #2001
Draft
sbryngelson wants to merge 1 commit into
Draft
sbryngelson wants to merge 1 commit into
sbryngelson wants to merge 1 commit into
Conversation
MFlowCode#1588 worked around amdflang reading the declare-target Re_size stale (as 0) across translation units by copying it into firstprivate locals in the Riemann solvers. Device code in other modules still read the module variable directly, so on AMD flang it could silently drop viscosity the same way: - s_compute_axis_inv_re (m_viscous), called from the four cylindrical axis stress kernels - s_compute_mixture_inv_re (m_hb_function), called from the axis routine and from the cylindrical and Cartesian viscous source-flux kernels in m_riemann_state Apply the same pattern: each enclosing kernel takes Re_size_loc1/2 as firstprivate host copies and passes them down, and the device routines use merge(Re_size_loc1, Re_size_loc2, i == 1) in place of Re_size(i), as s_compute_interface_reynolds already does. Values are identical to Re_size, so results do not change on CPU or NVIDIA: viscous, non-Newtonian and cylindrical tests pass unchanged and the NVHPC OpenACC build compiles. Not tested on AMD hardware.
Lines of Code
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1588 worked around amdflang reading the declare-target Re_size stale
(as 0) across translation units by copying it into firstprivate locals
in the Riemann solvers. Device code in other modules still read the
module variable directly, so on AMD flang it could silently drop
viscosity the same way:
axis stress kernels
routine and from the cylindrical and Cartesian viscous source-flux
kernels in m_riemann_state
Apply the same pattern: each enclosing kernel takes Re_size_loc1/2 as
firstprivate host copies and passes them down, and the device routines
use merge(Re_size_loc1, Re_size_loc2, i == 1) in place of Re_size(i),
as s_compute_interface_reynolds already does.
Values are identical to Re_size, so results do not change on CPU or
NVIDIA: viscous, non-Newtonian and cylindrical tests pass unchanged and
the NVHPC OpenACC build compiles. Not tested on AMD hardware.