Repository navigation
Improve _CCCL_UNREACHABLE - #4443
Conversation
🟨 CI finished in 3h 23m: Pass: 83%/174 | Total: 3d 22h | Avg: 32m 42s | Max: 2h 05m | Hits: 37%/220573
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 174)
| # | Runner |
|---|---|
| 123 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 10 | linux-amd64-gpu-rtx2080-latest-1 |
| 6 | linux-amd64-gpu-rtxa6000-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
miscco
left a comment
There was a problem hiding this comment.
We cannot do that, you can add that to std::unreachable, but the builtin must stay as is
🟩 CI finished in 1h 32m: Pass: 100%/174 | Total: 1d 11h | Avg: 12m 09s | Max: 1h 00m | Hits: 80%/271100
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 174)
| # | Runner |
|---|---|
| 123 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 10 | linux-amd64-gpu-rtx2080-latest-1 |
| 6 | linux-amd64-gpu-rtxa6000-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
|
|
||
| [[noreturn]] _LIBCUDACXX_HIDE_FROM_ABI void unreachable() | ||
| { | ||
| _CCCL_ASSERT(false, "unreachable"); |
There was a problem hiding this comment.
I am not in favor of this change. The whole function is UB and adding that assert does not improve diagnostics in any way. Especially given that it is disabled by default on release mode and not _CCCL_VERIFY:
Is there any indication that we have had issues where this would have helped?
There was a problem hiding this comment.
gcc/clang don't warn about unreachable paths in many cases. We need to check in our test/debug mode if an unreachable path is reached at run-time. UB is much harder to debug.
There was a problem hiding this comment.
What I am concerned about is that this potentially adds a ton of dead code to the binary
On the other hand, we do internally only use the macro so we are fine
There was a problem hiding this comment.
currently cuda::std::unreacheble is almost unusable without compiler support. I'm fine to remove the assertion.
🟩 CI finished in 1h 38m: Pass: 100%/174 | Total: 1d 20h | Avg: 15m 27s | Max: 1h 35m | Hits: 76%/271100
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 174)
| # | Runner |
|---|---|
| 123 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 10 | linux-amd64-gpu-rtx2080-latest-1 |
| 6 | linux-amd64-gpu-rtxa6000-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
…chable/unreachable.runfail.cpp Co-authored-by: Michael Schellenberger Costa <miscco@nvidia.com>
🟨 CI finished in 1h 15m: Pass: 94%/174 | Total: 1d 14h | Avg: 13m 10s | Max: 1h 04m | Hits: 78%/259498
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 174)
| # | Runner |
|---|---|
| 123 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 10 | linux-amd64-gpu-rtx2080-latest-1 |
| 6 | linux-amd64-gpu-rtxa6000-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
🟩 CI finished in 4h 36m: Pass: 100%/174 | Total: 1d 12h | Avg: 12m 27s | Max: 39m 57s | Hits: 79%/271100
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 174)
| # | Runner |
|---|---|
| 123 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 10 | linux-amd64-gpu-rtx2080-latest-1 |
| 6 | linux-amd64-gpu-rtxa6000-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
Description
The PR adds a run-time assertion to_CCCL_UNREACHABLEto check if the path is reached during the execution. This helps to prevent potential errors, especially with non-trivial branch logic.The PR ensures that the built-in is used in all cases and simplify the conditions