diff options
Diffstat (limited to '1.1')
-rw-r--r-- | 1.1/ArmnnDriver.hpp | 15 | ||||
-rw-r--r-- | 1.1/ArmnnDriverImpl.cpp | 31 | ||||
-rw-r--r-- | 1.1/ArmnnDriverImpl.hpp | 8 | ||||
-rw-r--r-- | 1.1/HalPolicy.hpp | 2 |
4 files changed, 36 insertions, 20 deletions
diff --git a/1.1/ArmnnDriver.hpp b/1.1/ArmnnDriver.hpp index baae6350..a6849abc 100644 --- a/1.1/ArmnnDriver.hpp +++ b/1.1/ArmnnDriver.hpp @@ -33,6 +33,7 @@ public: ~ArmnnDriver() {} public: + Return<void> getCapabilities(V1_0::IDevice::getCapabilities_cb cb) override { ALOGV("hal_1_1::ArmnnDriver::getCapabilities()"); @@ -51,8 +52,8 @@ public: cb); } - Return<ErrorStatus> prepareModel(const V1_0::Model& model, - const android::sp<V1_0::IPreparedModelCallback>& cb) override + Return<V1_0::ErrorStatus> prepareModel(const V1_0::Model& model, + const android::sp<V1_0::IPreparedModelCallback>& cb) override { ALOGV("hal_1_1::ArmnnDriver::prepareModel()"); @@ -81,9 +82,9 @@ public: cb); } - Return<ErrorStatus> prepareModel_1_1(const V1_1::Model& model, - V1_1::ExecutionPreference preference, - const android::sp<V1_0::IPreparedModelCallback>& cb) override + Return<V1_0::ErrorStatus> prepareModel_1_1(const V1_1::Model& model, + V1_1::ExecutionPreference preference, + const android::sp<V1_0::IPreparedModelCallback>& cb) override { ALOGV("hal_1_1::ArmnnDriver::prepareModel_1_1()"); @@ -92,8 +93,8 @@ public: preference == ExecutionPreference::SUSTAINED_SPEED)) { ALOGV("hal_1_1::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<hal_1_1::HalPolicy>::prepareModel(m_Runtime, diff --git a/1.1/ArmnnDriverImpl.cpp b/1.1/ArmnnDriverImpl.cpp index d8939a07..1d1aaa75 100644 --- a/1.1/ArmnnDriverImpl.cpp +++ b/1.1/ArmnnDriverImpl.cpp @@ -11,11 +11,12 @@ namespace { -const char *g_Float32PerformanceExecTimeName = "ArmNN.float32Performance.execTime"; -const char *g_Float32PerformancePowerUsageName = "ArmNN.float32Performance.powerUsage"; -const char *g_Quantized8PerformanceExecTimeName = "ArmNN.quantized8Performance.execTime"; -const char *g_Quantized8PerformancePowerUsageName = "ArmNN.quantized8Performance.powerUsage"; -const char *g_RelaxedFloat32toFloat16PerformanceExecTime = "ArmNN.relaxedFloat32toFloat16Performance.execTime"; +const char *g_Float32PerformanceExecTimeName = "ArmNN.float32Performance.execTime"; +const char *g_Float32PerformancePowerUsageName = "ArmNN.float32Performance.powerUsage"; +const char *g_Quantized8PerformanceExecTimeName = "ArmNN.quantized8Performance.execTime"; +const char *g_Quantized8PerformancePowerUsageName = "ArmNN.quantized8Performance.powerUsage"; +const char *g_RelaxedFloat32toFloat16PerformanceExecTime = "ArmNN.relaxedFloat32toFloat16Performance.execTime"; +const char *g_RelaxedFloat32toFloat16PerformancePowerUsageName = "ArmNN.relaxedFloat32toFloat16Performance.powerUsage"; } // anonymous namespace @@ -47,17 +48,21 @@ Return<void> ArmnnDriverImpl::getCapabilities_1_1(const armnn::IRuntimePtr& runt capabilities.relaxedFloat32toFloat16Performance.execTime = ParseSystemProperty(g_RelaxedFloat32toFloat16PerformanceExecTime, .1f); - cb(ErrorStatus::NONE, capabilities); + capabilities.relaxedFloat32toFloat16Performance.powerUsage = + ParseSystemProperty(g_RelaxedFloat32toFloat16PerformancePowerUsageName, .1f); + + cb(V1_0::ErrorStatus::NONE, capabilities); } else { - capabilities.float32Performance.execTime = 0; - capabilities.float32Performance.powerUsage = 0; - capabilities.quantized8Performance.execTime = 0; - capabilities.quantized8Performance.powerUsage = 0; - capabilities.relaxedFloat32toFloat16Performance.execTime = 0; - - cb(ErrorStatus::DEVICE_UNAVAILABLE, capabilities); + capabilities.float32Performance.execTime = 0; + capabilities.float32Performance.powerUsage = 0; + capabilities.quantized8Performance.execTime = 0; + capabilities.quantized8Performance.powerUsage = 0; + capabilities.relaxedFloat32toFloat16Performance.execTime = 0; + capabilities.relaxedFloat32toFloat16Performance.powerUsage = 0; + + cb(V1_0::ErrorStatus::DEVICE_UNAVAILABLE, capabilities); } return Void(); diff --git a/1.1/ArmnnDriverImpl.hpp b/1.1/ArmnnDriverImpl.hpp index 4308bacb..f49dee0e 100644 --- a/1.1/ArmnnDriverImpl.hpp +++ b/1.1/ArmnnDriverImpl.hpp @@ -11,6 +11,14 @@ #include <armnn/ArmNN.hpp> +#ifdef ARMNN_ANDROID_R +using namespace android::nn::hal; +#endif + + +namespace V1_0 = ::android::hardware::neuralnetworks::V1_0; +namespace V1_1 = ::android::hardware::neuralnetworks::V1_1; + namespace armnn_driver { namespace hal_1_1 diff --git a/1.1/HalPolicy.hpp b/1.1/HalPolicy.hpp index dd8558b3..806686bf 100644 --- a/1.1/HalPolicy.hpp +++ b/1.1/HalPolicy.hpp @@ -9,6 +9,8 @@ #include <HalInterfaces.h> +namespace V1_1 = ::android::hardware::neuralnetworks::V1_1; + namespace armnn_driver { namespace hal_1_1 |