Skip to content

Commit 6aa020c

Browse files
committed
Vector pipeline
Signed-off-by: Nicholas Gates <[email protected]>
1 parent a2b63ac commit 6aa020c

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

vortex-array/src/pipeline/driver/input.rs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ impl Kernel for InputKernel {
4747

4848
#[cfg(test)]
4949
mod test {
50-
use vortex_buffer::{BitBuffer, bitbuffer, buffer};
50+
use vortex_buffer::{bitbuffer, buffer};
5151
use vortex_dtype::PTypeDowncastExt;
5252
use vortex_mask::Mask;
5353

54-
use crate::arrays::{BoolArray, PrimitiveArray};
5554
use crate::pipeline::driver::PipelineDriver;
56-
use crate::validity::Validity;
5755
use crate::{Array, ArrayOperator, IntoArray};
5856

5957
#[test]
@@ -89,38 +87,4 @@ mod test {
8987
.downcast::<u32>();
9088
assert_eq!(vector.elements().as_ref(), &[0u32, 2, 4]);
9189
}
92-
93-
/// Ensures that we can feed an input into a pipeline with zero-copy.
94-
/// This can require careful book keeping to make sure we don't hold references to arrays
95-
/// around longer than necessary.
96-
#[test]
97-
fn test_pipeline_input_zero_copy() {
98-
let elements = buffer![123u32; 8000];
99-
let elements_ptr = elements.as_ptr();
100-
let validity = BitBuffer::from_iter((0..8000).map(|i| i % 2 == 0));
101-
let validity_ptr = validity.inner().as_ptr();
102-
103-
let array = PrimitiveArray::new(
104-
elements,
105-
Validity::Array(BoolArray::from(validity).into_array()),
106-
)
107-
.into_array();
108-
assert!(
109-
array.as_pipelined().is_none(),
110-
"We're explicitly testing non-pipelined arrays to trigger the input case"
111-
);
112-
113-
let selection = Mask::new_true(array.len());
114-
let vector = PipelineDriver::new(array)
115-
.execute(&selection)
116-
.unwrap()
117-
.into_primitive()
118-
.downcast::<u32>();
119-
120-
let (vector_elements, vector_validity) = vector.into_parts();
121-
let vector_validity = vector_validity.into_bit_buffer().into_inner();
122-
123-
assert_eq!(vector_elements.as_ptr(), elements_ptr);
124-
assert_eq!(vector_validity.as_ptr(), validity_ptr);
125-
}
12690
}

vortex-array/src/pipeline/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl KernelCtx {
107107

108108
/// Returns the input vector at the given index.
109109
///
110-
/// Note that a [`VectorMut`] is returned here, indicating that this is the only instance of
110+
/// Note that a [`Vector`] is returned here, indicating that this is the only instance of
111111
/// the data. Kernels are encouraged to use [`std::mem::swap`] or similar to propagate data
112112
/// from input vectors to output vectors without unnecessary copies.
113113
///

0 commit comments

Comments
 (0)