Refactor: Prefer 'if constexpr' Over Preprocessor Macros - #325
Draft
ZwFink wants to merge 17 commits into
Draft
Conversation
ZwFink
force-pushed
the
remove_preprocessor_if
branch
from
November 24, 2025 18:01
d6a6879 to
2c5ade9
Compare
ZwFink
force-pushed
the
remove_preprocessor_if
branch
from
December 1, 2025 18:19
2c5ade9 to
6d1f528
Compare
koparasy
requested changes
Dec 1, 2025
|
|
||
| message(STATUS "Using LLVM installation: ${LLVM_INSTALL_DIR}") | ||
|
|
||
| # Always define GPU feature macros to numeric 0/1 for all targets |
Collaborator
There was a problem hiding this comment.
Opinion: I prefer avoiding global cmake options. I prefer having them per target and also specify the usage requirements.
Collaborator
There was a problem hiding this comment.
Why not define these in a generated config header? Do we support the values changing at use time vs. proteus library build time?
ggeorgakoudis
marked this pull request as draft
March 4, 2026 22:37
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.
Closes #298
This PR replaces some uses of
#ifdef PROTEUS_ENABLE_HIP/CUDAwithif constexpr.I do not apply this change in "top-level" entries outside any function/class definition.
Some instances yield compiler errors if changed; I leave them unchanged.