diff options
author | Alex Voicu <alexandru.voicu@amd.com> | 2025-07-23 13:55:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-23 13:55:46 +0100 |
commit | 01e23c3d626c30000820465f029793e44e2062e4 (patch) | |
tree | 860c70a6f6fa2078137b2bc042d78710641bdd33 /llvm/unittests/Support/ToolOutputFileTest.cpp | |
parent | efa25c4737440887772e6c6ed72029afa0bf05ca (diff) | |
download | llvm-01e23c3d626c30000820465f029793e44e2062e4.zip llvm-01e23c3d626c30000820465f029793e44e2062e4.tar.gz llvm-01e23c3d626c30000820465f029793e44e2062e4.tar.bz2 |
[HIPSTDPAR] Add support for globals (#146813)
This (mostly) removes one of the largest remaining limitations of
`hipstdpar` based algorithm acceleration, by adding support for global
variable usage in offloaded algorithms. It is mean to compose with a run
time component that will live in the support library, and fires iff a
special variable is provided by the latter. In short, things work as
follows:
- We replace uses some global `G` with an indirect access via an
implicitly created anonymous global `F`, which is of pointer type and is
expected to hold the program-wide address of `G`;
- We append 'F', alongside 'G''s name, to an table structure;
- At run-time, the support library uses the table to look-up the
program-wide address of a contained symbol based on its name, and then
stores the address via the paired pointer.
This doesn't handle internal linkage symbols (`static foo` or `namespace
{ foo }`) if they are not unique i.e. if there's a name clash that is
solved by the linker, as the resolution would not be visible. Also,
initially we will only support "true" globals in RDC mode. Things would
be much simpler if we had direct access to the accelerator loader, but
since the expectation is to compose at the HIP RT level we have to jump
through additional hoops.
Diffstat (limited to 'llvm/unittests/Support/ToolOutputFileTest.cpp')
0 files changed, 0 insertions, 0 deletions