1 // 2 // Copyright © 2017 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #include "ArmnnDriverImpl.hpp" 7 #include "../SystemPropertiesUtils.hpp" 8 9 #include <log/log.h> 10 11 namespace 12 { 13 14 const char *g_Float32PerformanceExecTimeName = "ArmNN.float32Performance.execTime"; 15 const char *g_Float32PerformancePowerUsageName = "ArmNN.float32Performance.powerUsage"; 16 const char *g_Quantized8PerformanceExecTimeName = "ArmNN.quantized8Performance.execTime"; 17 const char *g_Quantized8PerformancePowerUsageName = "ArmNN.quantized8Performance.powerUsage"; 18 19 } // anonymous namespace 20 21 namespace armnn_driver 22 { 23 namespace hal_1_0 24 { 25 getCapabilities(const armnn::IRuntimePtr & runtime,V1_0::IDevice::getCapabilities_cb cb)26Return<void> ArmnnDriverImpl::getCapabilities(const armnn::IRuntimePtr& runtime, 27 V1_0::IDevice::getCapabilities_cb cb) 28 { 29 ALOGV("hal_1_0::ArmnnDriverImpl::getCapabilities()"); 30 31 V1_0::Capabilities capabilities; 32 if (runtime) 33 { 34 capabilities.float32Performance.execTime = 35 ParseSystemProperty(g_Float32PerformanceExecTimeName, .1f); 36 37 capabilities.float32Performance.powerUsage = 38 ParseSystemProperty(g_Float32PerformancePowerUsageName, .1f); 39 40 capabilities.quantized8Performance.execTime = 41 ParseSystemProperty(g_Quantized8PerformanceExecTimeName, .1f); 42 43 capabilities.quantized8Performance.powerUsage = 44 ParseSystemProperty(g_Quantized8PerformancePowerUsageName, .1f); 45 46 cb(V1_0::ErrorStatus::NONE, capabilities); 47 } 48 else 49 { 50 capabilities.float32Performance.execTime = 0; 51 capabilities.float32Performance.powerUsage = 0; 52 capabilities.quantized8Performance.execTime = 0; 53 capabilities.quantized8Performance.powerUsage = 0; 54 55 cb(V1_0::ErrorStatus::DEVICE_UNAVAILABLE, capabilities); 56 } 57 58 return Void(); 59 } 60 61 } // namespace hal_1_0 62 } // namespace armnn_driver