2016-07-08 02:17:52 +08:00
|
|
|
// REQUIRES: clang-driver
|
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
// REQUIRES: nvptx-registered-target
|
|
|
|
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
|
|
|
|
|
|
|
// The installation at Inputs/CUDA is CUDA 7.0, which doesn't support sm_60.
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=ERR_SM60
|
|
|
|
|
|
|
|
// This should only complain about sm_60, not sm_35.
|
2017-01-07 02:16:03 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-gpu-arch=sm_35 \
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=ERR_SM60 --check-prefix=OK_SM35
|
|
|
|
|
|
|
|
// We should get two errors here, one for sm_60 and one for sm_61.
|
2017-01-07 02:16:03 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-gpu-arch=sm_61 \
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=ERR_SM60 --check-prefix=ERR_SM61
|
|
|
|
|
|
|
|
// We should still get an error if we pass -nocudainc, because this compilation
|
|
|
|
// would invoke ptxas, and we do a version check on that, too.
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 -nocudainc --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=ERR_SM60
|
|
|
|
|
|
|
|
// If with -nocudainc and -E, we don't touch the CUDA install, so we
|
|
|
|
// shouldn't get an error.
|
2017-01-07 02:16:03 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### -E --cuda-device-only --cuda-gpu-arch=sm_60 -nocudainc \
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
|
|
|
|
2016-07-09 01:59:24 +08:00
|
|
|
// --no-cuda-version-check should suppress all of these errors.
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 \
|
2016-07-08 07:22:39 +08:00
|
|
|
// RUN: --no-cuda-version-check %s | \
|
2016-07-08 02:17:52 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
|
|
|
|
2016-07-28 06:46:31 +08:00
|
|
|
// We need to make sure the version check is done only for the device toolchain,
|
|
|
|
// therefore we should not get an error in host-only mode. We use the -S here
|
|
|
|
// to avoid the error being produced in case by the assembler tool, which does
|
|
|
|
// the same check.
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-host-only --cuda-path=%S/Inputs/CUDA/usr/local/cuda -S 2>&1 %s | \
|
2016-07-28 06:46:31 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=OK
|
2018-01-31 16:26:51 +08:00
|
|
|
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-device-only --cuda-path=%S/Inputs/CUDA/usr/local/cuda -S 2>&1 %s | \
|
2016-07-28 06:46:31 +08:00
|
|
|
// RUN: FileCheck %s --check-prefix=ERR_SM60
|
|
|
|
|
2016-07-08 02:17:52 +08:00
|
|
|
// OK-NOT: error: GPU arch
|
|
|
|
|
|
|
|
// OK_SM35-NOT: error: GPU arch sm_35
|
|
|
|
|
|
|
|
// We should only get one error per architecture.
|
|
|
|
// ERR_SM60: error: GPU arch sm_60 {{.*}}
|
|
|
|
// ERR_SM60-NOT: error: GPU arch sm_60
|
|
|
|
|
|
|
|
// ERR_SM61: error: GPU arch sm_61 {{.*}}
|
|
|
|
// ERR_SM61-NOT: error: GPU arch sm_61
|