[all-commits] [llvm/llvm-project] e88d53: [HIP] Generate offloading entries for HIP with the...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Jul 11 12:49:41 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e88d53d25f3b48204615195615da35e575081903
      https://github.com/llvm/llvm-project/commit/e88d53d25f3b48204615195615da35e575081903
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-07-11 (Mon, 11 Jul 2022)

  Changed paths:
    M clang/lib/CodeGen/CGCUDANV.cpp
    M clang/test/CodeGenCUDA/offloading-entries.cu

  Log Message:
  -----------
  [HIP] Generate offloading entries for HIP with the new driver.

This patch adds the small change required to output offloading entried
for HIP instead of CUDA. These should be placed in different sections so
because they need to be distinct to the offloading toolchain, otherwise
we'd have HIP trying to register CUDA kernels or vice-versa. This patch will
precede support for HIP in the linker wrapper.

Reviewed By: yaxunl, tra

Differential Revision: https://reviews.llvm.org/D128850


  Commit: ce091eb3b91fc683513f47a565d68cf2799804c9
      https://github.com/llvm/llvm-project/commit/ce091eb3b91fc683513f47a565d68cf2799804c9
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-07-11 (Mon, 11 Jul 2022)

  Changed paths:
    M clang/test/Driver/linker-wrapper-image.c
    M clang/test/Driver/linker-wrapper.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M clang/tools/clang-linker-wrapper/OffloadWrapper.cpp
    M clang/tools/clang-linker-wrapper/OffloadWrapper.h

  Log Message:
  -----------
  [HIP] Add support for handling HIP in the linker wrapper

This patch adds the necessary changes required to bundle and wrap HIP
files. The bundling is done using `clang-offload-bundler` currently to
mimic `fatbinary` and the wrapping is done using very similar runtime
calls to CUDA. This still does not support managed / surface / texture
variables, that would require some additional information in the entry.

One difference in the codegeneration with AMD is that I don't check if
the handle is null before destructing it, I'm not sure if that's
required.

With this we should be able to support HIP with the new driver.

Depends on D128850

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D128914


Compare: https://github.com/llvm/llvm-project/compare/ec2b040e186f...ce091eb3b91f


More information about the All-commits mailing list