Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion vortex-array/src/arrays/constant/vtable/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ mod tests {
let element_validity = elements
.validity()
.vortex_expect("constant canonical element validity should be derivable");

assert!(element_validity.execute_is_valid(0, &mut ctx).unwrap());
assert!(!element_validity.execute_is_valid(1, &mut ctx).unwrap());
assert!(element_validity.execute_is_valid(2, &mut ctx).unwrap());
Expand Down
9 changes: 2 additions & 7 deletions vortex-array/src/arrays/listview/rebuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use vortex_error::VortexResult;
use crate::Canonical;
use crate::ExecutionCtx;
use crate::IntoArray;
use crate::LEGACY_SESSION;
use crate::arrays::ConstantArray;
use crate::arrays::ListViewArray;
use crate::arrays::PrimitiveArray;
Expand All @@ -20,7 +19,6 @@ use crate::builtins::ArrayBuiltins;
use crate::dtype::IntegerPType;
use crate::dtype::Nullability;
use crate::dtype::PType;
use crate::executor::VortexSessionExecute;
use crate::match_each_integer_ptype;
use crate::match_each_unsigned_integer_ptype;
use crate::scalar::Scalar;
Expand Down Expand Up @@ -212,11 +210,10 @@ impl ListViewArray {
let mut new_sizes = BufferMut::<S>::with_capacity(len);
let mut take_indices = BufferMut::<u64>::with_capacity(self.elements().len());

let mut ctx = LEGACY_SESSION.create_execution_ctx();
let validity = self.validity()?;
let mut n_elements = NewOffset::zero();
for index in 0..len {
if !validity.execute_is_valid(index, &mut ctx)? {
if !validity.execute_is_valid(index, ctx)? {
new_offsets.push(n_elements);
new_sizes.push(S::zero());
continue;
Expand Down Expand Up @@ -295,11 +292,10 @@ impl ListViewArray {
let mut new_elements_builder =
builder_with_capacity(element_dtype.as_ref(), self.elements().len());

let mut ctx = LEGACY_SESSION.create_execution_ctx();
let validity = self.validity()?;
let mut n_elements = NewOffset::zero();
for index in 0..len {
if !validity.execute_is_valid(index, &mut ctx)? {
if !validity.execute_is_valid(index, ctx)? {
// For NULL lists, place them after the previous item's data to maintain the
// no-overlap invariant for zero-copy to `ListArray` arrays.
new_offsets.push(n_elements);
Expand Down Expand Up @@ -486,7 +482,6 @@ mod tests {

// Verify nullability is preserved
assert_eq!(flattened.dtype().nullability(), Nullability::Nullable);
let mut ctx = SESSION.create_execution_ctx();
assert!(flattened.validity()?.execute_is_valid(0, &mut ctx)?);
assert!(!flattened.validity()?.execute_is_valid(1, &mut ctx)?);
assert!(flattened.validity()?.execute_is_valid(2, &mut ctx)?);
Expand Down
3 changes: 3 additions & 0 deletions vortex-cuda/kernels/src/dynamic_dispatch.cu
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ scalar_op(T *values, const struct ScalarOp &op, char *__restrict smem, uint64_t
}
break;
}
case ScalarOp::CAST:
// Values are casted as part of LOAD as defined by the dispatch plan.
break;
default:
__builtin_unreachable();
}
Expand Down
9 changes: 5 additions & 4 deletions vortex-cuda/kernels/src/dynamic_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ struct SourceOp {
/// change it:
/// - ALP: encoded int → float (e.g. i32 → f32, i64 → f64)
/// - DICT: codes type → values type (e.g. u8 → u32)
/// - CAST: current type → requested output type
///
/// The plan builder uses `output_ptype` to determine the element width
/// for shared memory allocation and to propagate type information
Expand Down Expand Up @@ -200,10 +201,10 @@ union ScalarParams {
};

struct ScalarOp {
enum ScalarOpCode { FOR, ZIGZAG, ALP, DICT } op_code;
/// The PType this op produces. For type-preserving ops (FOR, ZIGZAG)
/// this equals the input PType. For type-changing ops (ALP, DICT) this
/// is the new output PType.
enum ScalarOpCode { FOR, ZIGZAG, ALP, DICT, CAST } op_code;
/// The PType this op produces. For type-preserving ops (FOR, ZIGZAG) this
/// equals the input PType. For type-changing ops (ALP, DICT, CAST) this is
/// the new output PType.
enum PTypeTag output_ptype;
union ScalarParams params;
};
Expand Down
Loading
Loading