[all-commits] [llvm/llvm-project] 98c212: [CUDA][HIP] Add -fuse-cuid

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Mon Feb 8 19:28:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98c21289f1d239f39fa549ae01b17efffce6a7c0
      https://github.com/llvm/llvm-project/commit/98c21289f1d239f39fa549ae01b17efffce6a7c0
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M clang/include/clang/Basic/LangOptions.h
    M clang/include/clang/Driver/Action.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Action.cpp
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/Driver/hip-cuid-hash.hip
    A clang/test/Driver/hip-cuid.hip

  Log Message:
  -----------
  [CUDA][HIP] Add -fuse-cuid

This patch added a distinct CUID for each input file, which is represented by InputAction.
clang initially creates an InputAction for each input file for the host compilation. In CUDA/HIP action
builder, each InputAction is given a CUID and cloned for each GPU arch, and the CUID is also cloned. In this way,
we guarantee the corresponding device and host compilation for the same file shared the
same CUID. On the other hand, different compilation units have different CUID.

-fuse-cuid=random|hash|none is added to control the method to generate CUID. The default
is hash. -cuid=X is also added to specify CUID explicitly, which overrides -fuse-cuid.

Reviewed by: Artem Belevich

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




More information about the All-commits mailing list