[CUDA][OpenMP] Fix the new driver crashing on multiple device-only outputs
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 19 Aug 2022 15:38:12 +0000 (11:38 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 24 Aug 2022 13:47:55 +0000 (08:47 -0500)
commitba57828e11c52f45420f2027dae0843cf83a57bf
tree7c93cae0302a1b6c2d8314c4cd9ac5c49b84d4c1
parent96c85f80f0d615ffde0f85d8270e0a8c9f4e5430
[CUDA][OpenMP] Fix the new driver crashing on multiple device-only outputs

The new driver supports device-only compilation for the offloading
device. The way this is handlded is a little different from the old
offloading driver. The old driver would put all the outputs in the final
action list akin to a linker job. The new driver however generated these
in the middle of the host's job so we instead put them all in a single
offloading action. However, we only handled these kinds of offloading
actions correctly when there was only a single input. When we had
multiple inputs we would instead attempt to get the host job, which
didn't exist, and crash.

This patch simply adds some extra logic to generate the jobs for all
dependencies if there is not host action.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D132248
clang/lib/Driver/Driver.cpp
clang/test/Driver/cuda-bindings.cu
clang/test/Driver/hip-binding.hip