Skip to content

Commit

Permalink
dbg
Browse files Browse the repository at this point in the history
  • Loading branch information
wejoncy committed Nov 4, 2024
1 parent 2e911d4 commit fb7042f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions objectivec/ort_coreml_execution_provider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ - (BOOL)appendCoreMLExecutionProviderWithOptions:(ORTCoreMLExecutionProviderOpti
(options.onlyEnableForDevicesWithANE ? COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE : 0) |
(options.onlyAllowStaticInputShapes ? COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES : 0) |
(options.createMLProgram ? COREML_FLAG_CREATE_MLPROGRAM : 0);
NSLog(@"333333333333333333333333333333333333333333");

try {
NSDictionary* provider_options = @{
@"coreml_flags" : [NSString stringWithFormat:@"%d", flags]
};
NSLog(@"33333333333333334444444444444444444");

return [self appendExecutionProvider:@"CoreML" providerOptions:provider_options error:error];
}
ORT_OBJC_API_IMPL_CATCH_RETURNING_BOOL(error);
Expand Down
6 changes: 4 additions & 2 deletions objectivec/ort_session.mm
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,16 @@ - (BOOL)appendExecutionProvider:(NSString*)providerName
providerOptions:(NSDictionary<NSString*, NSString*>*)providerOptions
error:(NSError**)error {
try {
NSLog(@"11111111111111111111");

std::unordered_map<std::string, std::string> options;
NSArray* keys = [providerOptions allKeys];

NSLog(@"22222222222222222");
for (NSString* key in keys) {
NSString* value = [providerOptions objectForKey:key];
options.emplace(key.UTF8String, value.UTF8String);
}

NSLog(@"66666666666666666666");
_sessionOptions->AppendExecutionProvider(providerName.UTF8String, options);
return YES;
}
Expand Down

0 comments on commit fb7042f

Please sign in to comment.