blob: 0db5592e5cdb7d7ba60bdbfca29f6fee1765f40e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From d04e167f9081a3ec8c49f0967b5b0cec79e40e4d Mon Sep 17 00:00:00 2001
From: Raphael Robatsch <raphael-git@tapesoftware.net>
Date: Fri, 14 Oct 2022 16:55:36 +0200
Subject: [PATCH] unix: use CPU backend instead of DirectML
---
src/background-filter.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/background-filter.cpp b/src/background-filter.cpp
index 32c6483..55e838f 100644
--- a/src/background-filter.cpp
+++ b/src/background-filter.cpp
@@ -205,10 +205,14 @@ static void createOrtSession(struct background_removal_filter *tf) {
if (tf->useGPU == USEGPU_CUDA) {
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CUDA(sessionOptions, 0));
}
-#else
+#elseif _WIN32
if (tf->useGPU == USEGPU_DML) {
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_DML(sessionOptions, 0));
}
+#else
+ if (tf->useGPU == USEGPU_CPU) {
+ Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CPU(sessionOptions, 0));
+ }
#endif
tf->session.reset(new Ort::Session(*tf->env, tf->modelFilepath, sessionOptions));
} catch (const std::exception& e) {
--
2.37.3
|