|
| 1 | +// Check that we correctly determine that the final link command links |
| 2 | +// devicelibs together, as far as the driver is concerned. This results in the |
| 3 | +// -only-needed flag. |
| 4 | +// |
| 5 | +// Note we check the names of the various device libraries because that's the |
| 6 | +// logic the driver uses. |
| 7 | + |
| 8 | +// Older CUDA versions had versioned libdevice files. We don't support CUDA |
| 9 | +// this old in SYCL, but we still test the driver's ability to pick out the |
| 10 | +// correctly versioned libdevice. We use Inputs/CUDA_80 which has a full set of |
| 11 | +// libdevice files. |
| 12 | +// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ |
| 13 | +// RUN: -Xsycl-target-backend --cuda-gpu-arch=sm_30 \ |
| 14 | +// RUN: --sysroot=%S/Inputs/SYCL --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 15 | +// RUN: | FileCheck %s --check-prefixes=CHECK,LIBDEVICE30 |
| 16 | +// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ |
| 17 | +// RUN: -Xsycl-target-backend --cuda-gpu-arch=sm_35 \ |
| 18 | +// RUN: --sysroot=%S/Inputs/SYCL --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 19 | +// RUN: | FileCheck %s --check-prefixes=CHECK,LIBDEVICE35 |
| 20 | +// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ |
| 21 | +// RUN: -Xsycl-target-backend --cuda-gpu-arch=sm_50 \ |
| 22 | +// RUN: --sysroot=%S/Inputs/SYCL --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 23 | +// RUN: | FileCheck %s --check-prefixes=CHECK,LIBDEVICE50 |
| 24 | + |
| 25 | +// CUDA-9+ uses the same libdevice for all GPU variants |
| 26 | +// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ |
| 27 | +// RUN: -Xsycl-target-backend --cuda-gpu-arch=sm_35 \ |
| 28 | +// RUN: --sysroot=%S/Inputs/SYCL --cuda-path=%S/Inputs/CUDA_90/usr/local/cuda %s 2>&1 \ |
| 29 | +// RUN: | FileCheck %s --check-prefixes=CHECK,LIBDEVICE10 |
| 30 | + |
| 31 | +// First link command: ignored |
| 32 | +// CHECK: llvm-link |
| 33 | + |
| 34 | +// CHECK: llvm-link |
| 35 | +// CHECK-SAME: -only-needed |
| 36 | +// CHECK-SAME: devicelib--cuda.bc |
| 37 | +// CHECK-SAME: libspirv-nvptx64-nvidia-cuda.bc |
| 38 | +// LIBDEVICE10-SAME: libdevice.10.bc |
| 39 | +// LIBDEVICE30-SAME: libdevice.compute_30.10.bc |
| 40 | +// LIBDEVICE35-SAME: libdevice.compute_35.10.bc |
| 41 | +// LIBDEVICE50-SAME: libdevice.compute_50.10.bc |
0 commit comments