float res[size], a[size], b[size]
//Several initialization is done
for(int i=0; i<size; i++) res[i] = a[i]*b[i];
I wonder how to measure number of the float operations made.
The machine:
model name : Intel(R) Core(TM)2 Quad CPU @ 2.93GH
The Compiler:
‘gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)’
The architecture: x86_64.
People say that sse option will be enabled automatically since gcc 4. While, there are comments that multiplication and division are not supported as for sse.
I did not recognize that whether sse is enabled if I just write code like above. And anybody could tell me how to calculate the number of float operations made?
What’s more, what if the float is substituted for double?
I wonder whether the equation is:
For float: 2.93 * 4
For Double: 2.93 * 2
Actually, I found there are 8 more new registers in x86_64. Will this lead to 8 float operations and 4 double operations at one time?
One way is to use cpu counters, particulary
FLOPS. egsee http://oprofile.sourceforge.net/docs/intel-core2-events.php