blob: b2808ebbc6d57fdd9ef3b7d4d8edabb770795e7f [file] [log] [blame]
Matteo Martincighe48bdff2018-09-03 13:50:50 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beck93e48982018-09-05 13:05:09 +01003// SPDX-License-Identifier: MIT
Matteo Martincighe48bdff2018-09-03 13:50:50 +01004//
5
6#pragma once
7
Matteo Martincighe48bdff2018-09-03 13:50:50 +01008#include "DriverOptions.hpp"
9
arovir01b0717b52018-09-05 17:03:25 +010010#include <HalInterfaces.h>
Matteo Martincighe48bdff2018-09-03 13:50:50 +010011
Matthew Bentham912b3622019-05-03 15:49:14 +010012namespace V1_0 = ::android::hardware::neuralnetworks::V1_0;
13
Matteo Martincighe48bdff2018-09-03 13:50:50 +010014namespace armnn_driver
15{
16
arovir01b0717b52018-09-05 17:03:25 +010017template<typename HalPolicy>
Matteo Martincighe48bdff2018-09-03 13:50:50 +010018class ArmnnDriverImpl
19{
20public:
arovir01b0717b52018-09-05 17:03:25 +010021 using HalModel = typename HalPolicy::Model;
22 using HalGetSupportedOperations_cb = typename HalPolicy::getSupportedOperations_cb;
Matteo Martincighe48bdff2018-09-03 13:50:50 +010023
Matteo Martincighe48bdff2018-09-03 13:50:50 +010024 static Return<void> getSupportedOperations(
25 const armnn::IRuntimePtr& runtime,
26 const DriverOptions& options,
27 const HalModel& model,
28 HalGetSupportedOperations_cb);
arovir01b0717b52018-09-05 17:03:25 +010029
Matteo Martincighe48bdff2018-09-03 13:50:50 +010030 static Return<ErrorStatus> prepareModel(
31 const armnn::IRuntimePtr& runtime,
32 const armnn::IGpuAccTunedParametersPtr& clTunedParameters,
33 const DriverOptions& options,
34 const HalModel& model,
Matthew Bentham912b3622019-05-03 15:49:14 +010035 const android::sp<V1_0::IPreparedModelCallback>& cb,
Matteo Martincighe48bdff2018-09-03 13:50:50 +010036 bool float32ToFloat16 = false);
arovir01b0717b52018-09-05 17:03:25 +010037
Matteo Martincighe48bdff2018-09-03 13:50:50 +010038 static Return<DeviceStatus> getStatus();
39};
40
41} // namespace armnn_driver