Skip to content

Commit

Permalink
Fix cudf_assert in cudf::io::orc::gpu::gpuDecodeOrcColumnData (#9348)
Browse files Browse the repository at this point in the history
This fixes the `cudf_assert` check in an ORC reader device function that checks an offsets value does not exceed a `size_type`. The assert expression was just coded backwards and so was being triggered for valid values.

This PR fixes the assert expression.

The assert only occurs in a debug build since it is compiled out of a release build. Also, test code for this code path was only recently added.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Jake Hemstad (https://github.com/jrhemstad)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #9348
  • Loading branch information
davidwendt authored Oct 5, 2021
1 parent 1424a2d commit 56edd42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/io/orc/stripe_data.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ __global__ void __launch_bounds__(block_size)
// Since the offsets column in cudf is `size_type`,
// If the limit exceeds then value will be 0, which is Fail.
cudf_assert(
(s->vals.u64[t + vals_skipped] > std::numeric_limits<size_type>::max()) and
(s->vals.u64[t + vals_skipped] <= std::numeric_limits<size_type>::max()) and
"Number of elements is more than what size_type can handle");
list_child_elements = s->vals.u64[t + vals_skipped];
static_cast<uint32_t*>(data_out)[row] = list_child_elements;
Expand Down

0 comments on commit 56edd42

Please sign in to comment.