Handle argmin/argmax tuple accumulators in CUB#1096
Merged
cliffburdick merged 1 commit intoNVIDIA:mainfrom Nov 24, 2025
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryModified Key changes:
Why this was needed: Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client as argmax/argmin_impl
participant Reduce as cub_argreduce
participant CUB as CUB DeviceReduce
participant Comparator as CustomArgMax/MinCmp
Client->>Reduce: Call with thrust::tuple initial_value
Reduce->>Reduce: Create zip iterator (index, value pairs)
Reduce->>CUB: DeviceReduce::Reduce(zipped_input, zipped_output, comparator, init)
Note over CUB: Accumulator stored as tuple<br/>Iterator provides pair
CUB->>Comparator: operator()(tuple accumulator, pair input)
Comparator->>Comparator: ToTuple(accumulator) → tuple
Comparator->>Comparator: ToTuple(input) → tuple
Comparator->>Comparator: Compare values at index 1
Comparator-->>CUB: Return selected tuple
CUB-->>Reduce: Reduction complete
Reduce-->>Client: Return result
|
Collaborator
|
/build |
cliffburdick
approved these changes
Nov 24, 2025
Collaborator
|
Thanks! |
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.
Summary
Testing
-- Finding CCCL...
-- CPM: Adding package CCCL@3.2.0 (0320434)
-- Finding CCCL components: Thrust;CUB;libcudacxx
-- cccl_cmake_dir: /tmp/MatX/build/_deps/cccl-src/lib/cmake/cccl
-- Found Thrust: /tmp/MatX/build/_deps/cccl-src/lib/cmake/thrust/thrust-config.cmake (found suitable exact version "3.2.0.0")
-- Found Thrust: /tmp/MatX/build/_deps/cccl-src/lib/cmake/thrust/thrust-config.cmake (found version "3.2.0.0")
-- Cannot find nvtiff library. Disabling MatX nvtiff features.
-- Enabling pybind11 support
-- CPM: Using local package pybind11@2.13.6
-- checking python import module numpy
-- checking python import module cupy
-- The optional python package cupy package is not installed. Some unit tests and functionality may not work
-- CPM: Adding package GTest@1.17.0 (v1.17.0)
-- Configuring done (0.4s)
-- Generating done (0.2s)
-- Build files have been written to: /tmp/MatX/build
[100%] Building CUDA object test/CMakeFiles/test_00_operators_ReductionTests.dir/main.cu.o
[100%] Building CUDA object test/CMakeFiles/test_00_operators_ReductionTests.dir/00_operators/ReductionTests.cu.o (fails early on this machine because GCC 11's libstdc++ lacks , but the build proceeds far enough to confirm the templates instantiate as expected)
Fixes #1095.