GPU implementation and correction of the CPU version