This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Fix static device var used by host code only
ClosedPublic

Authored by yaxunl on Sep 22 2020, 1:57 PM.

Details

Summary

A static device variable may be accessed in host code through
cudaMemCpyFromSymbol etc. Currently clang does not
emit the static device variable if it is only referenced by
host code, which causes host code to fail at run time.

This patch fixes that.

Diff Detail

Event Timeline

yaxunl requested review of this revision.Sep 22 2020, 1:57 PM
yaxunl created this revision.
tra accepted this revision.Sep 22 2020, 2:11 PM
This revision is now accepted and ready to land.Sep 22 2020, 2:11 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2020, 5:20 AM