mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
### Description <!-- Describe your changes. --> Add Swift Package Manager (SPM) support for ORT based on #14621 - uses the existing objective-c bindings - some re-organization of the directory structure was required but the contents of the files are unchanged, apart from adjustments due to file movements Add tool for updating ORT native pod used in the SPM package Update CIs to use ORT native pod from build, and build/test using SPM ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> iOS developers are using SPM as much as cocoapods, so adding SPM means both are catered for.
31 lines
864 B
Text
31 lines
864 B
Text
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#import "ort_xnnpack_execution_provider.h"
|
|
|
|
#import "cxx_api.h"
|
|
#import "error_utils.h"
|
|
#import "ort_session_internal.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@implementation ORTXnnpackExecutionProviderOptions
|
|
|
|
@end
|
|
|
|
@implementation ORTSessionOptions (ORTSessionOptionsXnnpackEP)
|
|
|
|
- (BOOL)appendXnnpackExecutionProviderWithOptions:(ORTXnnpackExecutionProviderOptions*)options
|
|
error:(NSError**)error {
|
|
try {
|
|
NSDictionary* provider_options = @{
|
|
@"intra_op_num_threads" : [NSString stringWithFormat:@"%d", options.intra_op_num_threads]
|
|
};
|
|
return [self appendExecutionProvider:@"XNNPACK" providerOptions:provider_options error:error];
|
|
}
|
|
ORT_OBJC_API_IMPL_CATCH_RETURNING_BOOL(error);
|
|
}
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|