Repository navigation
Host-capture Re_size in the species-to-mixture kernel and its device callers - #2195
Draft
sbryngelson wants to merge 1 commit into
Draft
sbryngelson wants to merge 1 commit into
sbryngelson wants to merge 1 commit into
Conversation
|
Claude Code Review Head SHA: ae24cad Files changed:
Findings: |
…callers amdflang can read the declare-target Re_size stale (as 0) from device code in another translation unit. s_convert_species_to_mixture_variables_kernel and s_compute_cell_state take optional host copies Re_size_loc1/2 and fall back to Re_size when absent. The GPU kernels that pass Re set the copies before the loop, make them firstprivate, and pass them down. Values are identical to Re_size, so results do not change.
sbryngelson
force-pushed
the
wave5/re-size-host-capture
branch
from
November 9, 2026 21:32
ae24cad to
adda717
Compare
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.
What
#2130 copied
Re_sizeinto firstprivate host locals for the kernels that read it from device code, because amdflang can read the declare-target module variable stale across translation units. This finishes that treatment for the remaining device read:s_convert_species_to_mixture_variables_kernelreadsRe_size(i)whenRe_Kis present.The kernel takes two new optional arguments
Re_size_loc1,Re_size_loc2and uses them when present; without them it reads the module variable (host callers,m_pressure_relaxation, pre/post_process). Every device caller that passesRe_Know passes firstprivate host copies, as in #2130: the two conversion kernels inm_variables_conversion,s_ibm_correct_state,s_cbc,s_compute_cell_state(now taking the copies as required arguments, with its callers in the time stepper,s_write_run_time_information, the Lagrangian particle code, and the host calls ins_report_icfl_violation), and the Lagrangian bubble loop. Values are identical toRe_size, so results do not change.Verification
No result changes expected, none seen. Final head
adda717d8.Viscous67,Non-Newtonian8,IBM71, Hypoelasticity 62, Lagrange 53 and CBC (grcbcandbc=-) 56 tests all pass.Not shown: that this fixes a failure. I have no stale-read repro on current master, and the AMD suite already passed. It removes the last device read of the module variable.
This PR was made with Claude Code (AI).