-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect slicing of GDS read/write calls #10274
Fix incorrect slicing of GDS read/write calls #10274
Conversation
…f max slice size; add tests
Codecov Report
@@ Coverage Diff @@
## branch-22.04 #10274 +/- ##
================================================
+ Coverage 10.42% 10.67% +0.24%
================================================
Files 119 122 +3
Lines 20603 20873 +270
================================================
+ Hits 2148 2228 +80
- Misses 18455 18645 +190
Continue to review full report at Codecov.
|
rerun tests |
std::vector<file_io_slice> slices; | ||
slices.reserve(n_slices); | ||
std::generate_n(std::back_inserter(slices), n_slices, [&, idx = 0]() mutable { | ||
auto const slice_offset = idx++ * max_slice_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL the value you change in a lambda will stick.
@gpucibot merge |
Issue happens when the read/write size is a multiple of the maximum slice size. It this case, size of the last slice is computed as
0
, instead ofmax_slice_size
:(t == n_slices - 1) ? size % max_slice_bytes : max_slice_bytes
This PR reimplements this part of code and adds unit tests.