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

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ authors = ["OpenVINO Project Developers"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/intel/openvino-rs"
# This is only necessary for use of `LazyLock` in `openvino-sys`.
rust-version = "1.80.0"

[workspace.dependencies]
openvino-sys = { path = "crates/openvino-sys", version = "=0.8.0" }
Expand Down
4 changes: 2 additions & 2 deletions crates/openvino-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
rust-version.workspace = true
readme = "README.md"
documentation = "https://docs.rs/openvino-sys"
keywords = ["openvino", "machine-learning", "ml", "neural-network"]
Expand All @@ -25,7 +26,6 @@ include = [
links = "openvino_c_api"

[dependencies]
once_cell = { version = "1.20", optional = true }
libloading = { version = "0.8", optional = true }
openvino-finder = { workspace = true }

Expand All @@ -38,7 +38,7 @@ env_logger = { workspace = true }
# - Will find and bind to an OpenVINO shared library at compile time.
dynamic-linking = []
# - Will bind to an OpenVINO shared library at runtime using `load`.
runtime-linking = ["libloading", "once_cell"]
runtime-linking = ["libloading"]

[package.metadata.docs.rs]
features = ["runtime-linking"]
6 changes: 2 additions & 4 deletions crates/openvino-sys/src/linking/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ macro_rules! link {
}
)+
) => (
use once_cell::sync::Lazy;
use libloading;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::RwLock;
use std::sync::{Arc, LazyLock, RwLock};

// Wrap the loaded functions.
#[derive(Debug)]
Expand All @@ -34,7 +32,7 @@ macro_rules! link {
}

// `LIBRARY` holds the shared library reference.
static LIBRARY: Lazy<RwLock<Option<Arc<SharedLibrary>>>> = Lazy::new(|| RwLock::new(None));
static LIBRARY: LazyLock<RwLock<Option<Arc<SharedLibrary>>>> = LazyLock::new(|| RwLock::new(None));

// Helper function for accessing the thread-local version of the library.
fn with_library<T, F>(f: F) -> Option<T>
Expand Down
1 change: 1 addition & 0 deletions crates/openvino/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
rust-version.workspace = true
readme = "README.md"
documentation = "https://docs.rs/openvino"
keywords = ["openvino", "machine-learning", "ml", "neural-network"]
Expand Down