[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 20 12:17:23 PDT 2022

jhuber6 added inline comments.

Comment at: clang/test/Driver/linker-wrapper-image.c:32
+// RUN: %clang -cc1 %s -emit-obj -o %t.o \
+// RUN:   -fembed-offload-object=%S/Inputs/dummy-elf.o,cuda,nvptx64-nvida-cuda,sm_70
+// RUN: clang-linker-wrapper --print-wrapped-module --dry-run -linker-path /usr/bin/ld \
yaxunl wrote:
> what happens if there are multiple binaries for different GPUs? will the linker-wrapper generates one fatbinary containing both elfs and embed the fatbinary as one image?
Yes, I'll add it to the other test.

Comment at: clang/test/Driver/linker-wrapper.c:46
+// RUN:   -fembed-offload-object=%S/Inputs/dummy-elf.o,cuda,nvptx64-nvida-cuda,sm_70 \
+// RUN:   -fembed-offload-object=%S/Inputs/dummy-elf.o,cuda,nvptx64-nvida-cuda,sm_70
+// RUN: clang-linker-wrapper --dry-run -linker-path /usr/bin/ld -- %t.o -o a.out \
yaxunl wrote:
> This option is the same as the preceding option. Is this intentional? Can we have a test that embeds multiple binaries for different GPUs?
It's intentional to show that we can pull out two objects embedded in a single file (Like if someone did `ld -r` or something). I'll add binaries for different GPUs to show that works.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list