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
57 lines
2.7 KiB
Plaintext
57 lines
2.7 KiB
Plaintext
// REQUIRES: comgr-has-amdgpu-target
|
|
// COM: End-to-end coverage of the HotSwap rewrite pipeline on a real
|
|
// COM: clang-produced gfx1250 code object. Drives the full
|
|
// COM: compile -> hotswap-rewrite -> verify chain using the in-tree
|
|
// COM: clang + llvm-readelf + llvm-objdump substitutions.
|
|
// COM:
|
|
// COM: This kernel intentionally does not contain instructions matched by
|
|
// COM: the current hotswap patch set. The test is still useful as a real
|
|
// COM: code-object smoke test: it asserts that (1) rewrite returns SUCCESS,
|
|
// COM: (2) the output remains a valid gfx1250 ELF with preserved ISA
|
|
// COM: identification, and (3) .text is still present and disassemblable.
|
|
// COM: Patch-specific LIT tests cover opcode changes and trampolines.
|
|
|
|
// COM: Compile a tiny kernel targeting gfx1250 to a raw code object.
|
|
// RUN: %clang --offload-arch=gfx1250 --offload-device-only \
|
|
// RUN: --no-gpu-bundle-output -nogpulib -nogpuinc \
|
|
// RUN: %s -o %t.input.elf
|
|
|
|
// COM: Sanity: input is a gfx1250 ELF (attested in both the e_flags
|
|
// COM: field of the ELF header and the AMDHSA metadata note).
|
|
// RUN: %llvm-readelf -h %t.input.elf | %FileCheck --check-prefix=INPUT-FLAGS %s
|
|
// INPUT-FLAGS: Flags:{{.*}}gfx1250
|
|
// RUN: %llvm-readelf --notes %t.input.elf | %FileCheck --check-prefix=INPUT-META %s
|
|
// INPUT-META: amdhsa.target: amdgcn-amd-amdhsa{{--|-unknown-}}gfx1250
|
|
|
|
// COM: Run hotswap-rewrite; save the output so we can inspect it.
|
|
// RUN: hotswap-rewrite %t.input.elf \
|
|
// RUN: amdgcn-amd-amdhsa--gfx1250 amdgcn-amd-amdhsa--gfx1250 \
|
|
// RUN: --output %t.output.elf \
|
|
// RUN: | %FileCheck --check-prefix=STATUS %s
|
|
// STATUS: RESULT: SUCCESS
|
|
|
|
// COM: Output ELF is valid and still identifies as gfx1250; this smoke
|
|
// COM: kernel has no patch-triggering instructions, so the rewrite should
|
|
// COM: preserve the target identification.
|
|
// RUN: %llvm-readelf -h %t.output.elf | %FileCheck --check-prefix=OUTPUT-FLAGS %s
|
|
// OUTPUT-FLAGS: Flags:{{.*}}gfx1250
|
|
// RUN: %llvm-readelf --notes %t.output.elf | %FileCheck --check-prefix=OUTPUT-META %s
|
|
// OUTPUT-META: amdhsa.target: amdgcn-amd-amdhsa{{--|-unknown-}}gfx1250
|
|
|
|
// COM: .text section is still present and marked executable.
|
|
// RUN: %llvm-readelf --section-headers %t.output.elf \
|
|
// RUN: | %FileCheck --check-prefix=SECTIONS %s
|
|
// SECTIONS: .text{{.*}}PROGBITS
|
|
|
|
// COM: Disassembly is legible as AMDGPU code. The function symbol name
|
|
// COM: depends on C++ mangling; we do not hard-code it here.
|
|
// RUN: %llvm-objdump -d %t.output.elf | %FileCheck --check-prefix=DISASM %s
|
|
// DISASM: file format elf64-amdgpu
|
|
// DISASM: Disassembly of section .text:
|
|
// DISASM: s_endpgm
|
|
|
|
__attribute__((global))
|
|
void add(float *A, float *B, float *C) {
|
|
*C = *A + *B;
|
|
}
|