[PATCH] D95007: [CUDA][HIP] Add -fuse-cuid

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 15:20:37 PST 2021


yaxunl created this revision.
yaxunl added reviewers: tra, rjmccall.
Herald added subscribers: dexonsmith, dang.
yaxunl requested review of this revision.

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.

This patch is separated from https://reviews.llvm.org/D85223


https://reviews.llvm.org/D95007

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Basic/LangOptions.h
  clang/include/clang/Driver/Action.h
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/Action.cpp
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/hip-cuid.hip
  clang/test/Frontend/hip-cuid.hip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95007.317706.patch
Type: text/x-patch
Size: 14977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210119/72c5d119/attachment-0001.bin>


More information about the cfe-commits mailing list