diff --git a/crates/openvino/src/core.rs b/crates/openvino/src/core.rs index 8958636..b3c7836 100644 --- a/crates/openvino/src/core.rs +++ b/crates/openvino/src/core.rs @@ -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, diff --git a/crates/openvino/src/network.rs b/crates/openvino/src/network.rs index 110409c..f337be1 100644 --- a/crates/openvino/src/network.rs +++ b/crates/openvino/src/network.rs @@ -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 { @@ -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 { diff --git a/crates/openvino/src/request.rs b/crates/openvino/src/request.rs index 516ed03..2862932 100644 --- a/crates/openvino/src/request.rs +++ b/crates/openvino/src/request.rs @@ -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<()> {