]> granicus.if.org Git - clang/commitdiff
PTX: Add some basic support for OpenCL address spaces
authorJustin Holewinski <justin.holewinski@gmail.com>
Mon, 3 Oct 2011 17:28:37 +0000 (17:28 +0000)
committerJustin Holewinski <justin.holewinski@gmail.com>
Mon, 3 Oct 2011 17:28:37 +0000 (17:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141008 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index 74d3b7c8cc128577a59a96c59b72b80eae37c515..fc026d783e8638e60432a9394930a6d245502500 100644 (file)
@@ -878,6 +878,11 @@ public:
 } // end anonymous namespace.
 
 namespace {
+  static const unsigned PTXAddrSpaceMap[] = {
+    0,    // opencl_global
+    4,    // opencl_local
+    1     // opencl_constant
+  };
   class PTXTargetInfo : public TargetInfo {
     static const char * const GCCRegNames[];
     static const Builtin::Info BuiltinInfo[];
@@ -886,6 +891,7 @@ namespace {
     PTXTargetInfo(const std::string& triple) : TargetInfo(triple) {
       TLSSupported = false;
       LongWidth = LongAlign = 64;
+      AddrSpaceMap = &PTXAddrSpaceMap;
       // Define available target features
       // These must be defined in sorted order!      
       AvailableFeatures.push_back("compute10");