在程序-CUDA中计算FLOPS / GFLOPS [英] Counting FLOPS/GFLOPS in program - CUDA

查看:558
本文介绍了在程序-CUDA中计算FLOPS / GFLOPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经完成我的应用程序,它乘以CRS矩阵和向量(SpMV),现在唯一要做的是计算FLOPS我的应用程序。在我看来,在稀疏矩阵 - 向量乘法的情况下,很难估计浮点运算的数量,因为一行中的乘法数量真的是跳跃或流畅。

Already finished my application which multiplies CRS matrix and vector (SpMV) and the only thing to do now is to count FLOPS my application did. In my opinion it's really hard to estimate number of floating point operation in case of sparse matrix - vector multiplication, because the number of multiplies in one row is really "jumpy" or fluent.

我只是尝试使用cudaprof(可在./CUDA/bin目录中)测量时间 - 它工作正常。

I only tried to measure time using "cudaprof" ( available in ./CUDA/bin directory) - it works fine.

任何建议和指导膏赞赏!

Any sugestions and instruction pastes appreciated !

推荐答案

这不只是你的意见;一个简单的事实是,在稀疏矩阵的情况下,操作的数量是依赖于数据的,所以你不能得到一个合理的答案,而不知道关于数据的东西。这使得它不可能有一个数字拟合所有数据估计。

That's not just your opinion; it's simple fact that the number of operations in the case of a sparse matrix is data-dependent, and so you can't get a reasonable answer without knowing something about the data. That makes it impossible to have a one-number-fits-all-data estimate.

这可能是一种情况下,你可以想一想它许多时间(做大量的研究)做一个或许准确的估计,或者你可以花费几分钟写一个现有的实现的变体,每增加一个计数器每次它做一个操作。当然,这将需要相当长的时间来运行(特别是如果你不以支持CUDA的形式),但可能比它需要花费的时间少得多的思考,当答案出来时,你不必做很多工作来说服自己这是对的。

This is probably one of the sorts of situations where you could think hard about it for many hours (and do lots of research) to make a maybe-accurate estimate, or you could spend a few minutes writing a variant of your existing implementation that increments a counter each time it does an operation. Sure, that's going to take quite a while to run (especially if you don't do it in a CUDA-enabled form), but probably a lot less time than it would take to do the thinking, and when the answer comes out, you don't have to do a lot of work to convince yourself that it's right.

这篇关于在程序-CUDA中计算FLOPS / GFLOPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