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
// Keep COREML_FLAG_MAX at the end of the enum definition
28
// And assign the last COREMLFlag to it
29
COREML_FLAG_LAST
=
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE
,
30
};
31
32
#ifdef __cplusplus
33
extern
"C"
{
34
#endif
35
36
ORT_EXPORT
ORT_API_STATUS
(OrtSessionOptionsAppendExecutionProvider_CoreML,
37
_In_
OrtSessionOptions* options, uint32_t coreml_flags);
38
39
#ifdef __cplusplus
40
}
41
#endif
_In_
#define _In_
Definition:
onnxruntime_c_api.h:42
COREML_FLAG_LAST
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_EXPORT
#define ORT_EXPORT
Definition:
onnxruntime_c_api.h:84
ORT_API_STATUS
ORT_EXPORT ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CoreML, _In_ OrtSessionOptions *options, uint32_t coreml_flags)
onnxruntime_c_api.h
onnxruntime
core
providers
coreml
coreml_provider_factory.h
Generated on Thu May 9 2024 03:15:04 for HDK by
1.8.6