diff options
author | Artem Belevich <tra@google.com> | 2024-09-09 11:14:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 11:14:41 -0700 |
commit | 4a501a4556bb191bd6eb5398a7330a28437e5087 (patch) | |
tree | 0f90c63aad06996379baf419d0e30bcbc5c5b07f /clang/lib/Driver/Driver.cpp | |
parent | 6850410562123b6e4fbb039e7ba4a2325b994b84 (diff) | |
download | llvm-4a501a4556bb191bd6eb5398a7330a28437e5087.zip llvm-4a501a4556bb191bd6eb5398a7330a28437e5087.tar.gz llvm-4a501a4556bb191bd6eb5398a7330a28437e5087.tar.bz2 |
[CUDA/HIP] propagate -cuid to a host-only compilation. (#107483)
Right now we're bailing out too early, and `-cuid` does not get set for
the host-only compilations.
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 5b3783e..efe398d 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -3026,12 +3026,6 @@ class OffloadingActionBuilder final { // Set the flag to true, so that the builder acts on the current input. IsActive = true; - if (CompileHostOnly) - return ABRT_Success; - - // Replicate inputs for each GPU architecture. - auto Ty = IA->getType() == types::TY_HIP ? types::TY_HIP_DEVICE - : types::TY_CUDA_DEVICE; std::string CUID = FixedCUID.str(); if (CUID.empty()) { if (UseCUID == CUID_Random) @@ -3055,6 +3049,12 @@ class OffloadingActionBuilder final { } IA->setId(CUID); + if (CompileHostOnly) + return ABRT_Success; + + // Replicate inputs for each GPU architecture. + auto Ty = IA->getType() == types::TY_HIP ? types::TY_HIP_DEVICE + : types::TY_CUDA_DEVICE; for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) { CudaDeviceActions.push_back( C.MakeAction<InputAction>(IA->getInputArg(), Ty, IA->getId())); |