MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / cpu_cycles

Function cpu_cycles

tests/test-quantize-perf.cpp:46–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45#include <x86intrin.h>
46inline int64_t cpu_cycles() {
47// Rough way to detect new-ish CPUs
48#ifdef __POPCNT__
49 unsigned int dummy;
50 return __rdtscp(&dummy);
51#else
52 return __rdtsc();
53#endif
54}
55
56#else
57

Callers 1

benchmark_functionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected