[CUDA] Fix output name being replaced in device-only mode
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 5 Aug 2022 18:43:23 +0000 (14:43 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 5 Aug 2022 23:08:41 +0000 (19:08 -0400)
commit3b52341116b794e53dec2fd07e568884e5a0b8bb
treeb41970181201821e8ff46e15dbf44211fb355a98
parent6635f48e4aba499a7a31c6346cb1351437d36055
[CUDA] Fix output name being replaced in device-only mode

When performing device only compilation, there was an issue where
`cubin` outputs were being renamed to `cubin` despite the user's name.
This is required in a normal compilation flow as the Nvidia tools only
understand specific filenames instead of checking magic bytes for some
unknown reason. We do not want to perform this transformation when the
user is performing device only compilation.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D131278
clang/lib/Driver/ToolChains/Cuda.cpp
clang/test/Driver/cuda-bindings.cu