-1

for instance, counting maths ops here:

          for (int i = 0; i < 100; ++i)
          {
            for (int j = 0; j < 50; ++j)
            {
              X[i*xcol+j] = Y[i] * Z[j];
             }
           }

Should we counting the ops like ++i, i*xcol+j etc in our total gflops(before you point out the obvious mistake here, lets forget the strict definition of flops for a moment) counting or we only need count Y[i]*Z[j]? The reason why I ask this is that I read some papers where they only count the last one as gflops/maths ops here.

user0002128
  • 2,785
  • 2
  • 23
  • 40
  • This question is extremely vague and not associated with any of the tags. It's only tangentially related to software. – xaxxon Dec 16 '12 at 06:20

1 Answers1

2

When you are performing a job for me, all I care about is counting the stuff I want. I do not care about counting your overhead. In this case, the goal is to multiply each of the Ys by each of the Zs. So the question is, how many multiplications can you give me per second?

I do not care whether you have to do many array index calculations or you find some way around them. E.g., suppose one day you were doing 20,000 total arithmetic operations to give me my 5,000 multiplications, and that took you one second (too slow to be a modern computer). To me, that is 5,000 flops per second. The next day, you figure out a better way to write your code, and it only takes you 10,000 arithmetic operations to give me my 5,000 multiplications, and it takes you half a second. That is 10,000 flops per second.

Obviously, I would rather have my 5,000 operations in half a second. Those are the only operations that count.

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312
  • Sure, but when the purpose is to meassure peak gflops/math ops rate of a particular hardware, I think index-computation should be take into account, not to mention index-computation can varies quite a bit depend on how you organize your data and your loops. – user0002128 Dec 16 '12 at 06:12
  • @user1748356: If you're already convinced of your view, why are you even asking? – GManNickG Dec 16 '12 at 06:38
  • 1
    @user1748356: Those things are taken into account when you measure time. When you do operations that are not your goal, they take time, which makes the calculated flop/s lower. The performance measure is goal (desired flops computed) divided by cost (time it takes). – Eric Postpischil Dec 16 '12 at 10:39