CUDAToolkit: Allow to link the cudadevrt library
Currently there is no imported target for the cudadevrt
library.
I'm far from a CUDA expert so please treat everything I say here with a grain of salt.
I'm under the impression that using the separable compilation (via CUDA_SEPARABLE_COMPILATION
) can lead to missing symbols. I have seen that this can be resolved with enabling CUDA_RESOLVE_DEVICE_SYMBOLS
too. But I'm furthermore under the impression that CUDA_RESOLVE_DEVICE_SYMBOLS
does something more than just linking against cudadevrt
. The documentation mentions that device linking is usually deferred, but can be moved to an earlier build step with this option. So I understand that the behavior is slightly different whether the user "just" links cudadevrt
in the final link step or enables CUDA_RESOLVE_DEVICE_SYMBOLS
.
This is the idea of the current PR: Allow users to link cudadevrt
in the final link step, to resolve possibly missing symbols from separable compilation.
Is that sensible?
See also !5376 (closed)