Implemented the prefix sum kernel.