blob: 18e2596848b64edc07e75744c9506832e680eb1c [file] [log] [blame]
telsoa01ce3e84a2018-08-31 09:31:35 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#pragma once
7
8#include <HalInterfaces.h>
9
telsoa01ce3e84a2018-08-31 09:31:35 +010010#include "ArmnnDevice.hpp"
Matteo Martincighe48bdff2018-09-03 13:50:50 +010011#include "../ArmnnDriverImpl.hpp"
telsoa01ce3e84a2018-08-31 09:31:35 +010012
13#include <log/log.h>
14
15namespace armnn_driver
16{
17namespace V1_0
18{
19
20class ArmnnDriver : public ArmnnDevice, public ::android::hardware::neuralnetworks::V1_0::IDevice
21{
22public:
23 ArmnnDriver(DriverOptions options)
24 : ArmnnDevice(std::move(options))
25 {
26 ALOGV("V1_0::ArmnnDriver::ArmnnDriver()");
27 }
28 ~ArmnnDriver() {}
29
30public:
31 Return<void> getCapabilities(
Matteo Martincighe48bdff2018-09-03 13:50:50 +010032 ::android::hardware::neuralnetworks::V1_0::IDevice::getCapabilities_cb cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010033 {
34 ALOGV("V1_0::ArmnnDriver::getCapabilities()");
35
Matteo Martincighe48bdff2018-09-03 13:50:50 +010036 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::getCapabilities(m_Runtime,
37 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010038 }
39
40 Return<void> getSupportedOperations(
41 const ::android::hardware::neuralnetworks::V1_0::Model& model,
Matteo Martincighe48bdff2018-09-03 13:50:50 +010042 ::android::hardware::neuralnetworks::V1_0::IDevice::getSupportedOperations_cb cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010043 {
44 ALOGV("V1_0::ArmnnDriver::getSupportedOperations()");
45
Matteo Martincighe48bdff2018-09-03 13:50:50 +010046 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::getSupportedOperations(m_Runtime,
47 m_Options,
48 model,
49 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010050 }
51
52 Return<ErrorStatus> prepareModel(
53 const ::android::hardware::neuralnetworks::V1_0::Model& model,
Matteo Martincighe48bdff2018-09-03 13:50:50 +010054 const android::sp<IPreparedModelCallback>& cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010055 {
56 ALOGV("V1_0::ArmnnDriver::prepareModel()");
57
Matteo Martincighe48bdff2018-09-03 13:50:50 +010058 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::prepareModel(m_Runtime,
59 m_ClTunedParameters,
60 m_Options,
61 model,
62 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010063 }
64
Matteo Martincighe48bdff2018-09-03 13:50:50 +010065 Return<DeviceStatus> getStatus() override
telsoa01ce3e84a2018-08-31 09:31:35 +010066 {
67 ALOGV("V1_0::ArmnnDriver::getStatus()");
68
Matteo Martincighe48bdff2018-09-03 13:50:50 +010069 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::getStatus();
telsoa01ce3e84a2018-08-31 09:31:35 +010070 }
71};
72
73} // armnn_driver::namespace V1_0
74} // namespace armnn_driver