Clang/CUDA: --cuda-path

Hi,

I installed the latest version of clang 3.8 from the llvm deb packages
(http://llvm.org/apt/) and have a Debian Jessie with cuda 6.0 from the
official Debian repos installed and running (under /usr).

When trying to compile a cuda program, the typical cuda extensions and
APIs such as `__device__` and `cudaMalloc` are now known to clang,
although I did set --cuda-arch=sm_35 and --cuda-path=/usr

  mandelbrot.cu: error: unknown type name '__device__'
    __device__ cuComplex( float a, float b ) : r(a), i(b) {}

  mandelbrot.cu: error: unknown type name '__global__'
    __global__ void calcMandelbrot( int* color_d, const int num_rows,
    const int num...

  mandelbrot.cu: error: use of undeclared identifier 'cudaMalloc'
        cudaMalloc( (void**)&color_d, nBytes );

  [...]

I had a similar problem with a development version published in November
but setting --cuda-path solved it that time (I think the cuda path was
not in /usr but in a /opt path on our cluster).

Did I miss an option or is the detection in /usr installs failing?

Today's versions:

$ clang++-3.8 --version
clang version 3.8.0-svn260756-1~exp1 (branches/release_38)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Thu_Mar_13_11:58:58_PDT_2014
Cuda compilation tools, release 6.0, V6.0.1

$ locate cuda.h
/usr/include/cuda.h
$ which nvcc
/usr/bin/nvcc
$ which clang++-3.8
/usr/bin/clang++-3.8

Compile :

$ clang++-3.8 --cuda-gpu-arch=sm_35 mandelbrot.cu -I/usr/include/
-L/usr/lib/x86_64-linux-gnu/ -lcudart -lcudart_static -ldl -lrt -pthread
-I/usr/include/x86_64-linux-gnu
# also tried with -lcuda

File to compile:
  cpp_snippets/mandelbrot.cu at master · ax3l/cpp_snippets · GitHub

Best regards,
Axel Huebl

Uh there is a cfe-dev list, I will move the question there.

Sorry for the noise!