From ec1e5b8d0a0eeba7eae0f1fdb5e32c72f8a8093c Mon Sep 17 00:00:00 2001 From: Kevin May Date: Wed, 26 Feb 2020 17:00:39 +0000 Subject: IVGCVSW-4473 Android R pre Hal 1_3 build changes * Update ErrorStatus to V1_0::ErrorStatus * Update Request to V1_0::Request * Update OperandType to V1_2::OperandType * Add namespace android::nn::hal in ArmnnDriverImpl for R only * Add missing g_RelaxedFloat32toFloat16PerformancePowerUsageName * Add namespace V1_0 or V1_1 where necessary * Update Android.mk with R macro and android.hardware.neuralnetworks@1.3 * Remove androidnn.go * include IAllocator in DriverTestHelpers * Remove unused LOCAL_CFLAGS Signed-off-by: Kevin May Change-Id: I1787f1ed6784b3bbec017536d87d49197405e853 Signed-off-by: Kevin May --- 1.2/ArmnnDriver.hpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to '1.2/ArmnnDriver.hpp') diff --git a/1.2/ArmnnDriver.hpp b/1.2/ArmnnDriver.hpp index 177cab63..6dba2e9a 100644 --- a/1.2/ArmnnDriver.hpp +++ b/1.2/ArmnnDriver.hpp @@ -29,6 +29,7 @@ namespace hal_1_2 class ArmnnDriver : public ArmnnDevice, public V1_2::IDevice { public: + ArmnnDriver(DriverOptions options) : ArmnnDevice(std::move(options)) { @@ -57,8 +58,8 @@ public: cb); } - Return prepareModel(const V1_0::Model& model, - const android::sp& cb) override + Return prepareModel(const V1_0::Model& model, + const android::sp& cb) override { ALOGV("hal_1_2::ArmnnDriver::prepareModel()"); @@ -86,9 +87,9 @@ public: cb); } - Return prepareModel_1_1(const V1_1::Model& model, - V1_1::ExecutionPreference preference, - const android::sp& cb) override + Return prepareModel_1_1(const V1_1::Model& model, + V1_1::ExecutionPreference preference, + const android::sp& cb) override { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_1()"); @@ -97,8 +98,8 @@ public: preference == ExecutionPreference::SUSTAINED_SPEED)) { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_1: Invalid execution preference"); - cb->notify(ErrorStatus::INVALID_ARGUMENT, nullptr); - return ErrorStatus::INVALID_ARGUMENT; + cb->notify(V1_0::ErrorStatus::INVALID_ARGUMENT, nullptr); + return V1_0::ErrorStatus::INVALID_ARGUMENT; } return armnn_driver::ArmnnDriverImpl::prepareModel(m_Runtime, @@ -121,7 +122,7 @@ public: { ALOGV("hal_1_2::ArmnnDriver::getVersionString()"); - cb(ErrorStatus::NONE, "ArmNN"); + cb(V1_0::ErrorStatus::NONE, "ArmNN"); return Void(); } @@ -129,22 +130,22 @@ public: { ALOGV("hal_1_2::ArmnnDriver::getType()"); - cb(ErrorStatus::NONE, V1_2::DeviceType::CPU); + cb(V1_0::ErrorStatus::NONE, V1_2::DeviceType::CPU); return Void(); } - Return prepareModelFromCache( + Return prepareModelFromCache( const android::hardware::hidl_vec&, const android::hardware::hidl_vec&, const HidlToken&, const sp& callback) { ALOGV("hal_1_2::ArmnnDriver::prepareModelFromCache()"); - callback->notify_1_2(ErrorStatus::GENERAL_FAILURE, nullptr); - return ErrorStatus::GENERAL_FAILURE; + callback->notify_1_2(V1_0::ErrorStatus::GENERAL_FAILURE, nullptr); + return V1_0::ErrorStatus::GENERAL_FAILURE; } - Return prepareModel_1_2(const V1_2::Model& model, V1_1::ExecutionPreference preference, + Return prepareModel_1_2(const V1_2::Model& model, V1_1::ExecutionPreference preference, const android::hardware::hidl_vec&, const android::hardware::hidl_vec&, const HidlToken&, const android::sp& cb) @@ -156,8 +157,8 @@ public: preference == ExecutionPreference::SUSTAINED_SPEED)) { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_2: Invalid execution preference"); - cb->notify(ErrorStatus::INVALID_ARGUMENT, nullptr); - return ErrorStatus::INVALID_ARGUMENT; + cb->notify(V1_0::ErrorStatus::INVALID_ARGUMENT, nullptr); + return V1_0::ErrorStatus::INVALID_ARGUMENT; } return ArmnnDriverImpl::prepareArmnnModel_1_2(m_Runtime, @@ -172,7 +173,7 @@ public: Return getSupportedExtensions(getSupportedExtensions_cb cb) { ALOGV("hal_1_2::ArmnnDriver::getSupportedExtensions()"); - cb(ErrorStatus::NONE, {/* No extensions. */}); + cb(V1_0::ErrorStatus::NONE, {/* No extensions. */}); return Void(); } @@ -199,7 +200,7 @@ public: ALOGV("hal_1_2::ArmnnDriver::getSupportedExtensions()"); // Set both numbers to be 0 for cache not supported. - cb(ErrorStatus::NONE, 0, 0); + cb(V1_0::ErrorStatus::NONE, 0, 0); return Void(); } }; -- cgit v1.2.1