如何测量我的算法消耗的功率?
我有一个在 ARM-Cortex-A8/Ubuntu 9.01 平台上运行的图像处理算法,我必须测量我的算法消耗的功耗,有人知道如何做到这一点吗?有可用的工具吗?
I have an image processing algorithm running on an ARM-Cortex-A8/Ubuntu 9.01 platform and I have to measure the power consumed by my algorithm, does anyone know how to do this? Any tools available for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
严格来说,你的算法不消耗电力。
假设您有一些硬件可以准确测量设备的电量使用情况,因此您应该能够在各种测试数据集上重复运行代码(在空闲的设备上)并测量累积电量使用情况,并将其与设备在同一时间内的空闲功耗;区别在于运行代码的设备所使用的额外电量。
与任何类型的基准测试一样,您需要在循环中重复运行它才能获得准确的数据。
由于数据可能会改变其性能特征,因此您需要不同测试数据的语料库来模拟不同的用例。与您的 QA 团队讨论此事。
Strictly speaking your algorithm doesn't consume power.
Presumably you have some hardware which can accurately measure the power usage of the device, so you should just be able to repeatedly run your code (on an otherwise idle device) on various test data sets and measure the cumulative power usage, and compare that with the idle power consumption of the device over the same time; the difference would be the amount of additional juice the device used running your code.
Like any kind of benchmark, you'll need to run it repeatedly in a loop to get accurate data.
As the data may change its performance characteristics, you'll need a corpus of different test data to simulate different use-cases. Talk to your QA team about it.
我认为您可以尝试 POWERTOP 和 POWERSTAT,并在系统空闲时测量一次,在运行程序时测量一次,差异可能会给您提供必要的信息。
http://www.hecticgeek.com/2012/02/ powerstat-power-calculator-ubuntu-linux/
谢谢--
S Teja
I think u can try POWERTOP and POWERSTAT and measure once while system is idle and once while running your program and difference might give you the necessary information.
http://www.hecticgeek.com/2012/02/powerstat-power-calculator-ubuntu-linux/
Thanks--
S Teja