Runtime Environment¶
Runtime CPU detection and environment configuration.
C¶
functionclock_elapsed(uint64_t) Returns the elapsed time in seconds sincestart_time,based onclock_now.functionclock_frequency() Returns the number of ticks per second for the clock used in clock_now().functionclock_now() Returns the current value of the OS's highest-resolution monotonic clock. On modern hardware, these typically map to hardware instructions (RDTSC/CNTVCT_EL0) via user-mode shared pages, avoiding a heavy syscall context switch.functiontimestamps<max_count, fence>::compute_rdtsc_overhead() Measure and return the RDTSC read overhead in cycles.variabletimestamps<max_count, fence>::count Number of checkpoints currently stored indur/msg.structcpu_features Detected x86 CPU capabilities and identifying strings.
D¶
variabletimestamps<max_count, fence>::dur Per-checkpoint elapsed cycle counts (overhead-subtracted), indexed by record order.
E¶
functionstopwatch::elapsed() Return the elapsed time since construction cast to the requestedDurationtype.functionstopwatch::elapsed_ms() Convenience wrapper forelapsedreturning milliseconds.functionstopwatch::elapsed_ns() Convenience wrapper forelapsedreturning nanoseconds.functionstopwatch::elapsed_s() Return the elapsed wall-clock time in seconds since construction.functionstopwatch::elapsed_us() Convenience wrapper forelapsedreturning microseconds.variablecpu_features::exmax Highest supported extended CPUID leaf (leaf 0x80000000 EAX).
F¶
variablestopwatch::frequency Tick frequency of the underlying clock, captured at construction.
G¶
functionget_cpu() Returns the CPU instruction set selected for use at runtime.
H¶
variablecpu_features::has3DNOW AMD 3DNow! instructions.variablecpu_features::has3DNOWEXT AMD 3DNow! extension instructions.variablecpu_features::hasABM AMD Advanced Bit Manipulation (LZCNT + POPCNT on AMD).variablecpu_features::hasADX ADX instruction set (arbitrary-precision add with carry).variablecpu_features::hasAES AES instruction set.variablecpu_features::hasAVX AVX instruction set (CPUID-reported, see hasAVXOSSUPPORT).variablecpu_features::hasAVX2 AVX2 instruction set.variablecpu_features::hasAVX512BW AVX-512 Byte and Word.variablecpu_features::hasAVX512CD AVX-512 Conflict Detection.variablecpu_features::hasAVX512DQ AVX-512 Doubleword and Quadword.variablecpu_features::hasAVX512ER AVX-512 Exponential and Reciprocal instructions.variablecpu_features::hasAVX512F AVX-512 Foundation.variablecpu_features::hasAVX512OSSUPPORT AVX-512 state enabled by the OS (XCR0[7:5] == 0b111).variablecpu_features::hasAVX512PF AVX-512 Prefetch.variablecpu_features::hasAVX512VL AVX-512 Vector Length extensions.variablecpu_features::hasAVXOSSUPPORT AVX state enabled by the OS (XCR0[2:1] == 0b11).variablecpu_features::hasBMI1 Bit Manipulation Instructions 1.variablecpu_features::hasBMI2 Bit Manipulation Instructions 2.variablecpu_features::hasCLFSH CLFLUSH instruction.variablecpu_features::hasCMOV CMOVcc conditional move.variablecpu_features::hasCMPXCHG16B CMPXCHG16B (128-bit compare-exchange).variablecpu_features::hasCX8 CMPXCHG8B (64-bit compare-exchange).variablecpu_features::hasERMS Enhanced REP MOVSB/STOSB.variablecpu_features::hasF16C F16C half-precision conversion.variablecpu_features::hasFMA Fused Multiply-Add (FMA3).variablecpu_features::hasFSGSBASE RDFSBASE/WRFSBASE instructions.variablecpu_features::hasFXSR FXSAVE/FXRSTOR.variablecpu_features::hasHLE Hardware Lock Elision (Intel only).variablecpu_features::hasINVPCID INVPCID instruction.variablecpu_features::hasLAHF LAHF/SAHF in 64-bit mode.variablecpu_features::hasLZCNT LZCNT instruction (Intel only).variablecpu_features::hasMMX MMX.variablecpu_features::hasMMXEXT AMD MMX extensions.variablecpu_features::hasMONITOR MONITOR/MWAIT.variablecpu_features::hasMOVBE MOVBE (move byte-swap).variablecpu_features::hasMSR Model-Specific Registers (RDMSR/WRMSR).variablecpu_features::hasOSXSAVE OS enables XSAVE/XRSTOR (CPUID.1:ECX[27]).variablecpu_features::hasPCLMULQDQ PCLMULQDQ carry-less multiplication.variablecpu_features::hasPOPCNT POPCNT instruction.variablecpu_features::hasPREFETCHWT1 PREFETCHWT1 (Intel Xeon Phi).variablecpu_features::hasRDRAND RDRAND random number.variablecpu_features::hasRDSEED RDSEED random seed.variablecpu_features::hasRDTSCP RDTSCP instruction (Intel only).variablecpu_features::hasRTM Restricted Transactional Memory (Intel only).variablecpu_features::hasSEP SYSENTER/SYSEXIT.variablecpu_features::hasSHA SHA instruction set.variablecpu_features::hasSSE SSE.variablecpu_features::hasSSE2 SSE2.variablecpu_features::hasSSE3 SSE3.variablecpu_features::hasSSE41 SSE4.1.variablecpu_features::hasSSE42 SSE4.2.variablecpu_features::hasSSE4a AMD SSE4a.variablecpu_features::hasSSSE3 SSSE3.variablecpu_features::hasSYSCALL SYSCALL/SYSRET (Intel only).variablecpu_features::hasTBM AMD Trailing Bit Manipulation.variablecpu_features::hasXOP AMD XOP.variablecpu_features::hasXSAVE XSAVE/XRSTOR.
I¶
functiontimestamps<max_count, fence>::init() Reset the profiler, capturing the current cycle count as time zero.variablecpu_features::isAMD Vendor string is "AuthenticAMD".variablecpu_features::isIntel Vendor string is "GenuineIntel".
L¶
variabletimestamps<max_count, fence>::last Cycle count captured byinitor the most recentrecord; used as the reference point for the next duration measurement.
M¶
variablecpu_features::max Highest supported standard CPUID leaf (leaf 0 EAX).functionmeasure_rdtsc_cycle_time() Measures and returns the estimated cycle time in nanoseconds per tick for rdtsc.functiontimestamps<max_count, fence>::min(const timestamps<max_count, fence> &) Return a new timestamps object containing the per-slot minimum durations.variablecpu_features::model NUL-terminated CPUID model/brand string (leaves 0x80000002–4).variabletimestamps<max_count, fence>::msg Per-checkpoint labels, parallel todur.
O¶
functionoverride_cpu(cpu_t) Overrides the CPU instruction set used by KFR at runtime.
P¶
variablecpu_features::padding1variablecpu_features::padding2
R¶
functionrdtsc() Reads the processor's cycle counter.variabletimestamps<max_count, fence>::rdtsc_overheadfunctiontimestamps<max_count, fence>::record(const char *) Record a timestamp checkpoint with an optional label.
S¶
variablestopwatch::start_time Tick count captured at construction.functionsteady_time() Returns the current time in nanoseconds since epoch using steady_clock.structstopwatch RAII-style stopwatch measuring wall-clock elapsed time viaclock_now.constructorstopwatch::stopwatch()
T¶
classtimestamps<max_count, fence> High-resolution scoped profiler using RDTSC (x86) or CNTVCT_EL0 (AArch64).
V¶
variablecpu_features::vendor NUL-terminated CPUID vendor string (leaf 0).
This file was generated by cxxdox, a C++ documentation generator based on MkDocs Material and libclang.