[PATCH] D104505: [HIP] Defer operator overloading errors

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 21 16:05:11 PDT 2021


tra added a comment.

In D104505#2831644 <https://reviews.llvm.org/D104505#2831644>, @yaxunl wrote:

> However, this does cause source level incompatibilities, i.e. CUDA code that passes nvcc does not pass clang. This patch somehow addresses that without compromising clang's more sophisticated `__host__/__device__` overloading resolution capabilities.

Yes. This will not be the first time where clang does diagnose invalid code while NVCC does not.
In general, some amount of source code porting between nvcc and clang is expected. In practice the amount of work required to make CUDA code portable has been relatively minor.

My general rule of thumb is that if both host and device compilation have enough information to diagnose a problem, both should do it.
In this case, there's no ambiguity that the code is invalid. The sooner we diagnose it, the better.

Is there particular use case where this patch would be necessary?


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

https://reviews.llvm.org/D104505



More information about the cfe-commits mailing list