Reduction kernel from OCL book