Skip to content

Commit

Permalink
rest of it
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Oct 18, 2024
1 parent da45d00 commit 75dc549
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
6 changes: 4 additions & 2 deletions cpp/src/io/comp/uncomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,10 @@ size_t decompress_zstd(host_span<uint8_t const> src,
CUDF_EXPECTS(hd_stats[0].status == compression_status::SUCCESS, "ZSTD decompression failed");

// Copy temporary output to `dst`
CUDF_CUDA_TRY(cudaMemcpyAsync(
dst.data(), d_dst.data(), hd_stats[0].bytes_written, cudaMemcpyDefault, stream.value()));
cudf::detail::cuda_memcpy_async(
dst.subspan(0, hd_stats[0].bytes_written),
device_span<uint8_t const>{d_dst.data(), hd_stats[0].bytes_written},
stream);

return hd_stats[0].bytes_written;
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/io/text/bgzip_data_chunk_source.cu
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class bgzip_data_chunk_reader : public data_chunk_reader {
// Buffer needs to be padded.
// Required by `inflate_kernel`.
device.resize(cudf::util::round_up_safe(host.size(), BUFFER_PADDING_MULTIPLE), stream);
CUDF_CUDA_TRY(cudaMemcpyAsync(
device.data(), host.data(), host.size() * sizeof(T), cudaMemcpyDefault, stream.value()));
cudf::detail::cuda_memcpy_async<T>(
device_span<T>{device}.subspan(0, host.size()), host, stream);
}

struct decompression_blocks {
Expand Down
22 changes: 12 additions & 10 deletions cpp/src/io/text/data_chunk_source_factories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ class datasource_chunk_reader : public data_chunk_reader {
_source->host_read(_offset, read_size, reinterpret_cast<uint8_t*>(h_ticket.buffer.data()));

// copy the host-pinned data on to device
CUDF_CUDA_TRY(cudaMemcpyAsync(
chunk.data(), h_ticket.buffer.data(), read_size, cudaMemcpyDefault, stream.value()));
cudf::detail::cuda_memcpy_async<char>(
device_span<char>{chunk}.subspan(0, read_size),
host_span<char const>{h_ticket.buffer}.subspan(0, read_size),
stream);

// record the host-to-device copy.
CUDF_CUDA_TRY(cudaEventRecord(h_ticket.event, stream.value()));
Expand Down Expand Up @@ -153,8 +155,10 @@ class istream_data_chunk_reader : public data_chunk_reader {
auto chunk = rmm::device_uvector<char>(read_size, stream);

// copy the host-pinned data on to device
CUDF_CUDA_TRY(cudaMemcpyAsync(
chunk.data(), h_ticket.buffer.data(), read_size, cudaMemcpyDefault, stream.value()));
cudf::detail::cuda_memcpy_async<char>(
device_span<char>{chunk}.subspan(0, read_size),
host_span<char const>{h_ticket.buffer}.subspan(0, read_size),
stream);

// record the host-to-device copy.
CUDF_CUDA_TRY(cudaEventRecord(h_ticket.event, stream.value()));
Expand Down Expand Up @@ -193,12 +197,10 @@ class host_span_data_chunk_reader : public data_chunk_reader {
auto chunk = rmm::device_uvector<char>(read_size, stream);

// copy the host data to device
CUDF_CUDA_TRY(cudaMemcpyAsync( //
chunk.data(),
_data.data() + _position,
read_size,
cudaMemcpyDefault,
stream.value()));
cudf::detail::cuda_memcpy_async<char>(
cudf::device_span<char>{chunk}.subspan(0, read_size),
cudf::host_span<char const>{_data}.subspan(_position, read_size),
stream);

_position += read_size;

Expand Down

0 comments on commit 75dc549

Please sign in to comment.