Skip to content
Open
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
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions datafusion/bio-function-ranges/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ repository.workspace = true
homepage.workspace = true
edition.workspace = true

[features]
default = []
apple-gpu = [
"dep:objc2",
"dep:objc2-foundation",
"dep:objc2-metal",
]

[dependencies]
datafusion = { workspace = true }
tokio = { workspace = true }
Expand All @@ -21,6 +29,23 @@ rust-lapper = "1.1.0"
superintervals = { path = "superintervals" }
parking_lot = "0.12.3"

[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.6.4", optional = true }
objc2-foundation = { version = "0.3.2", optional = true, features = ["NSError", "NSString"] }
objc2-metal = { version = "0.3.2", optional = true, default-features = false, features = [
"MTLAllocation",
"MTLBuffer",
"MTLCommandBuffer",
"MTLCommandEncoder",
"MTLCommandQueue",
"MTLComputeCommandEncoder",
"MTLComputePipeline",
"MTLDevice",
"MTLLibrary",
"MTLResource",
"MTLTypes",
] }

[dev-dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
rstest = "0.26.1"
10 changes: 10 additions & 0 deletions datafusion/bio-function-ranges/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ Counts overlapping intervals. Same interface as `coverage`, but returns the coun
SELECT * FROM count_overlaps('reads', 'targets')
```

When built with the `apple-gpu` Cargo feature on macOS, `count_overlaps` can use an Apple Metal endpoint-rank backend:

```sql
SET bio.count_overlaps_backend = auto; -- default
SET bio.count_overlaps_backend = cpu;
SET bio.count_overlaps_backend = apple_gpu;
```

`auto` keeps the CPU COITree backend for small inputs and currently tries the Apple GPU backend for large non-coverage `count_overlaps` workloads when the collected left side has at least 5M intervals. If Metal initialization fails before output is emitted, execution falls back to CPU.

### `nearest(left_table, right_table [, k] [, overlap] [, columns...] [, filter_op])`

Returns up to `k` nearest left intervals for each right interval.
Expand Down
Loading
Loading