diff options
author | Renaud Kauffmann <rkauffmann@nvidia.com> | 2024-12-05 18:36:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 18:36:48 -0800 |
commit | 27e458c8cbec27d48ee73623c4b5bbf6bba407cb (patch) | |
tree | fe1db70b1601446d86c7e0a4657cc000b9e7942c /clang/lib/Sema/MultiplexExternalSemaSource.cpp | |
parent | d20731ce6bc97e2cc0d6be502ca174c14d563de2 (diff) | |
download | llvm-27e458c8cbec27d48ee73623c4b5bbf6bba407cb.zip llvm-27e458c8cbec27d48ee73623c4b5bbf6bba407cb.tar.gz llvm-27e458c8cbec27d48ee73623c4b5bbf6bba407cb.tar.bz2 |
[flang][cuda] Distinguish constant fir.global from globals with a #cuf.cuda<constant> attribute (#118912)
1. In `CufOpConversion` `isDeviceGlobal` was renamed
`isRegisteredGlobal` and moved to the common file. `isRegisteredGlobal`
excludes constant `fir.global` operation from registration. This is to
avoid calls to `_FortranACUFGetDeviceAddress` on globals which do not
have any symbols in the runtime. This was done for
`_FortranACUFRegisterVariable` in #118582, but also needs to be done
here after #118591
2. `CufDeviceGlobal` no longer adds the `#cuf.cuda<constant>` attribute
to the constant global. As discussed in #118582 a module variable with
the #cuf.cuda<constant> attribute is not a compile time constant. Yet,
the compile time constant also needs to be copied into the GPU module.
The candidates for copy to the GPU modules are
- the globals needing regsitrations regardless of their uses in device
code (they can be referred to in host code as well)
- the compile time constant when used in device code
3. The registration of "constant" module device variables (
#cuf.cuda<constant>) can be restored in `CufAddConstructor`
Diffstat (limited to 'clang/lib/Sema/MultiplexExternalSemaSource.cpp')
0 files changed, 0 insertions, 0 deletions