[CUDA][HIP] Skip setting `externally_initialized` for static device variables.
authorMichael Liao <michael.hliao@gmail.com>
Wed, 29 May 2019 17:23:27 +0000 (17:23 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Wed, 29 May 2019 17:23:27 +0000 (17:23 +0000)
commit4b7a713accdce4e46a45f34bd8705e43b495ddec
tree24b70efb61c7c31df61306d94d90ad09883a6947
parentc98b288b030cde85ae8d4e188677546efcbe0d29
[CUDA][HIP] Skip setting `externally_initialized` for static device variables.

Summary:
- By declaring device variables as `static`, we assume they won't be
  addressable from the host side. Thus, no `externally_initialized` is
  required.

Reviewers: yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62603

llvm-svn: 361994
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/device-var-init.cu