Skip to content

Commit 53ab51d

Browse files
Do not error if EP is not avaliable, include more eps in cargo.toml
1 parent 2da4c1a commit 53ab51d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

native/ortex/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ resolver = "2"
1515
[dependencies]
1616
rustler = "0.36.2"
1717
ort-sys = { version = "=2.0.0-rc.10", default-features = false }
18-
ort = { version = "2.0.0-rc.10", features = ["half", "cuda"] }
18+
ort = { version = "2.0.0-rc.10", features = [
19+
"half",
20+
"cuda",
21+
"tensorrt",
22+
"directml",
23+
"coreml"
24+
] }
1925
ndarray = "0.16.1"
2026
half = "2.6.0"
2127
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

native/ortex/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use ndarray::{ArrayViewMut, Ix, IxDyn};
77

88
use ndarray::ShapeError;
99

10-
use rustler::ResourceArc;
1110
use rustler::types::Binary;
11+
use rustler::ResourceArc;
1212
use rustler::{Atom, Env, NifResult};
1313

1414
use ort::execution_providers::ExecutionProviderDispatch;
@@ -96,7 +96,7 @@ pub fn map_eps(env: rustler::env::Env, eps: Vec<Atom>) -> Vec<ExecutionProviderD
9696
eps.iter()
9797
.map(|e| match &e.to_term(env).atom_to_string().unwrap()[..] {
9898
CPU => ort::execution_providers::cpu::CPUExecutionProvider::default().build(),
99-
CUDA => ort::execution_providers::cuda::CUDAExecutionProvider::default().build().error_on_failure(),
99+
CUDA => ort::execution_providers::cuda::CUDAExecutionProvider::default().build(),
100100
TENSORRT => {
101101
ort::execution_providers::tensorrt::TensorRTExecutionProvider::default().build()
102102
}

0 commit comments

Comments
 (0)