2021-05-11 17:34:40 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
export * from 'onnxruntime-common';
|
2023-06-09 23:18:53 +00:00
|
|
|
import {registerBackend, env} from 'onnxruntime-common';
|
2023-06-16 09:38:41 +00:00
|
|
|
import {Platform} from 'react-native';
|
2021-05-11 17:34:40 +00:00
|
|
|
import {onnxruntimeBackend} from './backend';
|
2023-06-09 23:18:53 +00:00
|
|
|
import {version} from './version';
|
2021-05-11 17:34:40 +00:00
|
|
|
|
|
|
|
|
registerBackend('cpu', onnxruntimeBackend, 1);
|
2023-06-16 09:38:41 +00:00
|
|
|
registerBackend('xnnpack', onnxruntimeBackend, 1);
|
|
|
|
|
if (Platform.OS === 'android') {
|
|
|
|
|
registerBackend('nnapi', onnxruntimeBackend, 1);
|
|
|
|
|
} else if (Platform.OS === 'ios') {
|
|
|
|
|
registerBackend('coreml', onnxruntimeBackend, 1);
|
|
|
|
|
}
|
2023-06-09 23:18:53 +00:00
|
|
|
|
|
|
|
|
env.versions['react-native'] = version;
|