blob: 97613118e0f9d32a7ca27c0d6104623e0da91dfd [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 Martincigh79250ab2018-09-04 16:28:10 +010011#include "ArmnnDriverImpl.hpp"
Matteo Martincighe48bdff2018-09-03 13:50:50 +010012#include "../ArmnnDriverImpl.hpp"
telsoa01ce3e84a2018-08-31 09:31:35 +010013
14#include <log/log.h>
15
16namespace armnn_driver
17{
18namespace V1_0
19{
20
21class ArmnnDriver : public ArmnnDevice, public ::android::hardware::neuralnetworks::V1_0::IDevice
22{
23public:
24 ArmnnDriver(DriverOptions options)
25 : ArmnnDevice(std::move(options))
26 {
27 ALOGV("V1_0::ArmnnDriver::ArmnnDriver()");
28 }
29 ~ArmnnDriver() {}
30
31public:
32 Return<void> getCapabilities(
Matteo Martincighe48bdff2018-09-03 13:50:50 +010033 ::android::hardware::neuralnetworks::V1_0::IDevice::getCapabilities_cb cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010034 {
35 ALOGV("V1_0::ArmnnDriver::getCapabilities()");
36
Matteo Martincigh79250ab2018-09-04 16:28:10 +010037 return V1_0::ArmnnDriverImpl::getCapabilities(m_Runtime,
38 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010039 }
40
41 Return<void> getSupportedOperations(
42 const ::android::hardware::neuralnetworks::V1_0::Model& model,
Matteo Martincighe48bdff2018-09-03 13:50:50 +010043 ::android::hardware::neuralnetworks::V1_0::IDevice::getSupportedOperations_cb cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010044 {
45 ALOGV("V1_0::ArmnnDriver::getSupportedOperations()");
46
Matteo Martincighe48bdff2018-09-03 13:50:50 +010047 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::getSupportedOperations(m_Runtime,
48 m_Options,
49 model,
50 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010051 }
52
53 Return<ErrorStatus> prepareModel(
54 const ::android::hardware::neuralnetworks::V1_0::Model& model,
Matteo Martincighe48bdff2018-09-03 13:50:50 +010055 const android::sp<IPreparedModelCallback>& cb) override
telsoa01ce3e84a2018-08-31 09:31:35 +010056 {
57 ALOGV("V1_0::ArmnnDriver::prepareModel()");
58
Matteo Martincighe48bdff2018-09-03 13:50:50 +010059 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::prepareModel(m_Runtime,
60 m_ClTunedParameters,
61 m_Options,
62 model,
63 cb);
telsoa01ce3e84a2018-08-31 09:31:35 +010064 }
65
Matteo Martincighe48bdff2018-09-03 13:50:50 +010066 Return<DeviceStatus> getStatus() override
telsoa01ce3e84a2018-08-31 09:31:35 +010067 {
68 ALOGV("V1_0::ArmnnDriver::getStatus()");
69
Matteo Martincighe48bdff2018-09-03 13:50:50 +010070 return armnn_driver::ArmnnDriverImpl<HalVersion_1_0>::getStatus();
telsoa01ce3e84a2018-08-31 09:31:35 +010071 }
72};
73
74} // armnn_driver::namespace V1_0
75} // namespace armnn_driver