blob: cdff90544c462f89427687862973be8651dee285 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include "DriverOptions.hpp"
#include <HalInterfaces.h>
#ifdef ARMNN_ANDROID_R
using namespace android::nn::hal;
#endif
namespace V1_0 = ::android::hardware::neuralnetworks::V1_0;
namespace V1_1 = ::android::hardware::neuralnetworks::V1_1;
#ifdef ARMNN_ANDROID_NN_V1_2 // Using ::android::hardware::neuralnetworks::V1_2
namespace V1_2 = ::android::hardware::neuralnetworks::V1_2;
#endif
#ifdef ARMNN_ANDROID_NN_V1_3 // Using ::android::hardware::neuralnetworks::V1_3
namespace V1_2 = ::android::hardware::neuralnetworks::V1_2;
namespace V1_3 = ::android::hardware::neuralnetworks::V1_3;
#endif
namespace armnn_driver
{
template <typename Callback, typename Context>
struct CallbackContext
{
Callback callback;
Context ctx;
};
template<typename HalPolicy>
class ArmnnDriverImpl
{
public:
using HalModel = typename HalPolicy::Model;
using HalGetSupportedOperations_cb = typename HalPolicy::getSupportedOperations_cb;
using HalErrorStatus = typename HalPolicy::ErrorStatus;
static Return<void> getSupportedOperations(
const armnn::IRuntimePtr& runtime,
const DriverOptions& options,
const HalModel& model,
HalGetSupportedOperations_cb);
static Return<V1_0::ErrorStatus> prepareModel(
const armnn::IRuntimePtr& runtime,
const armnn::IGpuAccTunedParametersPtr& clTunedParameters,
const DriverOptions& options,
const HalModel& model,
const android::sp<V1_0::IPreparedModelCallback>& cb,
bool float32ToFloat16 = false);
static Return<DeviceStatus> getStatus();
};
} // namespace armnn_driver
|