[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 11:45:11 PDT 2020


tra added a comment.

Sam, just a FYI that the patch has a couple of unintended consequences.

We now end up with various things instantiated as device-side __constant__ objects when they were not before, when we compile with -std=c++17 (especially with libc++):
https://godbolt.org/z/KbTM9M

That in turn sometimes pulls in other thins that may not exist on the device. E.g. in one case we've ended up with a PTX error caused by unresolved reference to `strlen()` (via some char_traits functions) .
The other potential issue is that we increase use of `__constant__` and there's only 64K of it, so additional use pushed total use over the limit in few cases.

So far all failures can be attributed to questionable user code, but when we may need to figure out how to avoid emitting unused `__constant__` data.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80858



More information about the cfe-commits mailing list