Updating cuda kernel launch and synchronizing device after completion