Commits


Joris Van den Bossche authored and GitHub committed b35e7ddbefe
GH-43507: [C++] Use ViewOrCopyTo instead of CopyTo when pretty printing non-CPU data (#43508) ### Rationale for this change When ensuring the data we are pretty-printing is on the CPU, we can use `ViewOrCopyTo` instead of `CopyTo`, in case the data can be viewed as CPU data without a copy. ### Are these changes tested? Yes (I added a test that uses CUDA host memory, which should be a case where it can be viewed and doesn't need to be copied, but of course the test it not actually ensuring we avoid the copy, just that the printing works) ### Are there any user-facing changes? No * GitHub Issue: #43507 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>