Skip to content

Commit 34a6ac1

Browse files
Revert "chore[vortex-gpu]: remove vortex-gpu" (#5384)
Reverts #5376 --------- Signed-off-by: Joe Isaacs <[email protected]>
1 parent 07f5039 commit 34a6ac1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+5202
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ jobs:
333333
--ignore 'vortex-python/*' --ignore 'vortex-jni/*' --ignore 'vortex-flatbuffers/*' \
334334
--ignore 'vortex-proto/*' --ignore 'vortex-tui/*' --ignore 'vortex-datafusion/examples/*' \
335335
--ignore 'vortex-ffi/examples/*' --ignore '*/arbitrary/*' --ignore '*/arbitrary.rs' --ignore 'vortex-cxx/*' \
336+
--ignore 'vortex-gpu/*' \
336337
-o ${{ env.GRCOV_OUTPUT_FILE }}
337338
- name: Codecov
338339
uses: codecov/codecov-action@v5

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ clap = "4.5"
8888
crossbeam-deque = "0.8.6"
8989
crossbeam-queue = "0.3.12"
9090
crossterm = "0.29"
91+
cudarc = { version = "0.17.3", features = [
92+
"std",
93+
"driver",
94+
"cuda-12080",
95+
"dynamic-loading",
96+
"f16",
97+
"nvrtc",
98+
], default-features = false }
9199
dashmap = "6.1.0"
92100
datafusion = { version = "50", default-features = false }
93101
datafusion-catalog = { version = "50" }
@@ -246,7 +254,6 @@ vortex-zstd = { version = "0.1.0", path = "./encodings/zstd", default-features =
246254
vortex-cxx = { path = "./vortex-cxx", default-features = false }
247255
vortex-duckdb = { path = "./vortex-duckdb", default-features = false }
248256
vortex-ffi = { path = "./vortex-ffi", default-features = false }
249-
250257
xshell = "0.2.6"
251258
zigzag = "0.1.0"
252259
zstd = { version = "0.13.3", default-features = false, features = [
@@ -269,6 +276,7 @@ unexpected_cfgs = { level = "deny", check-cfg = [
269276
"cfg(codspeed)",
270277
"cfg(disable_loom)",
271278
"cfg(vortex_nightly)",
279+
"cfg(gpu_unstable)",
272280
] }
273281
warnings = "warn"
274282

vortex-buffer/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ serde = { workspace = true, optional = true }
3434
simdutf8 = { workspace = true }
3535
vortex-error = { workspace = true }
3636

37+
[target.'cfg(gpu_unstable)'.dependencies]
38+
cudarc = { workspace = true }
39+
3740
[lints]
3841
workspace = true
3942

vortex-buffer/src/cuda.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
use cudarc::driver::{CudaStream, HostSlice, SyncOnDrop};
5+
6+
use crate::BufferMut;
7+
8+
impl<T> HostSlice<T> for BufferMut<T> {
9+
fn len(&self) -> usize {
10+
self.len()
11+
}
12+
13+
unsafe fn stream_synced_slice<'a>(
14+
&'a self,
15+
_stream: &'a CudaStream,
16+
) -> (&'a [T], SyncOnDrop<'a>) {
17+
(self.as_slice(), SyncOnDrop::Sync(None))
18+
}
19+
20+
unsafe fn stream_synced_mut_slice<'a>(
21+
&'a mut self,
22+
_stream: &'a CudaStream,
23+
) -> (&'a mut [T], SyncOnDrop<'a>) {
24+
(self.as_mut_slice(), SyncOnDrop::Sync(None))
25+
}
26+
}

vortex-buffer/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
#![deny(missing_docs)]
5+
// cudarc HostSlice has len and is_empty methods that duplicate BufferMut methods.
6+
#![allow(clippy::same_name_method)]
57

68
//! A library for working with custom aligned buffers of sized values.
79
//!
@@ -62,6 +64,8 @@ mod buffer;
6264
mod buffer_mut;
6365
mod bytes;
6466
mod r#const;
67+
#[cfg(gpu_unstable)]
68+
mod cuda;
6569
mod debug;
6670
mod macros;
6771
#[cfg(feature = "memmap2")]

vortex-file/src/file.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,23 @@ impl VortexFile {
9696
)
9797
}
9898

99+
#[cfg(gpu_unstable)]
100+
pub fn gpu_scan(
101+
&self,
102+
ctx: Arc<cudarc::driver::CudaContext>,
103+
) -> VortexResult<vortex_scan::gpu::GpuScanBuilder<vortex_gpu::GpuVector>> {
104+
let segment_source = self.segment_source();
105+
let gpu_reader = self
106+
.footer
107+
.layout()
108+
.new_gpu_reader("".into(), segment_source, ctx)?;
109+
110+
Ok(vortex_scan::gpu::GpuScanBuilder::new(
111+
self.session.clone(),
112+
gpu_reader,
113+
))
114+
}
115+
99116
/// Returns true if the expression will never match any rows in the file.
100117
pub fn can_prune(&self, filter: &Expression) -> VortexResult<bool> {
101118
let Some((stats, fields)) = self

0 commit comments

Comments
 (0)