HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
coreml_provider_factory.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 #pragma once
4 
5 #include "onnxruntime_c_api.h"
6 
7 // COREMLFlags are bool options we want to set for CoreML EP
8 // This enum is defined as bit flags, and cannot have negative value
9 // To generate an uint32_t coreml_flags for using with OrtSessionOptionsAppendExecutionProvider_CoreML below,
10 // uint32_t coreml_flags = 0;
11 // coreml_flags |= COREML_FLAG_USE_CPU_ONLY;
14 
15  // Using CPU only in CoreML EP, this may decrease the perf but will provide
16  // reference output value without precision loss, which is useful for validation
18 
19  // Enable CoreML EP on subgraph
21 
22  // By default CoreML Execution provider will be enabled for all compatible Apple devices
23  // Enable this option will only enable CoreML EP for Apple devices with ANE (Apple Neural Engine)
24  // Please note, enable this option does not guarantee the entire model to be executed using ANE only
26 
27  // Only allow CoreML EP to take nodes with inputs with static shapes. By default it will also allow inputs with
28  // dynamic shapes. However, the performance may be negatively impacted if inputs have dynamic shapes.
30 
31  // Keep COREML_FLAG_LAST at the end of the enum definition
32  // And assign the last COREMLFlag to it
34 };
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 ORT_EXPORT ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CoreML,
41  _In_ OrtSessionOptions* options, uint32_t coreml_flags);
42 
43 #ifdef __cplusplus
44 }
45 #endif
ORT_EXPORT ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CoreML, _In_ OrtSessionOptions *options, uint32_t coreml_flags)