-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CUDA] Collapsed offload actions should not be top-level jobs.
If they are, we end up with the last intermediary output preserved in the current directory after compilation. Added a test case to verify that we're using appropriate filenames for outputs of different phases. Differential Revision: https://reviews.llvm.org/D23526 llvm-svn: 279455
- llvmorg-21-init
- llvmorg-20.1.0
- llvmorg-20.1.0-rc3
- llvmorg-20.1.0-rc2
- llvmorg-20.1.0-rc1
- llvmorg-20-init
- llvmorg-19.1.7
- llvmorg-19.1.6
- llvmorg-19.1.5
- llvmorg-19.1.4
- llvmorg-19.1.3
- llvmorg-19.1.2
- llvmorg-19.1.1
- llvmorg-19.1.0
- llvmorg-19.1.0-rc4
- llvmorg-19.1.0-rc3
- llvmorg-19.1.0-rc2
- llvmorg-19.1.0-rc1
- llvmorg-19-init
- llvmorg-18.1.8
- llvmorg-18.1.7
- llvmorg-18.1.6
- llvmorg-18.1.5
- llvmorg-18.1.4
- llvmorg-18.1.3
- llvmorg-18.1.2
- llvmorg-18.1.1
- llvmorg-18.1.0
- llvmorg-18.1.0-rc4
- llvmorg-18.1.0-rc3
- llvmorg-18.1.0-rc2
- llvmorg-18.1.0-rc1
- llvmorg-18-init
- llvmorg-17.0.6
- llvmorg-17.0.5
- llvmorg-17.0.4
- llvmorg-17.0.3
- llvmorg-17.0.2
- llvmorg-17.0.1
- llvmorg-17.0.0
- llvmorg-17.0.0-rc4
- llvmorg-17.0.0-rc3
- llvmorg-17.0.0-rc2
- llvmorg-17.0.0-rc1
- llvmorg-17-init
- llvmorg-16.0.6
- llvmorg-16.0.5
- llvmorg-16.0.4
- llvmorg-16.0.3
- llvmorg-16.0.2
- llvmorg-16.0.1
- llvmorg-16.0.0
- llvmorg-16.0.0-rc4
- llvmorg-16.0.0-rc3
- llvmorg-16.0.0-rc2
- llvmorg-16.0.0-rc1
- llvmorg-16-init
- llvmorg-15.0.7
- llvmorg-15.0.6
- llvmorg-15.0.5
- llvmorg-15.0.4
- llvmorg-15.0.3
- llvmorg-15.0.2
- llvmorg-15.0.1
- llvmorg-15.0.0
- llvmorg-15.0.0-rc3
- llvmorg-15.0.0-rc2
- llvmorg-15.0.0-rc1
- llvmorg-15-init
- llvmorg-14.0.6
- llvmorg-14.0.5
- llvmorg-14.0.4
- llvmorg-14.0.3
- llvmorg-14.0.2
- llvmorg-14.0.1
- llvmorg-14.0.0
- llvmorg-14.0.0-rc4
- llvmorg-14.0.0-rc3
- llvmorg-14.0.0-rc2
- llvmorg-14.0.0-rc1
- llvmorg-14-init
- llvmorg-13.0.1
- llvmorg-13.0.1-rc3
- llvmorg-13.0.1-rc2
- llvmorg-13.0.1-rc1
- llvmorg-13.0.0
- llvmorg-13.0.0-rc4
- llvmorg-13.0.0-rc3
- llvmorg-13.0.0-rc2
- llvmorg-13.0.0-rc1
- llvmorg-13-init
- llvmorg-12.0.1
- llvmorg-12.0.1-rc4
- llvmorg-12.0.1-rc3
- llvmorg-12.0.1-rc2
- llvmorg-12.0.1-rc1
- llvmorg-12.0.0
- llvmorg-12.0.0-rc5
- llvmorg-12.0.0-rc4
- llvmorg-12.0.0-rc3
- llvmorg-12.0.0-rc2
- llvmorg-12.0.0-rc1
- llvmorg-12-init
- llvmorg-11.1.0
- llvmorg-11.1.0-rc3
- llvmorg-11.1.0-rc2
- llvmorg-11.1.0-rc1
- llvmorg-11.0.1
- llvmorg-11.0.1-rc2
- llvmorg-11.0.1-rc1
- llvmorg-11.0.0
- llvmorg-11.0.0-rc6
- llvmorg-11.0.0-rc5
- llvmorg-11.0.0-rc4
- llvmorg-11.0.0-rc3
- llvmorg-11.0.0-rc2
- llvmorg-11.0.0-rc1
- llvmorg-11-init
- llvmorg-10.0.1
- llvmorg-10.0.1-rc4
- llvmorg-10.0.1-rc3
- llvmorg-10.0.1-rc2
- llvmorg-10.0.1-rc1
- llvmorg-10.0.0
- llvmorg-10.0.0-rc6
- llvmorg-10.0.0-rc5
- llvmorg-10.0.0-rc4
- llvmorg-10.0.0-rc3
- llvmorg-10.0.0-rc2
- llvmorg-10.0.0-rc1
- llvmorg-10-init
- llvmorg-9.0.1
- llvmorg-9.0.1-rc3
- llvmorg-9.0.1-rc2
- llvmorg-9.0.1-rc1
- llvmorg-9.0.0
- llvmorg-9.0.0-rc6
- llvmorg-9.0.0-rc5
- llvmorg-9.0.0-rc4
- llvmorg-9.0.0-rc3
- llvmorg-9.0.0-rc2
- llvmorg-9.0.0-rc1
- llvmorg-8.0.1
- llvmorg-8.0.1-rc4
- llvmorg-8.0.1-rc3
- llvmorg-8.0.1-rc2
- llvmorg-8.0.1-rc1
- llvmorg-8.0.0
- llvmorg-8.0.0-rc5
- llvmorg-8.0.0-rc4
- llvmorg-8.0.0-rc3
- llvmorg-8.0.0-rc2
- llvmorg-8.0.0-rc1
- llvmorg-7.1.0
- llvmorg-7.1.0-rc1
- llvmorg-7.0.1
- llvmorg-7.0.1-rc3
- llvmorg-7.0.1-rc2
- llvmorg-7.0.1-rc1
- llvmorg-7.0.0
- llvmorg-7.0.0-rc3
- llvmorg-7.0.0-rc2
- llvmorg-7.0.0-rc1
- llvmorg-6.0.1
- llvmorg-6.0.1-rc3
- llvmorg-6.0.1-rc2
- llvmorg-6.0.1-rc1
- llvmorg-6.0.0
- llvmorg-6.0.0-rc3
- llvmorg-6.0.0-rc2
- llvmorg-6.0.0-rc1
- llvmorg-5.0.2
- llvmorg-5.0.2-rc2
- llvmorg-5.0.2-rc1
- llvmorg-5.0.1
- llvmorg-5.0.1-rc3
- llvmorg-5.0.1-rc2
- llvmorg-5.0.1-rc1
- llvmorg-5.0.0
- llvmorg-5.0.0-rc5
- llvmorg-5.0.0-rc4
- llvmorg-5.0.0-rc3
- llvmorg-5.0.0-rc2
- llvmorg-5.0.0-rc1
- llvmorg-4.0.1
- llvmorg-4.0.1-rc3
- llvmorg-4.0.1-rc2
- llvmorg-4.0.1-rc1
- llvmorg-4.0.0
- llvmorg-4.0.0-rc4
- llvmorg-4.0.0-rc3
- llvmorg-4.0.0-rc2
- llvmorg-4.0.0-rc1
Showing
2 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// Tests the bindings generated for a CUDA offloading target for different | ||
// combinations of: | ||
// - Number of gpu architectures; | ||
// - Host/device-only compilation; | ||
// - User-requested final phase - binary or assembly. | ||
// It parallels cuda-phases.cu test, but verifies whether output file is temporary or not. | ||
|
||
// It's hard to check whether file name is temporary in a portable | ||
// way. Instead we check whether we've generated a permanent name on | ||
// device side, which appends '-device-cuda-<triple>' suffix. | ||
|
||
// REQUIRES: clang-driver | ||
// REQUIRES: powerpc-registered-target | ||
// REQUIRES: nvptx-registered-target | ||
|
||
// | ||
// Test single gpu architecture with complete compilation. | ||
// No intermediary device files should have "-device-cuda..." in the name. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --cuda-gpu-arch=sm_30 %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=BIN %s | ||
// BIN: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// BIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: | ||
// BIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN: # "nvptx64-nvidia-cuda" - "NVPTX::Linker",{{.*}} output: | ||
// BIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: | ||
// BIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out" | ||
|
||
// | ||
// Test single gpu architecture up to the assemble phase. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --cuda-gpu-arch=sm_30 %s -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=ASM %s | ||
// ASM: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.s" | ||
// ASM: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: "cuda-bindings.s" | ||
|
||
// | ||
// Test two gpu architectures with complete compilation. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=BIN2 %s | ||
// BIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Linker",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: | ||
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// BIN2: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out" | ||
|
||
// | ||
// Test two gpu architectures up to the assemble phase. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=ASM2 %s | ||
// ASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.s" | ||
// ASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_35.s" | ||
// ASM2: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: "cuda-bindings.s" | ||
|
||
// | ||
// Test one or more gpu architecture with complete compilation in host-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-host-only 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=HBIN %s | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=HBIN %s | ||
// HBIN: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: | ||
// HBIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// HBIN: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out" | ||
|
||
// | ||
// Test one or more gpu architecture up to the assemble phase in host-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-host-only -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=HASM %s | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=HASM %s | ||
// HASM: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: "cuda-bindings.s" | ||
|
||
// | ||
// Test single gpu architecture with complete compilation in device-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-device-only 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=DBIN %s | ||
// DBIN: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// DBIN-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// DBIN: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.o" | ||
|
||
// | ||
// Test single gpu architecture up to the assemble phase in device-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-device-only -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=DASM %s | ||
// DASM: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.s" | ||
|
||
// | ||
// Test two gpu architectures with complete compilation in device-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=DBIN2 %s | ||
// DBIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// DBIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// DBIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.o" | ||
// DBIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: | ||
// DBIN2-NOT: cuda-bindings-device-cuda-nvptx64 | ||
// DBIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_35.o" | ||
|
||
// | ||
// Test two gpu architectures up to the assemble phase in device-only | ||
// compilation mode. | ||
// | ||
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \ | ||
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=DASM2 %s | ||
// DASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_30.s" | ||
// DASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-device-cuda-nvptx64-nvidia-cuda-sm_35.s" |