Skip to content

Commit

Permalink
Run cuda options test only with specific target.
Browse files Browse the repository at this point in the history
For now it's only x86_64-linux-gnu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242181 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Artem-B committed Jul 14, 2015
1 parent dc93651 commit ea17ce9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/Driver/cuda-options.cu
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Tests CUDA compilation pipeline construction in Driver.
// REQUIRES: clang-driver
// REQUIRES: x86-registered-target
// REQUIRES: nvptx-registered-target

// Simple compilation case:
// RUN: %clang -### -c %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu -c %s 2>&1 \
// Compile device-side to PTX assembly and make sure we use it on the host side.
// RUN: | FileCheck -check-prefix CUDA-D1 \
// Then compile host side and incorporate device code.
Expand All @@ -11,7 +13,7 @@
// RUN: -check-prefix CUDA-NL %s

// Typical compilation + link case:
// RUN: %clang -### %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu %s 2>&1 \
// Compile device-side to PTX assembly and make sure we use it on the host side
// RUN: | FileCheck -check-prefix CUDA-D1 \
// Then compile host side and incorporate device code.
Expand All @@ -20,7 +22,7 @@
// RUN: -check-prefix CUDA-L %s

// Verify that -cuda-no-device disables device-side compilation and linking
// RUN: %clang -### --cuda-host-only %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu --cuda-host-only %s 2>&1 \
// Make sure we didn't run device-side compilation.
// RUN: | FileCheck -check-prefix CUDA-ND \
// Then compile host side and make sure we don't attempt to incorporate GPU code.
Expand All @@ -29,15 +31,15 @@
// RUN: -check-prefix CUDA-NL %s

// Verify that -cuda-no-host disables host-side compilation and linking
// RUN: %clang -### --cuda-device-only %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu --cuda-device-only %s 2>&1 \
// Compile device-side to PTX assembly
// RUN: | FileCheck -check-prefix CUDA-D1 \
// Make sure there are no host cmpilation or linking.
// RUN: -check-prefix CUDA-NH -check-prefix CUDA-NL %s

// Verify that with -S we compile host and device sides to assembly
// and incorporate device code on the host side.
// RUN: %clang -### -S -c %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu -S -c %s 2>&1 \
// Compile device-side to PTX assembly
// RUN: | FileCheck -check-prefix CUDA-D1 \
// Then compile host side and incorporate GPU code.
Expand All @@ -47,7 +49,7 @@

// Verify that --cuda-gpu-arch option passes correct GPU
// archtecture info to device compilation.
// RUN: %clang -### --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// Compile device-side to PTX assembly.
// RUN: | FileCheck -check-prefix CUDA-D1 -check-prefix CUDA-D1-SM35 \
// Then compile host side and incorporate GPU code.
Expand All @@ -57,7 +59,7 @@

// Verify that there is device-side compilation per --cuda-gpu-arch args
// and that all results are included on the host side.
// RUN: %clang -### --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \
// RUN: %clang -### -target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \
// Compile both device-sides to PTX assembly
// RUN: | FileCheck \
// RUN: -check-prefix CUDA-D1 -check-prefix CUDA-D1-SM35 \
Expand Down

0 comments on commit ea17ce9

Please sign in to comment.