mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-05 04:17:53 +00:00
### Description <!-- Describe your changes. --> ### 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. --> Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
31 lines
876 B
Text
31 lines
876 B
Text
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#import "ort_xnnpack_execution_provider.h"
|
|
|
|
#import "src/cxx_api.h"
|
|
#import "src/error_utils.h"
|
|
#import "src/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
|