Copy objectivec/ from ORT v1.20.

This commit is contained in:
edgchen1
2024-11-26 09:38:56 -08:00
parent bbc428e168
commit 5d78f490a6
2 changed files with 5 additions and 1 deletions
@@ -29,7 +29,10 @@ NS_ASSUME_NONNULL_BEGIN
* Whether the CoreML execution provider should run on CPU only. * Whether the CoreML execution provider should run on CPU only.
*/ */
@property BOOL useCPUOnly; @property BOOL useCPUOnly;
/**
* exclude ANE in CoreML.
*/
@property BOOL useCPUAndGPU;
/** /**
* Whether the CoreML execution provider is enabled on subgraphs. * Whether the CoreML execution provider is enabled on subgraphs.
*/ */
@@ -25,6 +25,7 @@ BOOL ORTIsCoreMLExecutionProviderAvailable() {
try { try {
const uint32_t flags = const uint32_t flags =
(options.useCPUOnly ? COREML_FLAG_USE_CPU_ONLY : 0) | (options.useCPUOnly ? COREML_FLAG_USE_CPU_ONLY : 0) |
(options.useCPUAndGPU ? COREML_FLAG_USE_CPU_AND_GPU : 0) |
(options.enableOnSubgraphs ? COREML_FLAG_ENABLE_ON_SUBGRAPH : 0) | (options.enableOnSubgraphs ? COREML_FLAG_ENABLE_ON_SUBGRAPH : 0) |
(options.onlyEnableForDevicesWithANE ? COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE : 0) | (options.onlyEnableForDevicesWithANE ? COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE : 0) |
(options.onlyAllowStaticInputShapes ? COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES : 0) | (options.onlyAllowStaticInputShapes ? COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES : 0) |