HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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;
12
enum
COREMLFlags
{
13
COREML_FLAG_USE_NONE
= 0x000,
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
17
COREML_FLAG_USE_CPU_ONLY
= 0x001,
18
19
// Enable CoreML EP on subgraph
20
COREML_FLAG_ENABLE_ON_SUBGRAPH
= 0x002,
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
25
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE
= 0x004,
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.
29
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES
= 0x008,
30
31
// Keep COREML_FLAG_LAST at the end of the enum definition
32
// And assign the last COREMLFlag to it
33
COREML_FLAG_LAST
=
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES
,
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
COREML_FLAG_LAST
Definition:
coreml_provider_factory.h:33
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES
Definition:
coreml_provider_factory.h:29
COREML_FLAG_USE_CPU_ONLY
Definition:
coreml_provider_factory.h:17
COREML_FLAG_USE_NONE
Definition:
coreml_provider_factory.h:13
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE
Definition:
coreml_provider_factory.h:25
COREMLFlags
COREMLFlags
Definition:
coreml_provider_factory.h:12
COREML_FLAG_ENABLE_ON_SUBGRAPH
Definition:
coreml_provider_factory.h:20
ORT_API_STATUS
ORT_EXPORT ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CoreML, _In_ OrtSessionOptions *options, uint32_t coreml_flags)
onnxruntime
core
providers
coreml
coreml_provider_factory.h
Generated on Tue Dec 17 2024 03:40:02 for HDK by
1.8.6