From e48bdff741568236d3c0747ad3d18a8eba5b36dd Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Mon, 3 Sep 2018 13:50:50 +0100 Subject: IVGCVSW-1806 Refactored Android-NN-Driver, added common "getCapabilities", "getSupportedOperations" and "prepareModel" implementations * Added common base ArmnnDriverImpl class * Added common template implementation of the driver's "getCapabilities", "getSupportedOperations" and "prepareModel" methods * Refactored ArmnnPreparedModel and RequestThread to support HAL v1.1 models * Moved "getStatus" to the common base class, as it is shared by both HAL implementations * Refactored the code where necessary Change-Id: I747334730026d63b4002662523fb93608f67c899 --- 1.0/ArmnnDriver.hpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to '1.0/ArmnnDriver.hpp') diff --git a/1.0/ArmnnDriver.hpp b/1.0/ArmnnDriver.hpp index 83484ca9..18e25968 100644 --- a/1.0/ArmnnDriver.hpp +++ b/1.0/ArmnnDriver.hpp @@ -7,8 +7,8 @@ #include -#include "ArmnnDriverImpl.hpp" #include "ArmnnDevice.hpp" +#include "../ArmnnDriverImpl.hpp" #include @@ -29,36 +29,44 @@ public: public: Return getCapabilities( - ::android::hardware::neuralnetworks::V1_0::IDevice::getCapabilities_cb cb) + ::android::hardware::neuralnetworks::V1_0::IDevice::getCapabilities_cb cb) override { ALOGV("V1_0::ArmnnDriver::getCapabilities()"); - return ArmnnDriverImpl::getCapabilities(m_Runtime, cb); + return armnn_driver::ArmnnDriverImpl::getCapabilities(m_Runtime, + cb); } Return getSupportedOperations( const ::android::hardware::neuralnetworks::V1_0::Model& model, - ::android::hardware::neuralnetworks::V1_0::IDevice::getSupportedOperations_cb cb) + ::android::hardware::neuralnetworks::V1_0::IDevice::getSupportedOperations_cb cb) override { ALOGV("V1_0::ArmnnDriver::getSupportedOperations()"); - return ArmnnDriverImpl::getSupportedOperations(m_Runtime, m_Options, model, cb); + return armnn_driver::ArmnnDriverImpl::getSupportedOperations(m_Runtime, + m_Options, + model, + cb); } Return prepareModel( const ::android::hardware::neuralnetworks::V1_0::Model& model, - const android::sp& cb) + const android::sp& cb) override { ALOGV("V1_0::ArmnnDriver::prepareModel()"); - return ArmnnDriverImpl::prepareModel(m_Runtime, m_ClTunedParameters, m_Options, model, cb); + return armnn_driver::ArmnnDriverImpl::prepareModel(m_Runtime, + m_ClTunedParameters, + m_Options, + model, + cb); } - Return getStatus() + Return getStatus() override { ALOGV("V1_0::ArmnnDriver::getStatus()"); - return ArmnnDriverImpl::getStatus(); + return armnn_driver::ArmnnDriverImpl::getStatus(); } }; -- cgit v1.2.1