Should not this change **decrease** the performance? It looks like the original code accumulated the transformed sequence on the fly, and the new version stored the intermediate result to the global memory.