runtests for both CPU and GPU.