-
Notifications
You must be signed in to change notification settings - Fork 70
Spray data issue on hip #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
90ddd68
6e01469
e6c3df9
a567cd3
4999515
4071c31
7ffb7a1
24fe642
8e49e40
fa19b40
a746705
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,8 +45,10 @@ public: | |||||||||
|
|
||||||||||
| static void SprayCleanUp() | ||||||||||
| { | ||||||||||
| delete m_sprayData; | ||||||||||
| amrex::The_Arena()->free(d_sprayData); | ||||||||||
| // delete m_sprayData; | ||||||||||
| // amrex::The_Arena()->free(d_sprayData); | ||||||||||
|
Comment on lines
+48
to
+49
|
||||||||||
| // delete m_sprayData; | |
| // amrex::The_Arena()->free(d_sprayData); | |
| delete m_sprayData; | |
| amrex::The_Device_Arena()->free(d_sprayData); |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,8 +32,11 @@ SprayParticleContainer::readSprayParams(int& particle_verbose) | |||||||||
| << std::endl; | ||||||||||
| #endif | ||||||||||
| m_sprayData = new SprayData{}; | ||||||||||
| d_sprayData = | ||||||||||
| static_cast<SprayData*>(amrex::The_Arena()->alloc(sizeof(SprayData))); | ||||||||||
| // d_sprayData = | ||||||||||
| // static_cast<SprayData*>(amrex::The_Arena()->alloc(sizeof(SprayData))); | ||||||||||
|
Comment on lines
+35
to
+36
|
||||||||||
| // d_sprayData = | |
| // static_cast<SprayData*>(amrex::The_Arena()->alloc(sizeof(SprayData))); | |
| // d_sprayData must be in device memory for HIP/GPU access, so allocate from | |
| // The_Device_Arena and ensure deallocation uses the matching arena. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
USE_MANIFOLD_EOSis enabled, this function unconditionally dereferencesspray(e.g.,spray->indx[n]), but the parameter default isnullptr. This makes it easy for any call site that doesn't passsprayto compile and then crash in manifold builds. Consider removing the default= nullptrforspray(forcing callers to provide it), or adding a#ifdef USE_MANIFOLD_EOSguard that aborts/asserts ifspray == nullptrbefore dereferencing.