blob: 6cc29f3fe16e40ea3b92c0bcd699788ddc5b72fb [file] [log] [blame]
Francis Murtaghc4fb0dd2023-03-16 17:01:56 +00001//
2// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
Ryan OShea59f8f652023-05-11 20:37:53 +01005
6#include <armnn_delegate.hpp>
7
8namespace {
9
10 TfLiteOpaqueDelegate* ArmNNDelegateCreateFunc(const void* tflite_settings)
11 {
12 auto delegate = armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateCreate(tflite_settings);
13 return delegate;
14 }
15
16 void ArmNNDelegateDestroyFunc(TfLiteOpaqueDelegate* armnnDelegate)
17 {
18 armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateDelete(
19 armnnDelegate);
20 }
21
22 int ArmNNDelegateErrnoFunc(TfLiteOpaqueDelegate* sample_stable_delegate)
23 {
24 return 0;
25 }
26
27 const TfLiteOpaqueDelegatePlugin armnn_delegate_plugin = {
28 ArmNNDelegateCreateFunc, ArmNNDelegateDestroyFunc,
29 ArmNNDelegateErrnoFunc};
30
31 const TfLiteStableDelegate armnn_delegate = {
32 /*delegate_abi_version=*/ TFL_STABLE_DELEGATE_ABI_VERSION,
33 /*delegate_name=*/ "armnn_delegate",
34 /*delegate_version=*/ OPAQUE_DELEGATE_VERSION,
35 /*delegate_plugin=*/ &armnn_delegate_plugin
36 };
37
38} // namespace
39
40/**
41 * The ArmNN delegate to be loaded dynamically
42 */
43extern "C" const TfLiteStableDelegate TFL_TheStableDelegate = armnn_delegate;