NVIDIA / NVIDIA/cccl

[BUG]: cuda/std/utility takes long to compile

Open
#5,720 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Type of Bug

Performance

### Component

libcu++

### Describe the bug

`cuda/std/utility` is slow to compile (3x slower than `utility`)

```
$ time nvcc -x cu -c <(echo '#include ')

real 0m0.634s
user 0m0.392s
sys 0m0.089s

$ time nvcc -x cu -c <(echo '#include ')

real 0m1.843s
user 0m1.006s
sys 0m0.210s
```

The header transitively includes floating point headers, making it slow to compile. It also includes the host `iterator` header (from `cuda/std/__type_traits/is_primary_template.h`).

Screenshot from perfetto.dev trace:

[cuda_std_utility.json](https://github.com/user-attachments/files/22047355/cuda_std_utility.json)

Image

### How to Reproduce

$ time nvcc -x cu -c <(echo '#include ')

real 0m0.634s
user 0m0.392s
sys 0m0.089s

$ time nvcc -x cu -c <(echo '#include ')

real 0m1.843s
user 0m1.006s
sys 0m0.210s

### Expected behavior

Should be faster. Should not include cuda fp headers.

### Reproduction link

_No response_

### Operating System

_No response_

### nvidia-smi output

_No response_

### NVCC version

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.