algeon-datafusion 0.1.2

DataFusion physical-plan adapter for native GPU execution.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::{Arc, OnceLock};

use tokio::sync::{OwnedSemaphorePermit, Semaphore};

static SERIAL: OnceLock<Arc<Semaphore>> = OnceLock::new();

fn semaphore() -> Arc<Semaphore> {
    Arc::clone(SERIAL.get_or_init(|| Arc::new(Semaphore::new(1))))
}

pub(crate) async fn lock_async() -> OwnedSemaphorePermit {
    semaphore().acquire_owned().await.expect("GPU fixture semaphore remains open")
}