yum-archive/TaSTT-Whisper
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper
8c4603c
master
1#pragma once 2 3namespace Whisper 4{ 5// Get current time in CPU clock 6// More specifically, each CPU core has a timestamp counter which runs at CPU's base frequency, regardless on the frequency scaling of that core. 7inline int64_t tscNow () 8 { 9return __rdtsc (); 10 } 11 12// Scale the time interval from CPU time stamp counter clock into 100-nanosecond ticks, rounding to nearest 13uint64_t ticksFromTsc (uint64_t tscDiff ); 14 15class CpuProfiler 16 { 17const int64_t started = tscNow (); 18 19public : 20 21uint64_t elapsed ()const 22 { 23return ticksFromTsc ( (uint64_t )(tscNow ()- started ) ); 24 } 25 }; 26}