The patch implements support for built-in CUDA variables using __declattr((property)) attribute to convert all built-in variable reads into appropriate llvm builtin calls.
This makes it possible to compile typical CUDA source code that relies on built-in variables.