Improvements to AMREX_ASSERT#4581
Merged
WeiqunZhang merged 10 commits intoAMReX-Codes:developmentfrom Aug 8, 2025
Merged
Conversation
WeiqunZhang
approved these changes
Aug 8, 2025
mirenradia
added a commit
to GRTLCollaboration/GRTeclyn
that referenced
this pull request
Aug 8, 2025
The changes in AMReX-Codes/amrex#4581 mean this message is required to be a string as the macro no longer converts it for us.
mirenradia
added a commit
to GRTLCollaboration/GRTeclyn
that referenced
this pull request
Aug 8, 2025
The changes in AMReX-Codes/amrex#4581 mean this message is required to be a string as the macro no longer converts it for us. This fixes #133.
9 tasks
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.
Summary
Previously the
AMREX_ASSERT_WITH_MESSAGEandAMREX_ALWAYS_ASSERT_WITH_MESSAGEmacros converted the messege to a string using# MSGwhich resulted in strange formatting and the printing of runtime values to not work.Additionally,
ALWAYS_ASSERTandASSERTdid not work in device code even when compiling withAMREX_USE_ASSERTIONdue to the#if defined(NDEBUG)inAssert (...).Now
ALWAYS_ASSERTandASSERTwill work in device code withAMREX_USE_ASSERTION, but not without so the behaviour doesn't change of the few places that useALWAYS_ASSERTon the GPU (meaningALWAYS_ASSERTstill does not always assert).Test of the assert:
amrex/Src/Particle/AMReX_StructOfArrays.H
Line 122 in 5bd9494
Dev:
PR:
Additional background
Checklist
The proposed changes: