2016-01-12 07:27:13 +08:00
|
|
|
// Checks errors generated by passing a bad value for --cuda-gpu-arch.
|
|
|
|
// REQUIRES: clang-driver
|
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
// REQUIRES: nvptx-registered-target
|
2018-05-12 03:14:34 +08:00
|
|
|
// REQUIRES: amdgpu-registered-target
|
2016-01-12 07:27:13 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=compute_20 -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix BAD %s
|
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm20 -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix BAD %s
|
2016-01-13 06:23:04 +08:00
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_19 -c %s 2>&1 \
|
2016-01-12 07:27:13 +08:00
|
|
|
// RUN: | FileCheck -check-prefix BAD %s
|
|
|
|
|
|
|
|
// BAD: error: Unsupported CUDA gpu architecture
|
|
|
|
|
2017-10-26 05:32:06 +08:00
|
|
|
// RUN: %clang -### -v --target=x86_64-linux-gnu --cuda-gpu-arch=sm_21 \
|
|
|
|
// RUN: --cuda-path=%S/Inputs/CUDA_90/usr/local/cuda %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix BAD_CUDA9 %s
|
|
|
|
|
|
|
|
// BAD_CUDA9: GPU arch sm_21 is supported by CUDA versions between 7.0 and 8.0
|
|
|
|
|
2016-01-12 07:27:13 +08:00
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix OK %s
|
2016-01-13 06:23:04 +08:00
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
|
2016-01-12 07:27:13 +08:00
|
|
|
// RUN: | FileCheck -check-prefix OK %s
|
|
|
|
// RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix OK %s
|
|
|
|
|
2018-05-12 03:14:34 +08:00
|
|
|
// We don't allow using NVPTX/AMDGCN for host compilation.
|
2016-08-03 06:37:47 +08:00
|
|
|
// RUN: %clang -### --cuda-host-only -target nvptx-nvidia-cuda -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix HOST_NVPTX %s
|
2018-05-12 03:14:34 +08:00
|
|
|
// RUN: %clang -### --cuda-host-only -target amdgcn-amd-amdhsa -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix HOST_AMDGCN %s
|
2016-08-03 06:37:47 +08:00
|
|
|
|
2016-01-12 07:27:13 +08:00
|
|
|
// OK-NOT: error: Unsupported CUDA gpu architecture
|
2018-05-12 03:14:34 +08:00
|
|
|
// HOST_NVPTX: error: unsupported architecture 'nvptx' for host compilation.
|
|
|
|
// HOST_AMDGCN: error: unsupported architecture 'amdgcn' for host compilation.
|