计数触发代码! [英] Counting Flops for a code!
本文介绍了计数触发代码!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这真的需要我的时间。我找不到一个简单的方法来估计FLOPS的下面的代码(循环),单循环的循环多少FLOPS:
This is really taking my time. I could not find a simple way to estimate FLOPS for a following code (the loop), How much FLOPS are for a single iteration of the loop:
float func(float * atominfo, float energygridItem, int xindex, int yindex)
{
...
for (atomid=0; atomid<numatoms*4; atomid+=4)
{
float dy = coory - atominfo[atomid+2];
float dysqpdzsq = (dy * dy) + atominfo[atomid+3];
float dx1 = coorx1 - atominfo[atomid+1];
float s, y, t;
s = atominfo[atomid] * (1.0f / sqrtf(dx1*dx1 + dysqpdzsq));
y = s - energycomp1;
t = energyvalx1 + y;
energycomp1 = (t - energyvalx1) - y;
energyvalx1 = t;
}
...
}
感谢。
推荐答案
我看到(按照复杂性的增加顺序):
I see (in order of increasing complexity):
这些相互之间的关系很大程度上取决于CPU系列。
How these relate to each other depends strongly on the CPU family.
这篇关于计数触发代码!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文