Skip to content

Commit

Permalink
use device_uvector
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Dec 14, 2024
1 parent 150c926 commit a9678d1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cpp/src/column/column_device_view.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ create_device_view_from_view(ColumnView const& source, rmm::cuda_stream_view str
// Each ColumnDeviceView instance may have child objects that
// require setting some internal device pointers before being copied
// from CPU to device.
auto* const descendant_storage = new rmm::device_buffer(descendant_storage_bytes, stream);
auto const descendant_storage = new rmm::device_uvector<char>(descendant_storage_bytes, stream);

auto deleter = [descendant_storage](ColumnDeviceView* v) {
v->destroy();
Expand All @@ -77,10 +77,7 @@ create_device_view_from_view(ColumnView const& source, rmm::cuda_stream_view str
new ColumnDeviceView(source, staging_buffer.data(), descendant_storage->data()), deleter};

// copy the CPU memory with all the children into device memory
detail::cuda_memcpy<char>(
device_span<char>{static_cast<char*>(descendant_storage->data()), descendant_storage->size()},
staging_buffer,
stream);
detail::cuda_memcpy<char>(*descendant_storage, staging_buffer, stream);

return result;
}
Expand Down

0 comments on commit a9678d1

Please sign in to comment.