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
5 changes: 2 additions & 3 deletions encodings/runend/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ impl RunEndArray {
return Ok(());
}

// Skip host-only validation when buffers are on the GPU.
let ends_on_device = ends.buffer_handles().iter().any(|h| h.is_on_device());
if ends_on_device {
// Skip host-only validation when ends are not host-resident.
if !ends.is_host() {
return Ok(());
}

Expand Down
9 changes: 2 additions & 7 deletions vortex-array/src/arrays/dict/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,8 @@ impl DictArray {
/// This is primarily useful for testing and debugging.
pub fn validate_all_values_referenced(&self) -> VortexResult<()> {
if self.all_values_referenced {
// Skip host-only validation when buffers are on the GPU.
let codes_on_device = self
.codes()
.buffer_handles()
.iter()
.any(|h| h.is_on_device());
if codes_on_device {
// Skip host-only validation when codes are not host-resident.
if !self.codes().is_host() {
return Ok(());
}

Expand Down
7 changes: 2 additions & 5 deletions vortex-array/src/arrays/listview/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,8 @@ impl ListViewArray {
);
}

// Skip host-only validation when buffers are on the GPU.
let offsets_on_device = offsets.buffer_handles().iter().any(|h| h.is_on_device());
let sizes_on_device = sizes.buffer_handles().iter().any(|h| h.is_on_device());

if !offsets_on_device && !sizes_on_device {
// Skip host-only validation when offsets/sizes are not host-resident.
if offsets.is_host() && sizes.is_host() {
let offsets_primitive = offsets.to_primitive();
let sizes_primitive = sizes.to_primitive();

Expand Down
13 changes: 6 additions & 7 deletions vortex-array/src/arrays/varbin/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,8 @@ impl VarBinArray {
vortex_ensure!(is_sorted, "offsets must be sorted");
}

// Skip host-only validation when buffers are on the GPU.
let offsets_on_device = offsets.buffer_handles().iter().any(|h| h.is_on_device());

if !offsets_on_device && bytes.is_on_host() {
// Skip host-only validation when offsets/bytes are not host-resident.
if offsets.is_host() && bytes.is_on_host() {
let last_offset = offsets
.scalar_at(offsets.len() - 1)?
.as_primitive()
Expand All @@ -232,9 +230,10 @@ impl VarBinArray {
);
}

// Validate UTF-8 for Utf8 dtype. Skip when buffers are on device.
if matches!(dtype, DType::Utf8(_))
&& !offsets_on_device
// Validate UTF-8 for Utf8 dtype. Skip when offsets/bytes are not host-resident.
if offsets.is_host()
&& bytes.is_on_host()
&& matches!(dtype, DType::Utf8(_))
&& let Some(bytes) = bytes.as_host_opt()
{
let primitive_offsets = offsets.to_primitive();
Expand Down
Loading