Skip to content

Commit 7b93c5e

Browse files
committed
asserts
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent b6da826 commit 7b93c5e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

vortex-gpu/src/rle_decompress.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ use vortex_fastlanes::RLEArray;
2121

2222
#[allow(clippy::cognitive_complexity)]
2323
pub fn cuda_rle_decompress(rle: &RLEArray, ctx: Arc<CudaContext>) -> VortexResult<ArrayRef> {
24+
assert_eq!(rle.offset(), 0);
25+
assert_eq!(
26+
rle.values_idx_offsets()
27+
.scalar_at(0)
28+
.as_primitive()
29+
.as_::<u64>()
30+
.vortex_expect("non null offset"),
31+
0u64
32+
);
33+
2434
match_each_native_ptype!(rle.values().dtype().as_ptype(), |V| {
2535
match_each_unsigned_integer_ptype!(rle.values_idx_offsets().dtype().as_ptype(), |O| {
2636
// RLE indices are always u16 (or u8 if downcasted).
@@ -60,8 +70,6 @@ where
6070
Indices: UnsignedPType + DeviceRepr,
6171
Offsets: UnsignedPType + DeviceRepr,
6272
{
63-
assert_eq!(indices.len() % 1024, 0);
64-
6573
let kernel_func = cuda_rle_kernel::<Indices, Values, Offsets>(ctx.clone())?;
6674
let num_chunks =
6775
u32::try_from(indices.len().div_ceil(1024)).vortex_expect("num chunks overflow");

0 commit comments

Comments
 (0)