@@ -44,12 +44,14 @@ The CoreML EP must be explicitly registered when creating the inference session.
4444``` C++
4545Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
4646Ort::SessionOptions so;
47- so.AppendExecutionProvider("CoreML", {{"MLComputeUnits", std::to_string("MLProgram")}});
47+ std::unordered_map<std::string, std::string> provider_options;
48+ provider_options[ "ModelFormat"] = std::to_string("MLProgram");
49+ so.AppendExecutionProvider("CoreML", provider_options);
4850Ort::Session session(env, model_path, so);
4951```
5052
51- > [!WARNING]
52- > Deprecated APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
53+
54+ ** Deprecated** APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
5355```C++
5456Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
5557Ort::SessionOptions so;
@@ -66,8 +68,11 @@ To use the CoreML EP run time options, create an unsigned integer representing t
6668
6769ProviderOptions can be set by passing the unsigned integer to the ` AppendExecutionProvider ` method.
6870``` c++
69- std::unordered_map<std::string, std::string> provider_options =
70- {{"MLComputeUnits", std::to_string("MLProgram")}};
71+ std::unordered_map<std::string, std::string> provider_options;
72+ provider_options[" ModelFormat" ] = std::to_string(" MLProgram" );
73+ provider_options[" MLComputeUnits" ] = std::to_string(" ALL" );
74+ provider_options[" RequireStaticInputShapes" ] = std::to_string(" 0" );
75+ provider_options[" EnableOnSubgraphs" ] = std::to_string(" 0" );
7176```
7277### Available Options (New API)
7378` ModelFormat ` can be one of the following values:
@@ -91,8 +96,6 @@ std::unordered_map<std::string, std::string> provider_options =
9196
9297
9398## Configuration Options (Old API)
94- > [!WARNING]
95- > It's deprecated
9699```
97100uint32_t coreml_flags = 0;
98101coreml_flags |= COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE;
0 commit comments