Skip to content

Fix GPU dispatch for PolymorphicArenaAllocator in DefaultInitialization#6808

Merged
ax3l merged 1 commit intoBLAST-WarpX:developmentfrom
ax3l:fix-particle-init-poly-pc
Apr 27, 2026
Merged

Fix GPU dispatch for PolymorphicArenaAllocator in DefaultInitialization#6808
ax3l merged 1 commit intoBLAST-WarpX:developmentfrom
ax3l:fix-particle-init-poly-pc

Conversation

@ax3l
Copy link
Copy Markdown
Member

@ax3l ax3l commented Apr 27, 2026

Follow-up from transitioning to polymorphic particle containers #6374.

Isolated from #6801

amrex::RunOnGpu<PolymorphicArenaAllocator> is false_type because AMReX does not specialize RunOnGpu for this allocator. This causes DefaultInitializeRuntimeAttributes to take the CPU code path even when particle data lives on device, leading to segfaults when ionization or user-defined runtime attributes are used with SYCL (and potentially other GPU backends that don't have UVA).

This affected users that used runtime attributes on hardware that did not successfully fell back to unified memory (and we try to avoid that anyway).

Follow-up from transitioning to polymorphic particle containers.

`amrex::RunOnGpu<PolymorphicArenaAllocator>` is `false_type` because AMReX
does not specialize `RunOnGpu` for this allocator. This causes
`DefaultInitializeRuntimeAttributes` to take the CPU code path even when
particle data lives on device, leading to segfaults when ionization
or user-defined runtime attributes are used with SYCL (and potentially
other GPU backends that don't have UVA).

This affected users that used runtime attributes on hardware that did not
successfully fell back to unified memory (and we try to avoid that anyway).

Co-Authored-By: Tim Williams <[email protected]>
@ax3l ax3l added bug Something isn't working bug: affects latest release Bug also exists in latest release version component: core Core WarpX functionality labels Apr 27, 2026
@ax3l ax3l requested a review from WeiqunZhang April 27, 2026 17:29
@ax3l ax3l enabled auto-merge (squash) April 27, 2026 18:02
@ax3l ax3l merged commit ad2c5b9 into BLAST-WarpX:development Apr 27, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: affects latest release Bug also exists in latest release version bug Something isn't working component: core Core WarpX functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants