cpumetricpapi

PAPI: what does Clock reference cycles mean?


i am using PAPI liberary to tune and profile my application.

I want to know what (PAPI_REF_CYC : Reference clock cycles ) means actually?

Thanks in advance,


Solution

  • Some modern CPUs, including the Intel's and AMD's ones, are throttled.
    This means that their clocks are not fixed but vary depending on the power management active - even if the CPU's brand frequency is X Ghz, more often than not, it is not running at that frequency.

    For a couple of real example technology see the Intel Turbo boost technology/AMD Turbo core and Intel Enhanced Speedstep technology/AMD Quiet'n'Cool technology.

    Since the core clock can slow down or speed up, comparing two different measures makes no sense.
    Having a snippet A to run in 100 core clocks and a snippet B in 200 core clocks means that B is slower in general (it takes double the work), but not necessarily that B took more time than A since the units are different. That's where the reference clock comes into play - it is uniform.
    If snippet A runs in 100 ref clocks and snippet B runs in 200 ref clocks then B really took more time than A.

    Converting ref clock ticks into time (e.g. seconds) is not that easy, each processor uses a difference reference frequency, even among processor with the same brand name.