Skip to content

Commit b928ccf

Browse files
committed
Keep libgpuspatial only
1 parent 4a67e45 commit b928ccf

File tree

28 files changed

+46
-3400
lines changed

28 files changed

+46
-3400
lines changed

.github/workflows/rust-gpu.yml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -216,40 +216,3 @@ jobs:
216216
# Build library only (skip tests - they require CUDA driver which isn't available)
217217
# --lib builds only the library, not test binaries
218218
cargo build --locked --package sedona-libgpuspatial --lib --features gpu --verbose
219-
220-
- name: Build GPU spatial join (with GPU feature)
221-
run: |
222-
echo "=== Building GPU spatial join package WITH GPU feature ==="
223-
echo "Building Rust GPU spatial join (depends on libgpuspatial)"
224-
echo ""
225-
# Build library only (skip tests - they require CUDA driver)
226-
cargo build --locked --package sedona-spatial-join-gpu --lib --features gpu --verbose
227-
228-
- name: Build entire workspace with GPU features
229-
run: |
230-
echo "=== Building entire SedonaDB workspace WITH GPU features ==="
231-
echo "Verifying GPU packages integrate with rest of codebase"
232-
echo ""
233-
# Build entire workspace with GPU features enabled
234-
# Exclude sedonadb (Python extension, requires maturin)
235-
# Exclude sedona-s2geography (has GCC 11 compatibility issues, unrelated to GPU)
236-
# Build libs only (skip tests - they require CUDA driver)
237-
cargo build --workspace --exclude sedonadb --exclude sedona-s2geography --lib --features gpu --verbose
238-
239-
# GPU tests commented out - no GPU hardware on GitHub runners
240-
# Uncomment these when running on self-hosted GPU runner
241-
242-
# - name: Test libgpuspatial
243-
# run: |
244-
# echo "Running libgpuspatial tests with GPU..."
245-
# cargo test --package sedona-libgpuspatial --features gpu -- --nocapture
246-
247-
# - name: Test GPU spatial join (structure tests)
248-
# run: |
249-
# echo "Running structure tests (don't require GPU execution)..."
250-
# cargo test --package sedona-spatial-join-gpu --features gpu
251-
252-
# - name: Test GPU functional tests (require GPU)
253-
# run: |
254-
# echo "Running GPU functional tests (require actual GPU)..."
255-
# cargo test --package sedona-spatial-join-gpu --features gpu -- --ignored --nocapture

Cargo.toml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,11 @@ members = [
3737
"rust/sedona-raster-functions",
3838
"rust/sedona-schema",
3939
"rust/sedona-spatial-join",
40-
"rust/sedona-spatial-join-gpu",
4140
"rust/sedona-testing",
4241
"rust/sedona",
4342
"sedona-cli",
4443
]
4544
resolver = "2"
46-
default-members = [
47-
"c/sedona-geoarrow-c",
48-
"c/sedona-geos",
49-
"c/sedona-proj",
50-
"c/sedona-s2geography",
51-
"c/sedona-tg",
52-
"r/sedonadb/src/rust",
53-
"rust/sedona-adbc",
54-
"rust/sedona-expr",
55-
"rust/sedona-functions",
56-
"rust/sedona-geo",
57-
"rust/sedona-geometry",
58-
"rust/sedona-geoparquet",
59-
"rust/sedona-schema",
60-
"rust/sedona-spatial-join",
61-
"rust/sedona-testing",
62-
"rust/sedona",
63-
"sedona-cli",
64-
]
6545

6646
[workspace.package]
6747
version = "0.2.0"

python/sedonadb/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ crate-type = ["cdylib"]
2828
default = ["mimalloc"]
2929
mimalloc = ["dep:mimalloc", "dep:libmimalloc-sys"]
3030
s2geography = ["sedona/s2geography"]
31-
gpu = ["sedona/gpu"]
3231

3332
[dependencies]
3433
adbc_core = { workspace = true }

