Synchronizes the device, blocking until all preceding tasks in all streams have completed.
Returns cudaSuccess if the device was set successfully, or an error code if there was an issue.
cudaSuccess