c++ - Counting Flops for a code! -


This is actually taking your time, I can not find an easy way to estimate flops for the following code (loop) How many flops are there for the same trend of the loop:

  Float Funk (Float * Atominfo, Float EnergyGrid Item, Int xindex, int yindex) {... (for atomid = 0; atomid & lt; numatoms * 4; atomid + 4) {float dy = coori - atominfo [atomid + 2]; Flat dicepadsk = (DE * DI) + atominfo [atimid + 3]; Float DX1 = Coorux 1 - Atomonepho [Atomid + 1]; Float s, y, t; S = atominfo [atomid] * (1.0f / sqrtf (dx1 * dx1 + dysqpdzsq)); Y = s - energy compression1; T = energetic x 1 + y; Energycomp1 = (T - EnergyVell x 1) - y; Energyvalx1 = T; } ...}   

It seems easy but I have been confused with some other numbers given earlier, so it would be nice if someone can give an exact number.

Thank you.

I see (in order to increase complexity):

  • 8 Extra (Ink Decrease)
  • 3 Multiple
  • 1 Reciprocal-class-root

    How it relates to each other but firmly Depending on the CPU family.

Comments