Comparison of the algorithm's speed on the GPU and CPU