简体   繁体   English

如何在Android中衡量应用执行功耗?

[英]How to measure app execution power consumption in android?

I'm developing android app using OpenCL for CPU-GPU parallel computing. 我正在使用OpenCL开发用于CPU-GPU并行计算的android应用。 I want to measure CPU-GPU each power consumption or total power consumption in app execution. 我想测量应用执行中每个CPU-GPU的功耗或总功耗。 But I can't find proper measurement method. 但是我找不到合适的测量方法。

The Android Developer site provides you with all you need : Android Developer网站可为您提供所需的一切:

https://developer.android.com/training/monitoring-device-state/index.html https://developer.android.com/training/monitoring-device-state/index.html

You can : 您可以 :

1.Monitor the Battery Level and Charging State 1.监控电池电量和充电状态

2.Determine and Monitor the Docking State and Type 2.确定并监视对接状态和类型

I have used ODROID-XU to measure energy consumption in CPU and GPU. 我已经使用ODROID-XU来测量CPU和GPU的能耗。 They provide power sensors for the 2 CPUs, GPU, and memory. 它们为2个CPU,GPU和内存提供功率传感器。

I have made a few scripts for collecting and analysing such data. 我制作了一些脚本来收集和分析此类数据。 Available here: https://github.com/luiscruz/greenbenchmark 在这里可用: https : //github.com/luiscruz/greenbenchmark

This is a good approach if you need reliable measurements. 如果需要可靠的测量,这是一种好方法。 On the contrary, software-based approaches only provide an estimation which might not be accurate. 相反,基于软件的方法仅提供可能不准确的估计。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM