[all-commits] [llvm/llvm-project] e5eb36: [CUDA][HIP] Fix offloading kind for linking C++ pr...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Fri Mar 4 12:57:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e5eb365069cce7bb642421d53a1d3964f8d5bdb7
      https://github.com/llvm/llvm-project/commit/e5eb365069cce7bb642421d53a1d3964f8d5bdb7
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2022-03-04 (Fri, 04 Mar 2022)

  Changed paths:
    M clang/include/clang/Driver/Action.h
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/hip-phases.hip

  Log Message:
  -----------
  [CUDA][HIP] Fix offloading kind for linking C++ programs

When both CUDA or HIP programs and C++ programs are passed
to clang driver without -c, C++ programs are treated as CUDA
or HIP program, which is incorrect.

This is because action builder sets the offloading kind of input
job actions to the linking action to be the union of offloading
kind of the input job actions, i.e. if there is one HIP or CUDA
input to the linker, then all the input to the linker is marked
as HIP or CUDA.

To fix this issue, the offload action builder tracks the originating
input argument of each host action, which allows it to determine
the active offload kind of each host action. Then the offload
kind of each input action to the linker can be determined
individually.

Reviewed by: Artem Belevich

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




More information about the All-commits mailing list