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
2 changes: 2 additions & 0 deletions crates/openvino/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct Core {
}
drop_using_function!(Core, ie_core_free);

unsafe impl Send for Core {}

impl Core {
/// Construct a new OpenVINO [`Core`]--this is the primary entrypoint for constructing and using
/// inference networks. Because this function may load OpenVINO's shared libraries at runtime,
Expand Down
5 changes: 5 additions & 0 deletions crates/openvino/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pub struct CNNNetwork {
}
drop_using_function!(CNNNetwork, ie_network_free);

unsafe impl Send for CNNNetwork {}
unsafe impl Sync for CNNNetwork {}

impl CNNNetwork {
/// Retrieve the number of network inputs.
pub fn get_inputs_len(&self) -> Result<usize> {
Expand Down Expand Up @@ -116,6 +119,8 @@ pub struct ExecutableNetwork {
}
drop_using_function!(ExecutableNetwork, ie_exec_network_free);

unsafe impl Send for ExecutableNetwork {}

impl ExecutableNetwork {
/// Create an [`InferRequest`].
pub fn create_infer_request(&mut self) -> Result<InferRequest> {
Expand Down
3 changes: 3 additions & 0 deletions crates/openvino/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub struct InferRequest {
}
drop_using_function!(InferRequest, ie_infer_request_free);

unsafe impl Send for InferRequest {}
unsafe impl Sync for InferRequest {}

impl InferRequest {
/// Set the batch size of the inference requests.
pub fn set_batch_size(&mut self, size: usize) -> Result<()> {
Expand Down