2021-05-11 17:34:40 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
export * from 'onnxruntime-common';
|
2024-08-14 23:51:22 +00:00
|
|
|
import { registerBackend, env } from 'onnxruntime-common';
|
|
|
|
|
import { Platform } from 'react-native';
|
|
|
|
|
import { onnxruntimeBackend } from './backend';
|
|
|
|
|
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
|
|
|
|
2024-08-14 23:51:22 +00:00
|
|
|
Object.defineProperty(env.versions, 'react-native', { value: version, enumerable: true });
|