Support HIP separable compilation
Support separable compilation / relocatable device code for hip as well as cuda.
Without the -fgpu-rdc flag I get an unsupported indirect call to function error at link time.
This is still an issue, how are people handling this in cmake? It would be nice to have something equivalent to CUDA_SEPARABLE_COMPILATION to help ensure the rdc flag propagates down to the link step.
I saw a mention of the separable hip compilation model in the cmake documentation, but it doesn't indicate how to actually set the compilation model. https://cmake.org/cmake/help/latest/prop_tgt/HIP_ARCHITECTURES.html Device and host linking is mentioned here along with CUDA_SEPARABLE_COMPILATION but nothing is mentioned for hip. https://cmake.org/cmake/help/latest/command/target_link_options.html?highlight=separable#host-and-device-specific-link-options
Still not as easy as CUDA. There should be an equivalent HIP flag (HIP_SEPARABLE_COMPILATION) but there isn't:
https://gitlab.kitware.com/cmake/cmake/-/issues/23210
It seems for now you have to manually add the flag yourself.
"You will never reach your destination if you stop and throw stones at every dog that barks." --Winston Churchill