The problem seems to only happen when compiling for 64 bit architectures.
I have experienced this problem and usually ended up copying data to host before doing the reduce operation.
If you’ve ever wanted automatic code formatting in xcode like that in eclipse, it is entirely possible with an automator workflow and astyle.
first install astyle, if using macports:
Then in our home directory we need to create a .astylerc file. This file defines the style for the code formatting. An example is provided below, for more info refer to the documentation.