Added thread divergence and re-factored device copy commands