[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 11:53:02 PDT 2020


tra added a comment.

LGTM in principle. That said, my gut feeling is that this patch has a good chance of breaking something in sufficiently convoluted CUDA code like Eigen. When you land this patch, I'd appreciate if you could do it on a workday morning (Pacific time) so I'm around to test it on our code and revert if something unexpected pops up.

On a side note, this case is another point towards having to redo handling of `__host__ __device__`.  There are way too many corner cases all over the place. Things will only get worse as we move towards newer C++ standard where a lot more code becomes constexpr which is implicitly `HD`. Having calls from `HD` functions resolve in a different way during host/device compilation is observable and may result in host and device code diverging unexpectedly.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77954/new/

https://reviews.llvm.org/D77954





More information about the cfe-commits mailing list