[cfe-dev] CUDA Compilation Issue - Possible bug?

Hal Finkel via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 30 05:36:22 PDT 2017


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.

  -Hal

On 08/29/2017 03:54 AM, Lorenz Braun via cfe-dev wrote:
> 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 streamcluster_cuda.cu 
> streamcluster_header.cu -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?
>
> Regards
> Lorenz
>
> [0] https://www.cs.virginia.edu/~skadron/wiki/rodinia/index.php/Main_Page
> [1] https://bugs.llvm.org/show_bug.cgi?id=30250
> [2] https://bugs.llvm.org/show_bug.cgi?id=26400
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170830/7abd52e6/attachment.html>


More information about the cfe-dev mailing list