Add test_reduce_api.py::test_reduce_struct_type_minmax#3938
Merged
oleksandr-pavlyk merged 5 commits intoNVIDIA:mainfrom Feb 25, 2025
Merged
Add test_reduce_api.py::test_reduce_struct_type_minmax#3938oleksandr-pavlyk merged 5 commits intoNVIDIA:mainfrom
oleksandr-pavlyk merged 5 commits intoNVIDIA:mainfrom
Conversation
This adds an example of using struct that holds minimum and maximum values to compute smallest and largest values of an array using a single call cub::DeviceReduce It also demonstrates a use of TransformedIterator to map input array values as v -> MinMax(v,v) to make reduction binary operator commutative, to render data-parallel algorithm applicable. Since this is done in registers, each element of input array is only accessed once.
shwina
approved these changes
Feb 25, 2025
Contributor
🟥 CI finished in 7m 40s: Pass: 0%/1 | Total: 7m 40s | Avg: 7m 40s | Max: 7m 40s
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
🏃 Runner counts (total jobs: 1)
| # | Runner |
|---|---|
| 1 | linux-amd64-gpu-rtx2080-latest-1 |
Contributor
🟩 CI finished in 50m 06s: Pass: 100%/1 | Total: 50m 06s | Avg: 50m 06s | Max: 50m 06s
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
🏃 Runner counts (total jobs: 1)
| # | Runner |
|---|---|
| 1 | linux-amd64-gpu-rtx2080-latest-1 |
Contributor
🟩 CI finished in 50m 53s: Pass: 100%/1 | Total: 50m 53s | Avg: 50m 53s | Max: 50m 53s
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
🏃 Runner counts (total jobs: 1)
| # | Runner |
|---|---|
| 1 | linux-amd64-gpu-rtx2080-latest-1 |
davebayer
pushed a commit
to davebayer/cccl
that referenced
this pull request
Apr 7, 2025
* Add test_reduce_api.py::test_reduce_struct_type_minmax This adds an example of using struct that holds minimum and maximum values to compute smallest and largest values of an array using a single call cub::DeviceReduce It also demonstrates a use of TransformedIterator to map input array values as v -> MinMax(v,v) to make reduction binary operator commutative, to render data-parallel algorithm applicable. Since this is done in registers, each element of input array is only accessed once. * Refined docstring text * Change reduce-minmax to compute mininum/maximum absolute values of an array * Replace embedding_op to transform_op, add comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an example of using struct that holds minimum and maximum values to compute smallest and largest values of an array using a single call
cub::DeviceReduceIt also demonstrates a use of
TransformedIteratorto map input array values asv -> MinMax(v,v)to make reduction binary operator commutative, to render data-parallel algorithm applicable. Since this is done in registers, each element of input array is only accessed once.Docstring of
gpu_structis modified to reference newly added example.Description
closes gh-3937
Checklist