File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
vortex-array/src/arrays/patched/vtable Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,24 @@ use crate::arrays::PatchedArray;
1313use crate :: arrays:: slice:: SliceReduce ;
1414use crate :: stats:: ArrayStats ;
1515
16- /// Is this something that uses a SliceKernel or a SliceReduce
1716impl SliceReduce for Patched {
1817 fn slice ( array : & Self :: Array , range : Range < usize > ) -> VortexResult < Option < ArrayRef > > {
19- // We **always** slice at 1024-element chunk boundaries. We keep the offset + len
18+ // We **always** slice the patches at 1024-element chunk boundaries. We keep the offset + len
2019 // around so that when we execute we know how much to chop off.
2120 let new_offset = ( range. start + array. offset ) % 1024 ;
2221 let new_len = range. end - range. start ;
2322
2423 let chunk_start = ( range. start + array. offset ) / 1024 ;
2524 let chunk_stop = ( range. end + array. offset ) . div_ceil ( 1024 ) ;
26-
27- let inner = array. inner . slice ( range. start ..range. end ) ?;
28-
29- // Slice to only maintain offsets to the sliced chunks
3025 let sliced_lane_offsets = array
3126 . lane_offsets
3227 . slice ( ( chunk_start * array. n_lanes ) ..( chunk_stop * array. n_lanes ) + 1 ) ?;
3328
29+ // Unlike the patches, we slice the inner to the exact range. This is handled
30+ // at execution time by making sure to skip patch indices that are < offset
31+ // or >= len.
32+ let inner = array. inner . slice ( range. start ..range. end ) ?;
33+
3434 Ok ( Some (
3535 PatchedArray {
3636 inner,
You can’t perform that action at this time.
0 commit comments