diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-01-19 17:35:23 -0500 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-02-08 22:26:12 -0500 |
commit | 98c21289f1d239f39fa549ae01b17efffce6a7c0 (patch) | |
tree | cc8eb3680295790b767180801402c32caf6a1bbf /clang/lib/Driver/Action.cpp | |
parent | 7dc324aafa2b17a4f9a992b9727a3642505053a6 (diff) | |
download | llvm-98c21289f1d239f39fa549ae01b17efffce6a7c0.zip llvm-98c21289f1d239f39fa549ae01b17efffce6a7c0.tar.gz llvm-98c21289f1d239f39fa549ae01b17efffce6a7c0.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Driver/Action.cpp')
-rw-r--r-- | clang/lib/Driver/Action.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp index 2ec063d..e2d2f6c 100644 --- a/clang/lib/Driver/Action.cpp +++ b/clang/lib/Driver/Action.cpp @@ -165,8 +165,8 @@ StringRef Action::GetOffloadKindName(OffloadKind Kind) { void InputAction::anchor() {} -InputAction::InputAction(const Arg &_Input, types::ID _Type) - : Action(InputClass, _Type), Input(_Input) {} +InputAction::InputAction(const Arg &_Input, types::ID _Type, StringRef _Id) + : Action(InputClass, _Type), Input(_Input), Id(_Id.str()) {} void BindArchAction::anchor() {} |