Skip to content

fix(example): batch a buffer sequence in cuda_device_stream::write_some - #392

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:example/cuda-batched-write
Aug 27, 2026
Merged

fix(example): batch a buffer sequence in cuda_device_stream::write_some#392
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:example/cuda-batched-write

Conversation

@sgerbino

Copy link
Copy Markdown
Collaborator

write_some copied only the first buffer of the sequence, so a gather write became one memcpy, one host function, and one suspend per buffer, draining the stream between transfers. Enqueue every buffer as its own cudaMemcpyAsync and follow the last with a single cudaLaunchHostFunc: the stream keeps its queue depth and the coroutine suspends once per call, matching what the WriteStream contract already permits.

example/cuda/batched-write runs the batched path: three host buffers go through any_write_stream in one write_some, and the device is checked to hold their concatenation. Registered as a ctest. datamovement stays build-only. The datamovement README names the paper by its current title.

@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://392.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-08-27 22:03:16 UTC

@sgerbino
sgerbino force-pushed the example/cuda-batched-write branch from 3676b0f to b7dee5a Compare August 27, 2026 22:06
write_some copied only the first buffer of the sequence, so a gather
write became one memcpy, one host function, and one suspend per buffer,
draining the stream between transfers. Enqueue every buffer as its own
cudaMemcpyAsync and follow the last with a single cudaLaunchHostFunc:
the stream keeps its queue depth and the coroutine suspends once per
call, matching what the WriteStream contract already permits.

example/cuda/batched-write runs the batched path: three host buffers go
through any_write_stream in one write_some, and the device is checked
to hold their concatenation. Registered as a ctest. datamovement stays
build-only. The datamovement README names the paper by its current
title.
@sgerbino
sgerbino force-pushed the example/cuda-batched-write branch from b7dee5a to d45ae3e Compare August 27, 2026 22:10
@sgerbino
sgerbino merged commit ee317c4 into cppalliance:develop Aug 27, 2026
1 check was pending
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Aug 27, 2026
@sgerbino
sgerbino deleted the example/cuda-batched-write branch August 27, 2026 22:10
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (969873d) to head (d45ae3e).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #392   +/-   ##
========================================
  Coverage    98.09%   98.09%           
========================================
  Files          130      130           
  Lines         6291     6291           
========================================
  Hits          6171     6171           
  Misses         120      120           
Flag Coverage Δ
linux 98.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 969873d...d45ae3e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants