Repository navigation
Use environment based CUB APIs when possible in PSTL - #8526
Conversation
| _OffsetType __ret; | ||
|
|
||
| auto __stream = ::cuda::__call_or(::cuda::get_stream, ::cuda::stream_ref{cudaStreamPerThread}, __policy); | ||
| auto __stream = ::cuda::__call_or(::cuda::get_stream, ::cuda::stream_ref{cudaStream_t{}}, __policy); |
There was a problem hiding this comment.
@bernhardmgruber using an open coded stream seems to be very error prone. I believe we should put that into a separate function in get_stream.h so that all algorithms in CCCL use the same default stream when possible?
There was a problem hiding this comment.
I agree! But I am certain we have different defaults in different places. CUB's public API has a lot of cudaSteam_t stream = nullptr parameters. git grep shows me 35 instances of cudaStream_t{} and 25 cudaStreamPerThread{}.
We should definitely use the same default for PSTL, which hasn't shipped yet. So we can at least make a common function for PSTL.
There was a problem hiding this comment.
The problem is that PSTL must use the same stream if we want to use the CUB environment APIs
Otherwise us synchronizing after the algorithm wont have any effect
There was a problem hiding this comment.
Oh, I see the problem. I think we use the null stream everywhere at the CUB public API, so that's what we should use in the PSTL then as well.
|
|
||
| // Allocate memory for result | ||
| auto __stream = ::cuda::__call_or(::cuda::get_stream, ::cuda::stream_ref{cudaStreamPerThread}, __policy); | ||
| auto __stream = ::cuda::__call_or(::cuda::get_stream, ::cuda::stream_ref{cudaStream_t{}}, __policy); |
There was a problem hiding this comment.
@pciolkosz which stream is actually better as a default? The per thread or the per stream one?
🥳 CI Workflow Results🟩 Finished in 2h 02m: Pass: 100%/108 | Total: 1d 08h | Max: 1h 42m | Hits: 96%/282975See results here. |
Some of our PSTL algorithms can use the new environment based CUB APIs
This gives us the advantage that the user can pass tunings / guarantees along with the execution policy.