本文介绍了什么是一个失败计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有一个C程序,在pseudoish是:

Say I have a C program that in pseudoish is:

For i=0 to 10
    x++
    a=2+x*5
next

时触发器为这个数字(1 [X ++] + 1 [X * 5 + 1 [2 +(X + 5))] * 10 [循环],30 FLOPS?我无法理解一个翻牌是什么。

Is the number of FLOPs for this (1 [x++] + 1 [x*5] + 1 [2+(x+5))] * 10[loop], for 30 FLOPS? I am having trouble understanding what a flop is.

注意[...]都表明在那里我从让我计数操作。

Note the [...] are indicating where I am getting my counts for "operations" from.

推荐答案

有关FLOPS测量的目的,通常只有加法和乘法都包括在内。像师,倒数,平方根和超越函数东西都很贵,包括作为一个单一的操作,而像载入和存储是太微不足道了。

For the purposes of FLOPS measurements, usually only additions and multiplications are included. Things like divisions, reciprocals, square roots, and transcendental functions are too expensive to include as a single operation, while things like loads and stores are too trivial.

在换句话说,你的循环体内含有2加1乘,所以(假设 X 是浮点)每次循环迭代为3 OPS;如果运行循环10次,你已经做了30欢声笑语。

In other words, your loop body contains 2 adds and 1 multiply, so (assuming x is floating point) each loop iteration is 3 ops; if you run the loop 10 times you've done 30 ops.

请注意,衡量MIPS的时候,你的循环将超过3指令,因为它也包括加载和存储的FLOPS测量不计数。

Note that when measuring MIPS, your loop would be more than 3 instructions because it also includes loads and stores that the FLOPS measurement doesn't count.

这篇关于什么是一个失败计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 07:03