Repository navigation
Port thrust::constant_iterator to cuda - #4812
Conversation
c0c3da7 to
eb6ef31
Compare
🟨 CI finished in 2h 39m: Pass: 89%/183 | Total: 3d 14h | Avg: 28m 22s | Max: 1h 45m | Hits: 73%/248510
|
| 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: 183)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 7 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
🟩 CI finished in 1h 59m: Pass: 100%/187 | Total: 3d 18h | Avg: 29m 00s | Max: 1h 39m | Hits: 75%/292560
|
| 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: 187)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 11 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
| [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool | ||
| operator==(const constant_iterator& __lhs, const constant_iterator& __rhs) noexcept | ||
| { | ||
| return __lhs.__index_ == __rhs.__index_; | ||
| } |
There was a problem hiding this comment.
That makes no sense to me. A constant_iterator(2) should be different from a constant_iterator(3). I think __value_ needs to be taken into account for the comparison.
There was a problem hiding this comment.
I thought so initially too, but it actually makes sense, because we compare the iterator into a sequence and not the elements of the sequence.
It becomes even worse if one considers relations: for operator< we would need to consider __value_ too, but that would restrict the stored type needlessly.
There was a problem hiding this comment.
Yes, it would put more requirements on the value, but I am wondering if there's enough of a difference from repeat_view here to justify placing more requirements. For repeat_view we can talk about the sequence and just say that you can't compare the iterators unless they come from the same view - but that's not true for free-standing iterators like this.
I think we need to either take the value into account somehow, or place an explicit requirements that boil down to constant_iterator(2) == constant_iterator(2) being illegal, because they don't originate from the same base object constructed from the given value, and that seems... worse?
There was a problem hiding this comment.
I believe we need to swallow a bad pill here.
First there are two different precedents here.
cuda::std::ranges::repeat_viewonly compares the position in the sequencethrust::constant_iteratoralso only compares the position in the sequence
So precedence is really strong. Adding additional requirements on the element pointed to by the iterator seems wrong, as generally iterators never depend on the element they point to. We determine some type aliases but thats it.
I believe in this case we need to keep to that way it is now
There was a problem hiding this comment.
I think I understand partially now. We define equality based on the position in the sequence of constant values.
I still believe the value should be considered as well, since equality for me means, that I can substitute one thing for the other. So if a == b, then f(a) and f(b) should behave the same. This would not be the case for constant_iterator.
I have checked repeat_view and thrust::constant_iterator and they indeed omit comparing the value. Sadly. So I guess we should follow the precedence for consistency.
| [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool | ||
| operator==(const constant_iterator& __lhs, const constant_iterator& __rhs) noexcept | ||
| { | ||
| return __lhs.__index_ == __rhs.__index_; | ||
| } |
There was a problem hiding this comment.
Yes, it would put more requirements on the value, but I am wondering if there's enough of a difference from repeat_view here to justify placing more requirements. For repeat_view we can talk about the sequence and just say that you can't compare the iterators unless they come from the same view - but that's not true for free-standing iterators like this.
I think we need to either take the value into account somehow, or place an explicit requirements that boil down to constant_iterator(2) == constant_iterator(2) being illegal, because they don't originate from the same base object constructed from the given value, and that seems... worse?
🟨 CI finished in 2h 07m: Pass: 83%/187 | Total: 3d 06h | Avg: 25m 01s | Max: 1h 33m | Hits: 80%/228926
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| +/- | libcu++ |
| CUB | |
| +/- | Thrust |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | CCCL Packaging |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 187)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 11 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
🟨 CI finished in 2h 05m: Pass: 99%/187 | Total: 3d 16h | Avg: 28m 19s | Max: 1h 39m | Hits: 75%/289594
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| +/- | libcu++ |
| CUB | |
| +/- | Thrust |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | CCCL Packaging |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 187)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 11 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
🟨 CI finished in 1h 09m: Pass: 99%/187 | Total: 1d 08h | Avg: 10m 24s | Max: 56m 47s | Hits: 96%/289594
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| +/- | libcu++ |
| CUB | |
| +/- | Thrust |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | CCCL Packaging |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 187)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 11 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
🟩 CI finished in 2h 24m: Pass: 100%/187 | Total: 3d 18h | Avg: 28m 53s | Max: 1h 43m | Hits: 76%/292976
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| +/- | libcu++ |
| CUB | |
| +/- | Thrust |
| CUDA Experimental | |
| stdpar | |
| python | |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| +/- | CCCL Packaging |
| +/- | libcu++ |
| +/- | CUB |
| +/- | Thrust |
| +/- | CUDA Experimental |
| +/- | stdpar |
| +/- | python |
| +/- | CCCL C Parallel Library |
| +/- | Catch2Helper |
🏃 Runner counts (total jobs: 187)
| # | Runner |
|---|---|
| 129 | linux-amd64-cpu16 |
| 15 | windows-amd64-cpu16 |
| 12 | linux-arm64-cpu16 |
| 12 | linux-amd64-gpu-rtxa6000-latest-1 |
| 11 | linux-amd64-gpu-rtx2080-latest-1 |
| 5 | linux-amd64-gpu-h100-latest-1 |
| 3 | linux-amd64-gpu-rtx4090-latest-1 |
No description provided.