| 1 |
// Tests that "sm_XX" gets correctly converted to "compute_YY" when we invoke |
| 2 |
// fatbinary. |
| 3 |
|
| 4 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 5 |
// RUN: | FileCheck -check-prefixes=CUDA,SM20 %s |
| 6 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_21 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 7 |
// RUN: | FileCheck -check-prefixes=CUDA,SM21 %s |
| 8 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_30 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 9 |
// RUN: | FileCheck -check-prefixes=CUDA,SM30 %s |
| 10 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_32 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 11 |
// RUN: | FileCheck -check-prefixes=CUDA,SM32 %s |
| 12 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_35 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 13 |
// RUN: | FileCheck -check-prefixes=CUDA,SM35 %s |
| 14 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_37 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 15 |
// RUN: | FileCheck -check-prefixes=CUDA,SM37 %s |
| 16 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_50 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 17 |
// RUN: | FileCheck -check-prefixes=CUDA,SM50 %s |
| 18 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 19 |
// RUN: | FileCheck -check-prefixes=CUDA,SM52 %s |
| 20 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_53 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 21 |
// RUN: | FileCheck -check-prefixes=CUDA,SM53 %s |
| 22 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 23 |
// RUN: | FileCheck -check-prefixes=CUDA,SM60 %s |
| 24 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_61 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 25 |
// RUN: | FileCheck -check-prefixes=CUDA,SM61 %s |
| 26 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_62 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 27 |
// RUN: | FileCheck -check-prefixes=CUDA,SM62 %s |
| 28 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \ |
| 29 |
// RUN: | FileCheck -check-prefixes=CUDA,SM70 %s |
| 30 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 -nogpuinc -nogpulib %s 2>&1 \ |
| 31 |
// RUN: | FileCheck -check-prefixes=HIP,GFX600 %s |
| 32 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 -nogpuinc -nogpulib %s 2>&1 \ |
| 33 |
// RUN: | FileCheck -check-prefixes=HIP,GFX601 %s |
| 34 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 -nogpuinc -nogpulib %s 2>&1 \ |
| 35 |
// RUN: | FileCheck -check-prefixes=HIP,GFX602 %s |
| 36 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 -nogpuinc -nogpulib %s 2>&1 \ |
| 37 |
// RUN: | FileCheck -check-prefixes=HIP,GFX700 %s |
| 38 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 -nogpuinc -nogpulib %s 2>&1 \ |
| 39 |
// RUN: | FileCheck -check-prefixes=HIP,GFX701 %s |
| 40 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 -nogpuinc -nogpulib %s 2>&1 \ |
| 41 |
// RUN: | FileCheck -check-prefixes=HIP,GFX702 %s |
| 42 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 -nogpuinc -nogpulib %s 2>&1 \ |
| 43 |
// RUN: | FileCheck -check-prefixes=HIP,GFX703 %s |
| 44 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 -nogpuinc -nogpulib %s 2>&1 \ |
| 45 |
// RUN: | FileCheck -check-prefixes=HIP,GFX704 %s |
| 46 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 -nogpuinc -nogpulib %s 2>&1 \ |
| 47 |
// RUN: | FileCheck -check-prefixes=HIP,GFX705 %s |
| 48 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 -nogpuinc -nogpulib %s 2>&1 \ |
| 49 |
// RUN: | FileCheck -check-prefixes=HIP,GFX801 %s |
| 50 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 -nogpuinc -nogpulib %s 2>&1 \ |
| 51 |
// RUN: | FileCheck -check-prefixes=HIP,GFX802 %s |
| 52 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 -nogpuinc -nogpulib %s 2>&1 \ |
| 53 |
// RUN: | FileCheck -check-prefixes=HIP,GFX803 %s |
| 54 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 -nogpuinc -nogpulib %s 2>&1 \ |
| 55 |
// RUN: | FileCheck -check-prefixes=HIP,GFX805 %s |
| 56 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 -nogpuinc -nogpulib %s 2>&1 \ |
| 57 |
// RUN: | FileCheck -check-prefixes=HIP,GFX810 %s |
| 58 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 -nogpuinc -nogpulib %s 2>&1 \ |
| 59 |
// RUN: | FileCheck -check-prefixes=HIP,GFX900 %s |
| 60 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 -nogpuinc -nogpulib %s 2>&1 \ |
| 61 |
// RUN: | FileCheck -check-prefixes=HIP,GFX902 %s |
| 62 |
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=amdgcnspirv -nogpuinc -nogpulib %s 2>&1 \ |
| 63 |
// RUN: | FileCheck -check-prefixes=HIP,SPIRV %s |
| 64 |
|
| 65 |
// CUDA: ptxas |
| 66 |
// CUDA-SAME: -m64 |
| 67 |
// CUDA: fatbinary |
| 68 |
|
| 69 |
// HIP: clang-offload-bundler |
| 70 |
|
| 71 |
// SM20:--image3=kind=elf,sm=20{{.*}} |
| 72 |
// SM21:--image3=kind=elf,sm=21{{.*}} |
| 73 |
// SM30:--image3=kind=elf,sm=30{{.*}} |
| 74 |
// SM32:--image3=kind=elf,sm=32{{.*}} |
| 75 |
// SM35:--image3=kind=elf,sm=35{{.*}} |
| 76 |
// SM37:--image3=kind=elf,sm=37{{.*}} |
| 77 |
// SM50:--image3=kind=elf,sm=50{{.*}} |
| 78 |
// SM52:--image3=kind=elf,sm=52{{.*}} |
| 79 |
// SM53:--image3=kind=elf,sm=53{{.*}} |
| 80 |
// SM60:--image3=kind=elf,sm=60{{.*}} |
| 81 |
// SM61:--image3=kind=elf,sm=61{{.*}} |
| 82 |
// SM62:--image3=kind=elf,sm=62{{.*}} |
| 83 |
// SM70:--image3=kind=elf,sm=70{{.*}} |
| 84 |
// GFX600:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx600 |
| 85 |
// GFX601:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx601 |
| 86 |
// GFX602:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx602 |
| 87 |
// GFX700:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx700 |
| 88 |
// GFX701:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx701 |
| 89 |
// GFX702:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx702 |
| 90 |
// GFX703:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx703 |
| 91 |
// GFX704:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx704 |
| 92 |
// GFX705:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx705 |
| 93 |
// GFX801:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx801 |
| 94 |
// GFX802:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx802 |
| 95 |
// GFX803:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx803 |
| 96 |
// GFX805:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx805 |
| 97 |
// GFX810:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx810 |
| 98 |
// GFX900:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx900 |
| 99 |
// GFX902:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx902 |
| 100 |
// SPIRV:-targets=host-x86_64-unknown-linux-gnu,hip-spirv64-amd-amdhsa--amdgcnspirv |