Finally we can switch between CPU and GPU.