diff options
| author | Artem Belevich <tra@google.com> | 2015-11-17 22:28:55 +0000 |
|---|---|---|
| committer | Artem Belevich <tra@google.com> | 2015-11-17 22:28:55 +0000 |
| commit | 8601733c1cec09bbda859129eb00a560dca034bb (patch) | |
| tree | e06469532f1c3f3bdaec5e5e99abdef7801446bf /clang/test | |
| parent | c29db84419592e98e71a08d1a9fb04a3d6b51a0c (diff) | |
| download | bcm5719-llvm-8601733c1cec09bbda859129eb00a560dca034bb.tar.gz bcm5719-llvm-8601733c1cec09bbda859129eb00a560dca034bb.zip | |
[CUDA] Make CUDA compilation usable by default.
Currently clang requires several additional command
line options in order to enable new features needed
during CUDA compilation. This patch makes these
options default.
* Automatically include cuda_runtime.h if we've found
a valid CUDA installation.
* Disable automatic CUDA header inclusion during unit tests.
* Added test case for command line construction.
* Enabled target overloads and relaxed call checks that are
needed in order to include CUDA headers.
* Added CUDA-7.5 installation path to the CUDA installation search list.
* Define __CUDA__ macro to indicate CUDA compilation.
llvm-svn: 253389
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Driver/cuda-detect.cu | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/test/Driver/cuda-detect.cu b/clang/test/Driver/cuda-detect.cu index 085ef61a0ab..160ca11964f 100644 --- a/clang/test/Driver/cuda-detect.cu +++ b/clang/test/Driver/cuda-detect.cu @@ -8,8 +8,6 @@ // RUN: %clang -v --target=i386-unknown-linux \ // RUN: --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s // RUN: %clang -v --target=i386-unknown-linux \ -// RUN: --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s -// RUN: %clang -v --target=i386-unknown-linux \ // RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s // Make sure we map libdevice bitcode files to proper GPUs. @@ -40,6 +38,12 @@ // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ // RUN: -nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ // RUN: | FileCheck %s -check-prefix COMMON -check-prefix NOLIBDEVICE +// Verify that we don't add include paths, link with libdevice or +// -include cuda_runtime without valid CUDA installation. +// RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ +// RUN: --cuda-path=%S/no-cuda-there %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix COMMON \ +// RUN: -check-prefix NOCUDAINC -check-prefix NOLIBDEVICE // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda // NOCUDA-NOT: Found CUDA installation: @@ -55,5 +59,6 @@ // NOLIBDEVICE-NOT: "-target-feature" "+ptx42" // CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA/usr/local/cuda/include" // NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include" +// CUDAINC-SAME: "-include" "cuda_runtime.h" +// NOCUDAINC-NOT: "-include" "cuda_runtime.h" // COMMON-SAME: "-x" "cuda" - |

