[CUDA] Emit host-side 'shadows' for device-side global variables
authorArtem Belevich <tra@google.com>
Wed, 2 Mar 2016 18:28:50 +0000 (18:28 +0000)
committerArtem Belevich <tra@google.com>
Wed, 2 Mar 2016 18:28:50 +0000 (18:28 +0000)
commit42e1949b4649c2ecbc9a13ca8b56f902b5214b95
tree039124b3490f5cb0926e371b806aa50e94fd4a2d
parentcdf3a2a5be7fb4c650ae30a44200248980e214ed
[CUDA] Emit host-side 'shadows' for device-side global variables

... and register them with CUDA runtime.

This is needed for commonly used cudaMemcpy*() APIs that use address of
host-side shadow to access their counterparts on device side.

Fixes PR26340

Differential Revision: http://reviews.llvm.org/D17779

llvm-svn: 262498
clang/lib/CodeGen/CGCUDANV.cpp
clang/lib/CodeGen/CGCUDARuntime.h
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/device-stub.cu
clang/test/CodeGenCUDA/filter-decl.cu