-
Notifications
You must be signed in to change notification settings - Fork 373
[BUG]: Unqualified warpReduce in warpspeed scan kernel causes ADL collision #8233
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Compile-time Error
Component
CUB
Describe the bug
The warpspeed scan kernel (kernel_scan_warpspeed.cuh) calls warpReduce() unqualified. When ScanOpT is a type from an external namespace that also defines a warpReduce function template, ADL pulls that function into the overload set and causes an ambiguity error.
This affects any downstream code that passes a custom scan operator to thrust::inclusive_scan / cub::DeviceScan when compiling for sm_100+ (where the warpspeed kernel is selected).
Fix: qualify the call as ::cub::detail::scan::warpReduce to prevent ADL.
How to Reproduce
Minimal reproducer: pass a scan operator from a namespace that also contains a two-argument warpReduce function template. In practice, this is triggered by RAFT's raft::add_op + raft::warpReduce.
See rapidsai/cuvs#1954.
Expected behavior
Successful compilation.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status