Skip to content

[BUG]: Unqualified warpReduce in warpspeed scan kernel causes ADL collision #8233

@viclafargue

Description

@viclafargue

Is this a duplicate?

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

needs triageIssues that require the team's attention

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions