Open YoniSp opened 4 weeks ago
I suspect what is happening here is trying to use thrust::complex
across two object files compiled with and without nvcc.
Unfortunately, a recent-ish change means this is no longer supported because thrust
types do not have a consistent ABI between TUs compiled with and without nvcc. See: https://github.com/NVIDIA/cccl?tab=readme-ov-file#application-binary-interface-abi
Luckily, it should be a pretty easy fix to replace #include <thrust/complex.h>
and thrust::complex
with #include <cuda/std/complex>
and cuda::std::complex
.
Let us know if that works for you!
If I am using cuda::std::complex
, is there a guarantee that the ABI will not be different when using it on c++ and cu files in the same project?
If I am using
cuda::std::complex
, is there a guarantee that the ABI will not be different when using it on c++ and cu files in the same project?
Yes. All cuda::
types have a consistent ABI between c++ and cu files.
Is this a duplicate?
Type of Bug
Compile-time Error
Component
Thrust
Describe the bug
Fail to build a project with object that are template instantiate of thrust::complex.
How to Reproduce
Build the c++ project without success with Cuda 12.4 or above proj.zip
Expected behavior
The build process will fail
Reproduction link
No response
Operating System
Rocky Linux 9 and 8
nvidia-smi output
No response
NVCC version
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Wed_Apr_17_19:19:55_PDT_2024 Cuda compilation tools, release 12.5, V12.5.40 Build cuda_12.5.r12.5/compiler.34177558_0