Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit 0309117

Browse files
committed
Add support for CoreML
1 parent d61a22d commit 0309117

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

OnnxStack.Core/Config/ExecutionProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public enum ExecutionProvider
44
{
55
DirectML = 0,
66
Cuda = 1,
7-
Cpu = 2
7+
Cpu = 2,
8+
CoreML = 3
89
}
910
}

OnnxStack.Core/Extensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public static SessionOptions GetSessionOptions(this OnnxStackConfig configuratio
3838
sessionOptions.AppendExecutionProvider_CUDA(configuration.DeviceId);
3939
sessionOptions.AppendExecutionProvider_CPU();
4040
return sessionOptions;
41+
case ExecutionProvider.CoreML:
42+
sessionOptions.AppendExecutionProvider_CoreML(
43+
CoreMLFlags.COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE
44+
);
45+
return sessionOptions;
4146
}
4247
}
4348

0 commit comments

Comments
 (0)