1 // 2 // Copyright © 2017 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include <HalInterfaces.h> 9 10 #include "../ArmnnDevice.hpp" 11 #include "ArmnnDriverImpl.hpp" 12 #include "HalPolicy.hpp" 13 #include "NamespaceAdaptor.hpp" 14 15 #include "../ArmnnDriverImpl.hpp" 16 17 #include <log/log.h> 18 19 namespace armnn_driver 20 { 21 namespace hal_1_0 22 { 23 24 class ArmnnDriver : public ArmnnDevice, public V1_0::IDevice 25 { 26 public: ArmnnDriver(DriverOptions options)27 ArmnnDriver(DriverOptions options) 28 : ArmnnDevice(std::move(options)) 29 { 30 ALOGV("hal_1_0::ArmnnDriver::ArmnnDriver()"); 31 } ~ArmnnDriver()32 ~ArmnnDriver() {} 33 34 public: getCapabilities(V1_0::IDevice::getCapabilities_cb cb)35 Return<void> getCapabilities(V1_0::IDevice::getCapabilities_cb cb) override 36 { 37 ALOGV("hal_1_0::ArmnnDriver::getCapabilities()"); 38 39 return hal_1_0::ArmnnDriverImpl::getCapabilities(m_Runtime, cb); 40 } 41 getSupportedOperations(const V1_0::Model & model,V1_0::IDevice::getSupportedOperations_cb cb)42 Return<void> getSupportedOperations(const V1_0::Model& model, 43 V1_0::IDevice::getSupportedOperations_cb cb) override 44 { 45 ALOGV("hal_1_0::ArmnnDriver::getSupportedOperations()"); 46 47 return armnn_driver::ArmnnDriverImpl<HalPolicy>::getSupportedOperations(m_Runtime, m_Options, model, cb); 48 } 49 prepareModel(const V1_0::Model & model,const android::sp<V1_0::IPreparedModelCallback> & cb)50 Return<V1_0::ErrorStatus> prepareModel(const V1_0::Model& model, 51 const android::sp<V1_0::IPreparedModelCallback>& cb) override 52 { 53 ALOGV("hal_1_0::ArmnnDriver::prepareModel()"); 54 55 return armnn_driver::ArmnnDriverImpl<HalPolicy>::prepareModel(m_Runtime, 56 m_ClTunedParameters, 57 m_Options, 58 model, 59 cb); 60 } 61 getStatus()62 Return<V1_0::DeviceStatus> getStatus() override 63 { 64 ALOGV("hal_1_0::ArmnnDriver::getStatus()"); 65 66 return armnn_driver::ArmnnDriverImpl<HalPolicy>::getStatus(); 67 } 68 }; 69 70 } // namespace hal_1_0 71 } // namespace armnn_driver 72