diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2012-05-20 21:08:35 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-05-20 21:08:35 +0000 |
| commit | f44bdf9c5fc347f1639d50c49de2b836f28017e2 (patch) | |
| tree | a21092fbd172f3ac505a42a8bc578d9daeee9b77 /clang/lib/Basic | |
| parent | 853a8a982bb9b3220e3625b725b15faa8ba91d99 (diff) | |
| download | bcm5719-llvm-f44bdf9c5fc347f1639d50c49de2b836f28017e2.tar.gz bcm5719-llvm-f44bdf9c5fc347f1639d50c49de2b836f28017e2.zip | |
CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0. This relies on address
space 0 being a unified address space.
llvm-svn: 157167
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 045229e9fba..8e7cdf934d3 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -949,7 +949,10 @@ namespace { static const unsigned PTXAddrSpaceMap[] = { 0, // opencl_global 4, // opencl_local - 1 // opencl_constant + 1, // opencl_constant + 0, // cuda_device + 1, // cuda_constant + 4, // cuda_shared }; class PTXTargetInfo : public TargetInfo { static const char * const GCCRegNames[]; @@ -3384,7 +3387,10 @@ namespace { static const unsigned TCEOpenCLAddrSpaceMap[] = { 3, // opencl_global 4, // opencl_local - 5 // opencl_constant + 5, // opencl_constant + 0, // cuda_device + 0, // cuda_constant + 0 // cuda_shared }; class TCETargetInfo : public TargetInfo{ |

