Flakebi 99ec64c34c
Export kernel descriptor for amdgpu kernels
The host runtime (HIP or HSA) expects a kernel descriptor object for
each kernel in the ELF file. The amdgpu LLVM backend generates the
object. It is created as a symbol with the name of the kernel plus a
`.kd` suffix.

Add it to the exported symbols in the linker script, so that it can be
found.
2025-02-12 22:44:39 +01:00

21 lines
694 B
Rust

// On the amdhsa OS, the host runtime (HIP or HSA) expects a kernel descriptor object for each
// kernel in the ELF file. The amdgpu LLVM backend generates the object. It is created as a symbol
// with the name of the kernel plus a .kd suffix.
// Check that the produced object has the .kd symbol exported.
//@ needs-llvm-components: amdgpu
//@ needs-rust-lld
use run_make_support::{llvm_readobj, rustc};
fn main() {
rustc()
.crate_name("foo")
.target("amdgcn-amd-amdhsa")
.arg("-Ctarget-cpu=gfx900")
.crate_type("cdylib")
.input("foo.rs")
.run();
llvm_readobj().input("foo.elf").symbols().run().assert_stdout_contains("kernel.kd");
}