Conversion from ___attribute___((shared)) to addrspace(3) in Clang compiler when compiling CUDA files
问题 The clang compiler includes CUDA header file host_defines.h in which the __shared__ is defined as __attribute__((shared)) . When CUDA source files are compiled to internal representation (IR) using clang, the __shared__ gets converted to addrspace(3) . These address spaces can be observed in the clang file llvm/tools/clang/lib/Basic/Targets.cpp line number 1601 as an array static const unsigned NVPTXAddrSpaceMap[] = { 1, // opencl_global 3, // opencl_local 4, // opencl_constant // FIXME: