# Error when using nvcc compiling include cub

**URL:** <https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825>\
**Category:** CUDA Programming and Performance\
**Tags:** cuda\
**Created:** [December 21, 2023, 8:16am UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825 "2023-12-21T08:16:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdu\_benchao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@fdu\_benchao](https://forums.developer.nvidia.com/u/fdu_benchao)\
**Post date:** [December 21, 2023, 8:16am UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825/1 "2023-12-21T08:16:11Z")

</div>

Error Info:  
/usr/local/cuda-12/bin/nvcc /home/dev/Open-Source/DREAMPlace/dreamplace/ops/pin\_pos/src/pin\_pos\_cuda\_segment\_kernel.cu -c -o /home/dev/Open-Source/DREAMPlace/build/dreamplace/ops/pin\_pos/CMakeFiles/pin\_pos\_cuda\_segment\_cuda\_tmp.dir/src/./pin\_pos\_cuda\_segment\_cuda\_tmp\_generated\_pin\_pos\_cuda\_segment\_kernel.cu.o -m64 -DTORCH\_EXTENSION\_NAME=pin\_pos\_cuda\_segment -DTORCH\_MAJOR\_VERSION= -DTORCH\_MINOR\_VERSION= -DENABLE\_CUDA=1 -D\_GLIBCXX\_USE\_CXX11\_ABI=1 -Xcompiler ,"-O3","-DNDEBUG" -gencode arch=compute\_60,code=sm\_60 -gencode arch=compute\_61,code=sm\_61 -gencode arch=compute\_70,code=sm\_70 -gencode arch=compute\_75,code=sm\_75 -gencode arch=compute\_80,code=sm\_80 --compiler-options -fPIC -DNVCC -I/usr/local/cuda-12/include -I/home/dev/Open-Source/DREAMPlace/thirdparty/flute -I/home/dev/Open-Source/DREAMPlace/thirdparty/OpenTimer -I/home/dev/Open-Source/DREAMPlace/dreamplace/ops/pin\_pos/… -I/home/dev/miniconda3/envs/pytorch/lib/python3.8/site-packages/torch/include -I/home/dev/miniconda3/envs/pytorch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dev/Open-Source/DREAMPlace/thirdparty/pybind11/include -I/home/dev/miniconda3/envs/pytorch/include/python3.8  
/usr/local/cuda-12/include/cub/agent/agent\_three\_way\_partition.cuh(78): error: name followed by “::” must be a class or namespace name  
struct accumulator\_pack\_base\_t\<OffsetT, typename cuda::std::enable\_if\<sizeof(OffsetT) == 4\>::type\>  
^

/usr/local/cuda-12/include/cub/agent/agent\_three\_way\_partition.cuh(78): error: expected an identifier  
struct accumulator\_pack\_base\_t\<OffsetT, typename cuda::std::enable\_if\<sizeof(OffsetT) == 4\>::type\>  
^

/usr/local/cuda-12/include/cub/agent/agent\_three\_way\_partition.cuh(78): error: expected a “\>”  
struct accumulator\_pack\_base\_t\<OffsetT, typename cuda::std::enable\_if\<sizeof(OffsetT) == 4\>::type\>  
^

/usr/local/cuda-12/include/cub/agent/agent\_three\_way\_partition.cuh(78): error: expected a “;”  
struct accumulator\_pack\_base\_t\<OffsetT, typename cuda::std::enable\_if\<sizeof(OffsetT) == 4\>::type\>

And I have tried gcc 7.5 8.5 9.5 10.5, all not work

---

<div class="post-metadata">

**Author:** ![striker159](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@striker159](https://forums.developer.nvidia.com/u/striker159)\
**Post date:** [December 21, 2023, 9:03am UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825/2 "2023-12-21T09:03:08Z")

</div>

Please show a minimal complete code example that reproduces the error.

---

<div class="post-metadata">

**Author:** ![Ayka](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/ayka/32/158419_2.png) [@Ayka](https://forums.developer.nvidia.com/u/Ayka)\
**Post date:** [May 19, 2024, 12:09pm UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825/3 "2024-05-19T12:09:45Z")

</div>

Have you tried to downgrade your CUDA version?

---

<div class="post-metadata">

**Author:** ![Curefab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Curefab](https://forums.developer.nvidia.com/u/Curefab)\
**Post date:** [May 19, 2024, 6:55pm UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825/4 "2024-05-19T18:55:10Z")

</div>

> [@fdu\_benchao](#):
>
> agent\_three\_way\_partition.cuh

See [[BUG]: Compilation error after updating to CCCL monorepo · Issue #1170 · NVIDIA/cccl · GitHub](https://github.com/NVIDIA/cccl/issues/1170)

---

<div class="post-metadata">

**Author:** ![Ayka](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/ayka/32/158419_2.png) [@Ayka](https://forums.developer.nvidia.com/u/Ayka)\
**Post date:** [May 22, 2024, 12:35pm UTC](https://forums.developer.nvidia.com/t/error-when-using-nvcc-compiling-include-cub/276825/5 "2024-05-22T12:35:03Z")

</div>

Thanks. I’ve tried this before but it makes no difference. The errors still exist.
