Minor fix so the postAdvance function works on GPU#636
Minor fix so the postAdvance function works on GPU#636baperry2 merged 7 commits intoAMReX-Combustion:developmentfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a GPU-compatibility issue in the ProblemSpecificFunctions::postAdvance hook by ensuring it receives host-accessible problem parameters (instead of a potentially device-only pointer).
Changes:
- Update
DefaultProblemSpecificFunctions::postAdvanceto acceptProbParmDefaultbyconst&(host-side API). - Update the
PeleLM::Advancecall site to pass*prob_parm(host copy) rather thanprob_parm_d(device copy).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Source/PeleLMeX_ProblemSpecificFunctions.H |
Adjusts postAdvance signature to take host-accessible problem parameters by const reference. |
Source/PeleLMeX_Advance.cpp |
Updates postAdvance invocation to pass the host ProbParm instance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
We should definitely pass the device copy of We should either pass both host and device copies, which makes the API a bit ugly, or pass only the device copy, which may force users to do some operations in device code that would be more efficient on host. For example, if a binary flag indicates whether or not an operation should be carried out, it would be most efficient to do that check once and never launch a ParallelFor if the operation is not to be carried out, rather than launching the parallel for and doing an identical check at each grid point. |
|
Leaning toward passing both host and device copies as the better option. It's a bit off label, but users may want to stick something in |
This is exactly the issue I'm running into. I need |
baperry2
left a comment
There was a problem hiding this comment.
Thanks for including clear comments documenting the API
|
It's just as much for me as a reminder! |
|
I snuck in a minor change to the README that reflects @jrood-nrel recent update from c++17 to c++20. |
This updates how prob_parm is passed to the
postAdvancefunction in the ProblemSpecificFunctions for compatibility with CPU and GPU.