rust/sedona-common/src/option.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,6 @@ config_namespace! {
6666

6767
/// Include tie-breakers in KNN join results when there are tied distances
6868
pub knn_include_tie_breakers: bool, default = false
69-
70-
/// GPU acceleration options
71-
pub gpu: GpuOptions, default = GpuOptions::default()
72-
}
73-
}
74-
75-
config_namespace! {
76-
/// Configuration options for GPU-accelerated spatial joins
77-
pub struct GpuOptions {
78-
/// Enable GPU-accelerated spatial joins (requires CUDA and GPU feature flag)
79-
pub enable: bool, default = false
80-
81-
/// Minimum number of rows to consider GPU execution
82-
pub min_rows_threshold: usize, default = 100000
83-
84-
/// GPU device ID to use (0 = first GPU, 1 = second, etc.)
85-
pub device_id: usize, default = 0
86-
87-
/// Fall back to CPU if GPU initialization or execution fails
88-
pub fallback_to_cpu: bool, default = true
89-
90-
/// Maximum GPU memory to use in megabytes (0 = unlimited)
91-
pub max_memory_mb: usize, default = 0
92-
93-
/// Batch size for GPU processing
94-
pub batch_size: usize, default = 8192
9569
}
9670
}
9771

rust/sedona-functions/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ mod st_dwithin;
3636
pub mod st_envelope;
3737
pub mod st_envelope_aggr;
3838
pub mod st_flipcoordinates;
39+
mod st_geometryn;
3940
mod st_geometrytype;
4041
mod st_geomfromwkb;
4142
mod st_geomfromwkt;

rust/sedona-functions/src/register.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub fn default_function_set() -> FunctionSet {
7272
crate::st_dwithin::st_dwithin_udf,
7373
crate::st_envelope::st_envelope_udf,
7474
crate::st_flipcoordinates::st_flipcoordinates_udf,
75+
crate::st_geometryn::st_geometryn_udf,
7576
crate::st_geometrytype::st_geometry_type_udf,
7677
crate::st_geomfromwkb::st_geogfromwkb_udf,
7778
crate::st_geomfromwkb::st_geomfromwkb_udf,

rust/sedona-raster-functions/benches/native-raster-functions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ fn criterion_benchmark(c: &mut Criterion) {
2121
let f = sedona_raster_functions::register::default_function_set();
2222

2323
benchmark::scalar(c, &f, "native", "rs_height", Raster(64, 64));
24+
benchmark::scalar(c, &f, "native", "rs_scalex", Raster(64, 64));
25+
benchmark::scalar(c, &f, "native", "rs_scaley", Raster(64, 64));
26+
benchmark::scalar(c, &f, "native", "rs_skewx", Raster(64, 64));
27+
benchmark::scalar(c, &f, "native", "rs_skewy", Raster(64, 64));
28+
benchmark::scalar(c, &f, "native", "rs_upperleftx", Raster(64, 64));
29+
benchmark::scalar(c, &f, "native", "rs_upperlefty", Raster(64, 64));
2430
benchmark::scalar(c, &f, "native", "rs_width", Raster(64, 64));
2531
}
2632

rust/sedona-raster-functions/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
mod executor;
1919
pub mod register;
2020
pub mod rs_example;
21+
pub mod rs_geotransform;
2122
pub mod rs_size;

rust/sedona-raster-functions/src/register.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ pub fn default_function_set() -> FunctionSet {
3939
register_scalar_udfs!(
4040
function_set,
4141
crate::rs_example::rs_example_udf,
42+
crate::rs_geotransform::rs_scalex_udf,
43+
crate::rs_geotransform::rs_scaley_udf,
44+
crate::rs_geotransform::rs_skewx_udf,
45+
crate::rs_geotransform::rs_skewy_udf,
46+
crate::rs_geotransform::rs_upperleftx_udf,
47+
crate::rs_geotransform::rs_upperlefty_udf,
4248
crate::rs_size::rs_height_udf,
4349
crate::rs_size::rs_width_udf,
4450
);

rust/sedona-raster-functions/src/rs_size.rs

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn rs_width_doc() -> Documentation {
6262
"RS_Width(raster: Raster)".to_string(),
6363
)
6464
.with_argument("raster", "Raster: Input raster")
65-
.with_sql_example("SELECT RS_Width(raster)".to_string())
65+
.with_sql_example("SELECT RS_Width(RS_Example())".to_string())
6666
.build()
6767
}
6868

@@ -73,7 +73,7 @@ fn rs_height_doc() -> Documentation {
7373
"RS_Height(raster: Raster)".to_string(),
7474
)
7575
.with_argument("raster", "Raster: Input raster")
76-
.with_sql_example("SELECT RS_Height(raster)".to_string())
76+
.with_sql_example("SELECT RS_Height(RS_Example())".to_string())
7777
.build()
7878
}
7979

