C++库研究笔记[1] Profile->程序执行时间统计
2013-07-27 16:23
204 查看
研究nvidia 的cusp 库,可见到这样的代码:
template <typename Array1, 380 typename Array2, 381 typename ScalarType> 382 void axpy(const Array1& x, 383 const Array2& y, 384 ScalarType alpha) 385 { 386 CUSP_PROFILE_SCOPED(); 387 detail::assert_same_dimensions(x, y); 388 cusp::blas::detail::axpy(x.begin(), x.end(), y.begin(), alpha); 389 }
这一行
386 CUSP_PROFILE_SCOPED();
即为时间统计
参考:
主要:High Performance C++ Profiling :http://floodyberry.wordpress.com/2009/10/07/high-performance-cplusplus-profiling/
clock() 函数相当的严重不准确Resolution Problems inclock()
:
http://www.guyrutenberg.com/2007/09/10/resolution-problems-in-clock/
Profiling Code Using
clock_gettime
http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/
相关文章推荐
- DSP学习-----CCS3.3 利用profile对程序的运行时间进行统计
- Collection -&gt; .Net集合类型大全,只要灵活运用可以节省很多开发时间和提高程序运行效率
- c语言中如何添加计时函数,统计程序执行的时间
- 利用xcode-->profile对程序进行内存泄露检查总结
- Collection -> .Net集合类型大全,只要灵活运用可以节省很多开发时间和提高程序运行效率
- 解决:shell脚本中,无法执行time命令,以统计某个程序执行时间
- c语言中如何添加计时函数,统计程序执行的时间
- 项目day02--<客户上下线时间程序实现>(中)
- c语言中如何添加计时函数,统计程序执行的时间
- Java 中的 int 与 Integer 用于 List<Integer> 时,以及通过打印变量检測程序执行和函数调用次数计数
- c语言中如何添加计时函数,统计程序执行的时间
- System类统计程序执行时间
- java基础教程2---->程序执行过程映射到内存怎么变化
- c语言中如何添加计时函数,统计程序执行的时间
- K&R的名著:<C程序设计语言>小程序总结p117统计关键字
- 统计程序执行时间
- c语言中如何添加计时函数,统计程序执行的时间
- std::stack<T>和std::queue<T>在执行频率比较高的程序中,效率太低
- go学习(七)——统计程序执行时间
- c语言中如何添加计时函数,统计程序执行的时间