[all-commits] [llvm/llvm-project] 38146e: [flang][cuda] Only register module variables defin...
Zhen Wang via All-commits
all-commits at lists.llvm.org
Mon Aug 3 17:17:06 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 38146e816a08d24f95b04e1940b362616fb4a075
https://github.com/llvm/llvm-project/commit/38146e816a08d24f95b04e1940b362616fb4a075
Author: Zhen Wang <zhenw at nvidia.com>
Date: 2026-08-03 (Mon, 03 Aug 2026)
Changed paths:
M flang/lib/Optimizer/Transforms/CUDA/CUFAddConstructor.cpp
M flang/test/Fir/CUDA/cuda-constructor-2.f90
Log Message:
-----------
[flang][cuda] Only register module variables defined in the current translation unit (#213720)
CUFAddConstructor registered every CUF module variable mirrored in the
GPU module, including variables brought in with USE from another
translation unit. Without relocatable device code each translation unit
has its own device module, so registering a declaration binds the host
address to a module that does not contain the symbol, and a later
cudaGetSymbolAddress fails with cudaErrorInvalidSymbol or
cudaErrorSymbolNotFound. Under unified memory the same declaration is
registered as host memory, overriding the defining unit's device
registration.
Skip globals that have no initializer and no body. Non-allocatable
managed globals still register, since they go through a companion
pointer local to the translation unit.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list