Skip to content

Commit 3736032

Browse files
authored
Vortex crate doesn't unconditionally depend on vortex-cuda-macros (#6580)
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 48a98aa commit 3736032

File tree

5 files changed

+14
-23
lines changed

5 files changed

+14
-23
lines changed

Cargo.lock

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

fuzz/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default = ["native"]
2222
native = ["libfuzzer-sys", "zstd", "vortex-file", "vortex/files"]
2323
wasmfuzz = []
2424
zstd = ["vortex/zstd", "vortex-btrblocks/zstd", "vortex-btrblocks/pco"]
25-
cuda = ["vortex-cuda", "vortex/cuda", "tokio"]
25+
cuda = ["vortex-cuda", "tokio"]
2626

2727
[dependencies]
2828
# Always needed - arbitrary is used for input generation
@@ -38,7 +38,6 @@ vortex-buffer = { workspace = true }
3838
vortex-dtype = { workspace = true, features = ["arbitrary"] }
3939
vortex-error = { workspace = true }
4040
vortex-io = { workspace = true }
41-
vortex-layout = { workspace = true }
4241
vortex-mask = { workspace = true }
4342
vortex-runend = { workspace = true, features = ["arbitrary"] }
4443
vortex-session = { workspace = true }

fuzz/src/lib.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,19 @@ mod native_runtime {
4141
use vortex_session::VortexSession;
4242

4343
pub static RUNTIME: LazyLock<CurrentThreadRuntime> = LazyLock::new(CurrentThreadRuntime::new);
44-
pub static SESSION: LazyLock<VortexSession> =
45-
LazyLock::new(|| VortexSession::default().with_handle(RUNTIME.handle()));
44+
pub static SESSION: LazyLock<VortexSession> = LazyLock::new(|| {
45+
#[allow(unused_mut)]
46+
let mut session = VortexSession::default().with_handle(RUNTIME.handle());
47+
#[cfg(all(feature = "cuda", target_os = "linux"))]
48+
// Even if the CUDA feature is enabled we need to check at
49+
// runtime whether CUDA is available in the current environment.
50+
if vortex_cuda::cuda_available() {
51+
use vortex_cuda::CudaSessionExt;
52+
session = session.with::<vortex_cuda::CudaSession>();
53+
vortex_cuda::initialize_cuda(&session.cuda_session());
54+
}
55+
session
56+
});
4657
}
4758

4859
#[cfg(not(target_arch = "wasm32"))]

vortex/Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ vortex-array = { workspace = true }
2525
vortex-btrblocks = { workspace = true }
2626
vortex-buffer = { workspace = true }
2727
vortex-bytebool = { workspace = true }
28-
29-
vortex-cuda-macros = { workspace = true }
3028
vortex-datetime-parts = { workspace = true }
3129
vortex-decimal-byte-parts = { workspace = true }
3230
vortex-dtype = { workspace = true }
@@ -51,9 +49,6 @@ vortex-utils = { workspace = true }
5149
vortex-zigzag = { workspace = true }
5250
vortex-zstd = { workspace = true, optional = true }
5351

54-
[target.'cfg(target_os = "linux")'.dependencies]
55-
vortex-cuda = { workspace = true, optional = true }
56-
5752
[dev-dependencies]
5853
anyhow = { workspace = true }
5954
arrow-array = { workspace = true }
@@ -86,11 +81,9 @@ serde = [
8681
# This feature enabled unstable encodings for which we don't guarantee stability.
8782
unstable_encodings = [
8883
"vortex-btrblocks/unstable_encodings",
89-
"vortex-cuda?/unstable_encodings",
9084
"vortex-file?/unstable_encodings",
9185
"vortex-zstd?/unstable_encodings",
9286
]
93-
cuda = ["dep:vortex-cuda"]
9487

9588
[[bench]]
9689
name = "single_encoding_throughput"

vortex/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ impl VortexSessionDefault for VortexSession {
158158
.with::<ExprSession>()
159159
.with::<RuntimeSession>();
160160

161-
#[cfg(all(feature = "cuda", target_os = "linux"))]
162-
// Even if the CUDA feature is enabled we need to check at
163-
// runtime whether CUDA is available in the current environment.
164-
if vortex_cuda::cuda_available() {
165-
use vortex_cuda::CudaSessionExt;
166-
session = session.with::<vortex_cuda::CudaSession>();
167-
vortex_cuda::initialize_cuda(&session.cuda_session());
168-
}
169-
170161
#[cfg(feature = "files")]
171162
file::register_default_encodings(&mut session);
172163

0 commit comments

Comments
 (0)