Skip to content

fix device pointer capture in derive coord func#572

Merged
baperry2 merged 2 commits intoAMReX-Combustion:developmentfrom
baperry2:dev-pointer-coord
Sep 30, 2025
Merged

fix device pointer capture in derive coord func#572
baperry2 merged 2 commits intoAMReX-Combustion:developmentfrom
baperry2:dev-pointer-coord

Conversation

@baperry2
Copy link
Copy Markdown
Collaborator

@baperry2 baperry2 commented Sep 29, 2025

geomdata.ProbLo() was being called from host, resulting in a host pointer that was then used on device, leading to segfaults for GPU simulations.

Also, rather than capturing dx/dy/dz and geomdata to device separately, just use geomdata to determine dx/dy/dz in the dercoord kernels.

Necessary to run FlameSheet case on Aurora.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a critical device pointer issue in the coordinate derivation function that was causing segfaults in GPU simulations. The problem was that geomdata.ProbLo() was being called from the host and the resulting host pointer was then used on the device.

  • Removes pre-computed dx/dy/dz variables that were captured from host
  • Updates GPU kernels to use geomdata.ProbLo(dim) and geomdata.CellSize(dim) methods directly on device
  • Simplifies lambda capture by only passing geomdata instead of multiple separate variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@baperry2 baperry2 merged commit e1e6d85 into AMReX-Combustion:development Sep 30, 2025
24 checks passed
@baperry2 baperry2 deleted the dev-pointer-coord branch September 30, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants