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
98 lines
3.9 KiB
Plaintext
98 lines
3.9 KiB
Plaintext
// REQUIRES: x86-registered-target, amdgpu-registered-target, lld
|
|
|
|
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
|
|
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
|
|
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.1.o
|
|
|
|
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DLIB --no-offload-new-driver \
|
|
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
|
|
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.2.o
|
|
|
|
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN --no-offload-new-driver \
|
|
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
|
|
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.main.o
|
|
|
|
// RUN: llvm-nm %t.1.o | FileCheck -check-prefix=OBJ1 %s
|
|
// OBJ1: B __hip_cuid_[[ID:[0-9a-f]+]]
|
|
// OBJ1: U __hip_fatbin_[[ID]]
|
|
// OBJ1: U __hip_gpubin_handle_[[ID]]
|
|
|
|
// RUN: llvm-nm %t.2.o | FileCheck -check-prefix=OBJ2 %s
|
|
// OBJ2: B __hip_cuid_[[ID:[0-9a-f]+]]
|
|
// OBJ2: U __hip_fatbin_[[ID]]
|
|
// OBJ2: U __hip_gpubin_handle_[[ID]]
|
|
|
|
// Link %t.1.o and %t.2.o by -r and then link with %t.main.o
|
|
|
|
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
|
|
// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
|
|
// RUN: -r -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.lib.o \
|
|
// RUN: 2>&1 | FileCheck -check-prefix=LD-R %s
|
|
// LD-R: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID1:[0-9a-f]+]]
|
|
// LD-R: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID2:[0-9a-f]+]]
|
|
// LD-R: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID1]]
|
|
// LD-R: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID2]]
|
|
// LD-R: "{{.*[/\\]}}clang-offload-bundler" {{.*}}-unbundle
|
|
// LD-R: "{{.*[/\\]}}lld" -flavor gnu -m elf64_amdgpu
|
|
// LD-R: "{{.*[/\\]}}clang-offload-bundler"
|
|
// LD-R: "{{.*[/\\]}}clang{{.*}}" -target x86_64-unknown-linux-gnu
|
|
// LD-R: "{{.*[/\\]}}ld.lld" {{.*}} -r
|
|
|
|
// RUN: llvm-nm %t.lib.o | FileCheck -check-prefix=OBJ %s
|
|
// OBJ: B __hip_cuid_[[ID1:[0-9a-f]+]]
|
|
// OBJ: B __hip_cuid_[[ID2:[0-9a-f]+]]
|
|
// OBJ: R __hip_fatbin_[[ID1]]
|
|
// OBJ: R __hip_fatbin_[[ID2]]
|
|
// OBJ: D __hip_gpubin_handle_[[ID1]]
|
|
// OBJ: D __hip_gpubin_handle_[[ID2]]
|
|
|
|
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
|
|
// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
|
|
// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.lib.o -o %t.final.o \
|
|
// RUN: 2>&1 | FileCheck -check-prefix=LINK-O %s
|
|
// LINK-O-NOT: Found undefined HIP {{.*}}symbol
|
|
|
|
// Generate a static lib with %t.1.o and %t.2.o then link with %t.main.o
|
|
|
|
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
|
|
// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
|
|
// RUN: --emit-static-lib -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.a \
|
|
// RUN: 2>&1 | FileCheck -check-prefix=STATIC %s
|
|
// STATIC: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID1:[0-9a-f]+]]
|
|
// STATIC: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID2:[0-9a-f]+]]
|
|
// STATIC: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID1]]
|
|
// STATIC: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID2]]
|
|
// STATIC: "{{.*[/\\]}}clang-offload-bundler" {{.*}}-unbundle
|
|
// STATIC: "{{.*[/\\]}}lld" -flavor gnu -m elf64_amdgpu
|
|
// STATIC: "{{.*[/\\]}}clang-offload-bundler"
|
|
// STATIC: "{{.*[/\\]}}clang{{.*}}" -target x86_64-unknown-linux-gnu
|
|
// STATIC: "{{.*[/\\]}}llvm-ar"
|
|
|
|
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
|
|
// RUN: --hip-link -no-hip-rt -fgpu-rdc --offload-arch=gfx906 \
|
|
// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.a -o %t.final.o \
|
|
// RUN: 2>&1 | FileCheck -check-prefix=LINK-A %s
|
|
// LINK-A-NOT: Found undefined HIP {{.*}}symbol
|
|
|
|
#include "hip.h"
|
|
|
|
#ifdef LIB
|
|
__device__ int x;
|
|
__device__ void libfun() {
|
|
x = 1;
|
|
}
|
|
#elif !defined(MAIN)
|
|
__device__ void libfun();
|
|
__global__ void kern() {
|
|
libfun();
|
|
}
|
|
void run() {
|
|
kern<<<1,1>>>();
|
|
}
|
|
#else
|
|
extern void run();
|
|
int main() {
|
|
run();
|
|
}
|
|
#endif
|