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
128 lines
5.4 KiB
C
128 lines
5.4 KiB
C
// Tests the driver when targeting the NVPTX architecture directly without a
|
|
// host toolchain to perform CUDA mappings.
|
|
|
|
//
|
|
// Test the generated phases when targeting NVPTX.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -ccc-print-phases %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=PHASES %s
|
|
|
|
// PHASES: 0: input, "[[INPUT:.+]]", c
|
|
// PHASES-NEXT: 1: preprocessor, {0}, cpp-output
|
|
// PHASES-NEXT: 2: compiler, {1}, ir
|
|
// PHASES-NEXT: 3: backend, {2}, assembler
|
|
// PHASES-NEXT: 4: assembler, {3}, object
|
|
// PHASES-NEXT: 5: linker, {4}, image
|
|
|
|
//
|
|
// Test the generated bindings when targeting NVPTX.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -ccc-print-bindings %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=BINDINGS %s
|
|
|
|
// BINDINGS: "nvptx64-nvidia-cuda" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[PTX:.+]].s"
|
|
// BINDINGS-NEXT: "nvptx64-nvidia-cuda" - "NVPTX::Assembler", inputs: ["[[PTX]].s"], output: "[[CUBIN:.+]].o"
|
|
// BINDINGS-NEXT: "nvptx64-nvidia-cuda" - "NVPTX::Linker", inputs: ["[[CUBIN]].o"], output: "a.out"
|
|
|
|
//
|
|
// Test the generated arguments to the CUDA binary utils when targeting NVPTX.
|
|
// Ensure that the '.o' files are converted to '.cubin' if produced internally.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_61 -### %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=ARGS %s
|
|
|
|
// ARGS: -cc1" "-triple" "nvptx64-nvidia-cuda" "-S" {{.*}} "-target-cpu" "sm_61" {{.*}} "-o" "[[PTX:.+]].s"
|
|
// ARGS-NEXT: ptxas{{.*}}"-m64" "-O0" "--gpu-name" "sm_61" "--output-file" "[[CUBIN:.+]].o" "[[PTX]].s" "-c"
|
|
// ARGS-NEXT: clang-nvlink-wrapper{{.*}}"-o" "a.out" "-arch" "sm_61"{{.*}}"[[CUBIN]].o"
|
|
|
|
//
|
|
// Test the generated arguments to the CUDA binary utils when targeting NVPTX.
|
|
// Ensure that we emit '.o' files if compiled with '-c'
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_61 -c -### %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=OBJECT %s
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -save-temps -march=sm_61 -c -### %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=OBJECT %s
|
|
|
|
// OBJECT: -cc1" "-triple" "nvptx64-nvidia-cuda" "-S" {{.*}} "-target-cpu" "sm_61" {{.*}} "-o" "[[PTX:.+]].s"
|
|
// OBJECT-NEXT: ptxas{{.*}}"-m64" "-O0" "--gpu-name" "sm_61" "--output-file" "[[OBJ:.+]].o" "[[PTX]].s" "-c"
|
|
|
|
//
|
|
// Test the generated arguments to the CUDA binary utils when targeting NVPTX.
|
|
// Ensure that we copy input '.o' files to '.cubin' files when linking.
|
|
//
|
|
// RUN: touch %t.o
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_61 -### %t.o 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=LINK %s
|
|
|
|
// LINK: clang-nvlink-wrapper{{.*}}"-o" "a.out" "-arch" "sm_61"{{.*}}[[CUBIN:.+]].o
|
|
|
|
//
|
|
// Test passing arguments directly to nvlink.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -Wl,-v -Wl,a,b -march=sm_52 -### %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=LINKER-ARGS %s
|
|
|
|
// LINKER-ARGS: clang-nvlink-wrapper{{.*}}"-v"{{.*}}"a" "b"
|
|
|
|
// Tests for handling a missing architecture.
|
|
//
|
|
// RUN: not %clang -target nvptx64-nvidia-cuda %s -### 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=MISSING %s
|
|
// RUN: not %clang -target nvptx64-nvidia-cuda -march=generic %s -### 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=MISSING %s
|
|
|
|
// MISSING: error: must pass in an explicit nvptx64 gpu architecture to 'ptxas'
|
|
// MISSING: error: must pass in an explicit nvptx64 gpu architecture to 'nvlink'
|
|
|
|
// Do not error when performing LTO.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -flto %s -### 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=MISSING-LTO %s
|
|
|
|
// MISSING-LTO-NOT: error: must pass in an explicit nvptx64 gpu architecture to 'nvlink'
|
|
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -flto -c %s -### 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=GENERIC %s
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_52 -march=generic -flto -c %s -### 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=GENERIC %s
|
|
|
|
// GENERIC-NOT: -cc1" "-triple" "nvptx64-nvidia-cuda" {{.*}} "-target-cpu"
|
|
|
|
//
|
|
// Test forwarding the necessary +ptx feature.
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda --cuda-feature=+ptx63 -march=sm_52 -### %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefix=FEATURE %s
|
|
|
|
// FEATURE: clang-nvlink-wrapper{{.*}}"--plugin-opt=-mattr=+ptx63"
|
|
|
|
//
|
|
// Test including the libc startup files and libc
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_61 -stdlib -startfiles \
|
|
// RUN: -nogpulib -nogpuinc -### %s 2>&1 | FileCheck -check-prefix=STARTUP %s
|
|
|
|
// STARTUP: clang-nvlink-wrapper{{.*}}"-lc" "-lm" "{{.*}}crt1.o"
|
|
|
|
//
|
|
// Test cuda path handling
|
|
//
|
|
// RUN: %clang -target nvptx64-nvidia-cuda -march=sm_52 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
|
|
// RUN: -nogpulib -nogpuinc -### %s 2>&1 | FileCheck -check-prefix=PATH %s
|
|
|
|
// PATH: clang-nvlink-wrapper{{.*}}"--cuda-path={{.*}}/Inputs/CUDA/usr/local/cuda"
|
|
|
|
// RUN: %clang -### --target=nvptx64-nvidia-cuda -march=sm_89 -nogpulib \
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
|
// RUN: -fprofile-generate %s 2>&1 | FileCheck -check-prefixes=PROFILE %s
|
|
// PROFILE: clang-nvlink-wrapper
|
|
// PROFILE-SAME: "[[RESOURCE_DIR:.+]]{{/|\\\\}}lib{{/|\\\\}}nvptx64-nvidia-cuda{{/|\\\\}}libclang_rt.profile.a"
|
|
|
|
// RUN: %clang -### --target=nvptx64-nvidia-cuda -march=sm_89 -nogpulib \
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
|
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s 2>&1 \
|
|
// RUN: | FileCheck -check-prefixes=UBSAN %s
|
|
// UBSAN: clang-nvlink-wrapper
|
|
// UBSAN-SAME: "[[RESOURCE_DIR:.+]]{{/|\\\\}}lib{{/|\\\\}}nvptx64-nvidia-cuda{{/|\\\\}}libclang_rt.ubsan_minimal.a"
|