Files
TheRock/compiler/amd-llvm/clang/test/Driver/cuda-arch-list.cu
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

71 lines
3.0 KiB
Plaintext

// Checks that __CUDA_ARCH_LIST__ is defined correctly for both host and device
// subcompilations.
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --offload-arch=sm_60 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE60,HOST %s
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --offload-arch=sm_60 --offload-arch=sm_70 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE60-60-70,DEVICE70-60-70,HOST-60-70 %s
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --offload-arch=sm_70 --offload-arch=sm_60 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE60-60-70,DEVICE70-60-70,HOST-60-70 %s
// Verify that it works with no explicit arch (defaults to sm_52)
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE52,HOST52 %s
// Verify that --no-offload-arch negates preceding --offload-arch
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --offload-arch=sm_60 --offload-arch=sm_70 --no-offload-arch=sm_60 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE70-ONLY,HOST70-ONLY %s
// Verify that user-specified -D__CUDA_ARCH_LIST__ overrides the driver-generated one
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib \
// RUN: --offload-arch=sm_60 -D__CUDA_ARCH_LIST__=999 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=DEVICE-OVERRIDE,HOST-OVERRIDE %s
// DEVICE60: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE60-SAME: "-target-cpu" "sm_60"
// DEVICE60-SAME: "-D__CUDA_ARCH_LIST__=600"
// HOST: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// HOST-SAME: "-D__CUDA_ARCH_LIST__=600"
// DEVICE60-60-70: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE60-60-70-SAME: "-target-cpu" "sm_60"
// DEVICE60-60-70-SAME: "-D__CUDA_ARCH_LIST__=600,700"
// DEVICE70-60-70: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE70-60-70-SAME: "-target-cpu" "sm_70"
// DEVICE70-60-70-SAME: "-D__CUDA_ARCH_LIST__=600,700"
// HOST-60-70: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// HOST-60-70-SAME: "-D__CUDA_ARCH_LIST__=600,700"
// DEVICE52: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE52-SAME: "-target-cpu" "sm_52"
// DEVICE52-SAME: "-D__CUDA_ARCH_LIST__=520"
// HOST52: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// HOST52-SAME: "-D__CUDA_ARCH_LIST__=520"
// DEVICE70-ONLY: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE70-ONLY-SAME: "-target-cpu" "sm_70"
// DEVICE70-ONLY-SAME: "-D__CUDA_ARCH_LIST__=700"
// HOST70-ONLY: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// HOST70-ONLY-SAME: "-D__CUDA_ARCH_LIST__=700"
// DEVICE-OVERRIDE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// DEVICE-OVERRIDE-SAME: "-target-cpu" "sm_60"
// DEVICE-OVERRIDE-SAME: "-D__CUDA_ARCH_LIST__=600"
// DEVICE-OVERRIDE-SAME: "-D" "__CUDA_ARCH_LIST__=999"
// HOST-OVERRIDE: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// HOST-OVERRIDE-SAME: "-D__CUDA_ARCH_LIST__=600"
// HOST-OVERRIDE-SAME: "-D" "__CUDA_ARCH_LIST__=999"