CUDA Compilation Issue - Possible bug?

Hi there,

i am currently using clang/clang++ to compile the CUDA part of the rodinia benchmarksuite [0]. Besides some already known bugs regarding the use of texture memory [1],[2] i have found another problem. It is only occurring for the CUDA version of the streamcluster application.

Here is how the application is compiled:
clang++ --cuda-path=/opt/cuda-8.0 -lcudart -I/opt/cuda-8.0/include -O3 streamcluster_cuda_cpu.cpp -o sc_gpu

This leads to several errors with the new and delete operator defines in the cuda_wrapper of clang (see attachment).

There is a workaround though. Compiling the source files in separate objects and linking them afterwards works just fine. Therefore i am not sure if this might be a bug.
What do you think?


[1] 30250 – tex1Dfetch fails to compile
[2] 26400 – [CUDA] cannot find matching tex2D

compilation_log.txt (3.68 KB)

Hi, Lorenz,

I recommend that you file a bug so that we can track this.

/opt/llvm-5.0/lib/clang/5.0.0/include/cuda_wrappers/new:37:1: error: unknown type name ‘device
device inline void *operator new(SIZE_TYPE, void *__ptr) CUDA_NOEXCEPT {

This certainly looks like a bug of some kind.


I have filed the bug. You can find it here:
Regards Lorenz