Skip to content

Commit

Permalink
apacheGH-41664: PrettyPrint non-cpu data by copying slice to default …
Browse files Browse the repository at this point in the history
…CPU device
  • Loading branch information
jorisvandenbossche committed Jun 6, 2024
1 parent dbcce63 commit 9944230
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/src/arrow/pretty_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ Status PrettyPrint(const Array& arr, int indent, std::ostream* sink) {
Status PrettyPrint(const Array& arr, const PrettyPrintOptions& options,
std::ostream* sink) {
ArrayPrinter printer(options, sink);
if (arr.device_type() != DeviceAllocationType::kCPU) {
auto arr_sliced = arr.CopyTo(default_cpu_memory_manager());
return printer.Print(arr);
}
return printer.Print(arr);
}

Expand Down

0 comments on commit 9944230

Please sign in to comment.