I'm trying to measure performance of some of our software via IPP.
I'm using ippGetCpuClocks and ippGetCpuFreqMhz to measure the time this software takes to execute:
Ipp64u ippTic = ippGetCpuClocks();
// lots of code here...
Ipp64u ippToc = ippGetCpuClocks();
deltaT = (ippToc-ippTic)/myStatus;
Is there an easy way to convert this time into FLOPS????
The system in question is:
|Intel Core 2 Duo processor 4x2660 MHz|
FLOPS usually mean floating point instructions per second.
With ippGetCpuClocks() function you may measure number of processor clocks spend in some piece of code (note, accuracy of rdtsc instruction, used in ippGetCpuClocks() is about 100 clock on modern processors).
You may be interested in looking at CTimer class in JPEGView demo, it is quite simple utility to incapsulate timer functionality within simple API (it also attached to that post for your convenience).
Thanks for the quick reply Vladimir!
Good point on "FLOPS"...I guess itwould have been more accurate for me to say"OPS", as in "operations per seconds". [our application codeis mostly floating point]
On the target hardware from my first post, how many instructionsare executed at each clock cycle? [one, two, more?]
If I know how many clock cycles my code takes(from ippGetCpuClocks as described above) and how fast the processor is (from ippGetCpuFreqMhz) I think I can calculate OPS with this information.
Also, thanks for pointer/link to timer.zip!
Tocalculate number ofoperations per second you needto know twothings:
time, spend inyour piece of code
and number of instructons in that piece of code
With IPP or OS API you can only measure time (more less accurate).
So you need to count somehow number of instructions. The simpliest way is to use Intel VTune performance analizer, itcan directly calculate metrics like number of integerinstructions per second, number of FP instructions per secondand many other.
If I remember that correctly, the Intel Core 2 micro architecture is able to run 2 SSE instructions per clockand up to 4 integer instructions per clock, please see processor data sheet for more details.