Skip to content

Commit

Permalink
fix: take EP string options by ref instead of cloning, closes #250
Browse files Browse the repository at this point in the history
silly mistake
  • Loading branch information
decahedron1 committed Aug 1, 2024
1 parent ecf76f9 commit 1692d11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/execution_providers/openvino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ impl ExecutionProvider for OpenVINOExecutionProvider {
let openvino_options = ort_sys::OrtOpenVINOProviderOptions {
device_type: self
.device_type
.clone()
.as_ref()
.map_or_else(std::ptr::null, |x| x.as_bytes().as_ptr().cast::<std::ffi::c_char>()),
device_id: self
.device_id
.clone()
.as_ref()
.map_or_else(std::ptr::null, |x| x.as_bytes().as_ptr().cast::<std::ffi::c_char>()),
num_of_threads: self.num_threads,
cache_dir: self
.cache_dir
.clone()
.as_ref()
.map_or_else(std::ptr::null, |x| x.as_bytes().as_ptr().cast::<std::ffi::c_char>()),
context: self.context,
enable_opencl_throttling: self.enable_opencl_throttling.into(),
Expand Down

0 comments on commit 1692d11

Please sign in to comment.