The gold function provide the CPU version of the algorithm.