@@ -130,11 +130,13 @@ impl SedonaScalarKernel for RsSize {
130130
#[cfg(test)]
131131
mod tests {
132132
use super::*;
133-
use arrow_array::{Array, UInt64Array};
133+
use arrow_array::UInt64Array;
134134
use datafusion_expr::ScalarUDF;
135135
use rstest::rstest;
136136
use sedona_schema::datatypes::RASTER;
137+
use sedona_testing::compare::assert_array_equal;
137138
use sedona_testing::rasters::generate_test_rasters;
139+
use sedona_testing::testers::ScalarUdfTester;
138140

139141
#[test]
140142
fn udf_size() {
@@ -149,35 +151,21 @@ mod tests {
149151

150152
#[rstest]
151153
fn udf_invoke(#[values(SizeType::Width, SizeType::Height)] st: SizeType) {
152-
let kernel = RsSize {
153-
size_type: st.clone(),
154+
let udf = match st {
155+
SizeType::Height => rs_height_udf(),
156+
SizeType::Width => rs_width_udf(),
154157
};
155-
// 3 rasters, second one is null
156-
let rasters = generate_test_rasters(3, Some(1)).unwrap();
157-
158-
// Create the UDF and invoke it
159-
let args = [ColumnarValue::Array(Arc::new(rasters))];
160-
let arg_types = vec![RASTER];
161-
162-
let result = kernel.invoke_batch(&arg_types, &args).unwrap();
163-
164-
// Check the result
165-
if let ColumnarValue::Array(result_array) = result {
166-
let size_array = result_array.as_any().downcast_ref::<UInt64Array>().unwrap();
158+
let tester = ScalarUdfTester::new(udf.into(), vec![RASTER]);
167159

168-
assert_eq!(size_array.len(), 3);
160+
let rasters = generate_test_rasters(3, Some(1)).unwrap();
161+
let expected_values = match st {
162+
SizeType::Height => vec![Some(2), None, Some(4)],
163+
SizeType::Width => vec![Some(1), None, Some(3)],
164+
};
165+
let expected: Arc<dyn arrow_array::Array> = Arc::new(UInt64Array::from(expected_values));
169166

170-
match st.clone() {
171-
SizeType::Width => assert_eq!(size_array.value(0), 1), // First raster width
172-
SizeType::Height => assert_eq!(size_array.value(0), 2), // First raster height
173-
}
174-
assert!(size_array.is_null(1)); // Second raster is null
175-
match st.clone() {
176-
SizeType::Width => assert_eq!(size_array.value(2), 3), // Third raster width
177-
SizeType::Height => assert_eq!(size_array.value(2), 4), // Third raster height
178-
}
179-
} else {
180-
panic!("Expected array result");
181-
}
167+
// Check scalars
168+
let result = tester.invoke_array(Arc::new(rasters)).unwrap();
169+
assert_array_equal(&result, &expected);
182170
}
183171
}

0 commit comments

Comments
 (0)