Testing loop

Can run both CPU and GPU algorithms multiples times, and the average of
all runs is taken. Good for more accurate benchmarking.