[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 20 11:05:01 PDT 2021


yaxunl marked 2 inline comments as done.
yaxunl added a comment.

In D102801#2769619 <https://reviews.llvm.org/D102801#2769619>, @tra wrote:

> Tentative LGTM as we need it to fix the regression soon.
>
> Summoning @rsmith for the 'big picture' opinion. 
> While the patch may fix this particular regression, I wonder if there's a better way to deal with this. We're growing a bit too many nuances that would be hard to explain and may cause more corner cases to appear.

In the updated patch I have a simpler solution which is easier to explain to the users. Basically we classify variables by how they are emitted: device side only, host side only, both sides as different entities (e.g. default constexpr var), and both sides as unified entity (e.g. managed var). For variables emitted on both sides as separate entities, we have limited knowledge and we limit what we can do for them. I think users should understand the compiler's limitation in such cases. And they can easily workaround that by making the variable explicitly device variable.


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

https://reviews.llvm.org/D102801



More information about the cfe-commits mailing list