-
Notifications
You must be signed in to change notification settings - Fork 126
fix[cuda]: Fix gpu_scan test #6208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
02208f2
e930438
d03bf7e
7140c72
0faea9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| use std::hash::Hash; | ||
|
|
||
| use vortex_dtype::DType; | ||
| use vortex_vector::binaryview::BinaryView; | ||
|
|
||
| use crate::Precision; | ||
| use crate::arrays::varbinview::VarBinViewArray; | ||
|
|
@@ -15,7 +16,7 @@ use crate::vtable::BaseArrayVTable; | |
|
|
||
| impl BaseArrayVTable<VarBinViewVTable> for VarBinViewVTable { | ||
| fn len(array: &VarBinViewArray) -> usize { | ||
| array.views().len() | ||
| array.views_handle().len() / size_of::<BinaryView>() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is a little annoying
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea |
||
| } | ||
|
|
||
| fn dtype(array: &VarBinViewArray) -> &DType { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,8 @@ pub trait DeviceBuffer: 'static + Send + Sync + Debug + DynEq + DynHash { | |
|
|
||
| /// Create a new buffer that references a subrange of this buffer at the given | ||
| /// slice indices. | ||
| /// | ||
| /// Note that slice indices are in byte units. | ||
| fn slice(&self, range: Range<usize>) -> Arc<dyn DeviceBuffer>; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we not make this of T?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this change from the CPU version?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can't have generics on a dyn trait
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BufferHandle has a slice_typed but the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can do a ext trait
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont need to now
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's done |
||
|
|
||
| /// Return a buffer with the given alignment. Where possible, this will be zero-copy. | ||
|
|
@@ -93,6 +95,19 @@ pub trait DeviceBuffer: 'static + Send + Sync + Debug + DynEq + DynHash { | |
| fn aligned(self: Arc<Self>, alignment: Alignment) -> VortexResult<Arc<dyn DeviceBuffer>>; | ||
| } | ||
|
|
||
| pub trait DeviceBufferExt: DeviceBuffer { | ||
| /// Slice a range of elements `T` out of the device buffer. | ||
| fn slice_typed<T: Sized>(&self, range: Range<usize>) -> Arc<dyn DeviceBuffer>; | ||
| } | ||
|
|
||
| impl<B: DeviceBuffer> DeviceBufferExt for B { | ||
| fn slice_typed<T: Sized>(&self, range: Range<usize>) -> Arc<dyn DeviceBuffer> { | ||
| let start_bytes = range.start * size_of::<T>(); | ||
| let end_bytes = range.end * size_of::<T>(); | ||
| self.slice(start_bytes..end_bytes) | ||
| } | ||
| } | ||
|
|
||
| impl Hash for dyn DeviceBuffer { | ||
| fn hash<H: Hasher>(&self, state: &mut H) { | ||
| self.dyn_hash(state); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a execute_parent here so we don't CPU regress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done