Skip to content

Fix array assert compilation failure#297

Merged
psychocoderHPC merged 1 commit intoalpaka-group:devfrom
chillenzer:fix-array-assert-with-modern-compilers
Feb 2, 2026
Merged

Fix array assert compilation failure#297
psychocoderHPC merged 1 commit intoalpaka-group:devfrom
chillenzer:fix-array-assert-with-modern-compilers

Conversation

@chillenzer
Copy link
Copy Markdown
Contributor

There's an unfortunate compiler compilation that fails to build some standard library code:

  • Modern GCC >= 15 has some memory hardening that performs bounds-checking via non-constexpr asserts for spans and arrays.
  • Clang device compilation relies on the standard library being constexpr for device support of the standard library.

Thus, if you try to compile standard library code for device, you might hit those asserts being non-constexpr host-only functions. LLVM >= 21.8.0 has a workaround for this (see there for details, examples, etc.) but the ROCm 6.x.x stack builds on a much older LLVM version.

This PR replaces standard library span with an own constexpr-only implementation of the necessary functionality.

@chillenzer chillenzer added this to the 3.0.0 milestone Feb 2, 2026
@chillenzer chillenzer added the bug label Feb 2, 2026
@chillenzer chillenzer marked this pull request as ready for review February 2, 2026 10:34
@psychocoderHPC psychocoderHPC merged commit e004043 into alpaka-group:dev Feb 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants