Skip to content

[BUG]: nvcc -arch=all fails with cub/cub.cuh included due to CCCL_PP_SPLICE_WITH issue #4967

Closed
conda-forge/llama.cpp-feedstock
#76

Description

@JKtheSlacker

Is this a duplicate?

Type of Bug

Compile-time Error

Component

General CCCL

Describe the bug

When compiling with nvcc with <cub/cub.cuh> or <thrust/thrust.cuh> included and -arch=all, the compile will error with " error: macro "_CCCL_PP_SPLICE_WITH_IMPL1" passed 3 arguments, but takes just 2"

How to Reproduce

  1. Simple reproduction program:
    #include <cub/cub.cuh> int main() { return 0; }
  2. nvcc -E -arch=all repro_splice_bug.cu > repro_splice_bug.cu
  3. Note the error spam

/opt/cuda-12.9/bin/../targets/x86_64-linux/include/cub/util_macro.cuh:50:1: error: macro "_CCCL_PP_SPLICE_WITH_IMPL1" passed 3 arguments, but takes just 2
50 | CUB_NAMESPACE_BEGIN
| ^~~~~

  1. Review preprocessed code to confirm it ran out of tokens building the arch string:

namespace cub { inline namespace CUB_200802_SM_500_520_530_600_610_620_700_720_750_800_860_870_890_900_1000_1010_1030__CCCL_PP_SPLICE_WITH_IMPL1 {

Expected behavior

The preprocessor should be able to handle all known architectures and future architectures as well

Reproduction link

No response

Operating System

Slackware -current Linux, but looks to be universal.

nvidia-smi output

No response

NVCC version

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Tue_May_27_02:21:03_PDT_2025
Cuda compilation tools, release 12.9, V12.9.86
Build cuda_12.9.r12.9/compiler.36037853_0

Activity

  1. bernhardmgruber commented on Jun 12, 2025

    @bernhardmgruber
    Contributor
    1. Review preprocessed code to confirm it ran out of tokens building the arch string:

    namespace cub { inline namespace CUB_200802_SM_500_520_530_600_610_620_700_720_750_800_860_870_890_900_1000_1010_1030__CCCL_PP_SPLICE_WITH_IMPL1 {

    I am sorry I didn't expect we had so many CUDA arches already :D Thanks for the report!

  2. added a commit that references this issue on Jun 12, 2025
    a43bf07
  3. moved this from Todo to In Review in CCCLon Jun 12, 2025
  4. JKtheSlacker commented on Jun 12, 2025

    @JKtheSlacker
    Author

    Just for posterity, I missed that _CCCL_PP_SPLICE_WITH_IMPL20 was skipped, which appears to have been the actual problem. The proposed fix handles that as well as more future architectures.

  5. added a commit that references this issue on Jun 15, 2025
    2c2276d
  6. moved this from In Review to Done in CCCLon Jun 15, 2025
  7. added 3 commits that reference this issue on Jun 16, 2025
    1a62059
    11765a4
    3878bea
  8. added a commit that references this issue on Jun 17, 2025
    0772686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions