[libcu++] Fix __detectably_invalid value returned during constant evaluation#8987
[libcu++] Fix __detectably_invalid value returned during constant evaluation#8987davebayer wants to merge 1 commit into
__detectably_invalid value returned during constant evaluation#8987Conversation
📝 WalkthroughSummary by CodeRabbit
suggestion: WalkthroughThree accessor implementations adjust consteval handling: ChangesAccessor consteval and fallback changes
Comment |
b832c9f to
f8168ba
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
libcudacxx/include/cuda/__mdspan/host_device_accessor.h (2)
199-202: ⚡ Quick winsuggestion: add a regression test that exercises
__host_accessor::accessin constant evaluation and non-constant-evaluation device compilation paths, so the new_CCCL_IF_NOT_CONSTEVAL_DEFAULTguard behavior is pinned.
223-223: ⚡ Quick winsuggestion: add constexpr-focused regression tests for
__detectably_invalidin host/device/managed accessors to lock the newreturn falsefallback and prevent behavior drift.As per coding guidelines: "libcudacxx/**/*: Focus on correctness, ABI/API stability, standard-library conformance, host/device availability, NVRTC compatibility, supported C++ standards, tests, and portability across supported CUDA toolchains."
Also applies to: 358-358, 478-478
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 18e3baf1-78d9-4ab6-b47f-346ae08b05ce
📒 Files selected for processing (1)
libcudacxx/include/cuda/__mdspan/host_device_accessor.h
In host/device mdspans, we check whether the pointer address corresponds with the type in
__detectably_invalidaccessor method. However, we have no way to find out during constant evaluation. Unfortunately we returnedtrue(always invalid) instead offalse(always valid) in this case. This PR fixes that.