From b0717b5241a15e3e4d37a1b51b6e5fd9a92a664f Mon Sep 17 00:00:00 2001 From: arovir01 Date: Wed, 5 Sep 2018 17:03:25 +0100 Subject: IVGCVSW-1806: Refactor Android-NN-Driver ModelToINetworkConverter * Moved conversion logic into new V1_0 and V1_1 HalPolicy classes * Extracted common helper functions into ConversionUtils class Change-Id: I1ab50edc266dd528c0cb22a5cd1aa65e103674d9 --- 1.0/ArmnnDriverImpl.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to '1.0/ArmnnDriverImpl.cpp') diff --git a/1.0/ArmnnDriverImpl.cpp b/1.0/ArmnnDriverImpl.cpp index c7c0f7e5..a35bb0e9 100644 --- a/1.0/ArmnnDriverImpl.cpp +++ b/1.0/ArmnnDriverImpl.cpp @@ -8,33 +8,27 @@ #include -using namespace std; -using namespace android; -using namespace android::nn; -using namespace android::hardware; - 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_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"; } // anonymous namespace namespace armnn_driver { -namespace V1_0 +namespace hal_1_0 { -Return ArmnnDriverImpl::getCapabilities( - const armnn::IRuntimePtr& runtime, - neuralnetworks::V1_0::IDevice::getCapabilities_cb cb) +Return ArmnnDriverImpl::getCapabilities(const armnn::IRuntimePtr& runtime, + V1_0::IDevice::getCapabilities_cb cb) { - ALOGV("V1_0::ArmnnDriverImpl::getCapabilities()"); + ALOGV("hal_1_0::ArmnnDriverImpl::getCapabilities()"); - neuralnetworks::V1_0::Capabilities capabilities; + V1_0::Capabilities capabilities; if (runtime) { capabilities.float32Performance.execTime = @@ -53,9 +47,9 @@ Return ArmnnDriverImpl::getCapabilities( } else { - capabilities.float32Performance.execTime = 0; - capabilities.float32Performance.powerUsage = 0; - capabilities.quantized8Performance.execTime = 0; + capabilities.float32Performance.execTime = 0; + capabilities.float32Performance.powerUsage = 0; + capabilities.quantized8Performance.execTime = 0; capabilities.quantized8Performance.powerUsage = 0; cb(ErrorStatus::DEVICE_UNAVAILABLE, capabilities); @@ -64,5 +58,5 @@ Return ArmnnDriverImpl::getCapabilities( return Void(); } -} // namespace armnn_driver::V1_0 -} // namespace armnn_driver +} // namespace hal_1_0 +} // namespace armnn_driver \ No newline at end of file -- cgit v1.2.1