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#include "stdafx.h" 2#include "CommandLineArgs.h" 3#include <charconv> 4 5static bool printUsage () 6{ 7fprintf (stderr ,"Usage: compareTraces.exe trace1.bin trace2.bin [-diff N]\n" ); 8return false; 9} 10 11bool CommandLineArgs ::parse (int argc ,wchar_t * argv [] ) 12{ 13size_t idx = 0 ; 14CString sw ; 15CStringA tmp ; 16for (int i = 1 ;i < argc ;i ++ ) 17 { 18if (argv [i ][0 ]!= L'-' ) 19 { 20if (idx >=2 ) 21return printUsage (); 22inputs [idx ]= argv [i ]; 23idx ++ ; 24continue ; 25 } 26sw = argv [i ]; 27if (0 == sw .CompareNoCase (L"-diff" ) ) 28 { 29i ++ ; 30if (i >=argc ) 31return printUsage (); 32tmp .Format ("%S" ,argv [i ] ); 33tmp .Trim (); 34uint64_t v ; 35auto res = std::from_chars (tmp ,cstr (tmp )+ tmp .GetLength (),v ); 36if (res .ec != (std::errc )0 ) 37 { 38fprintf (stderr ,"Unable to parse string into number\n" ); 39return false; 40 } 41printDiff = v ; 42continue ; 43 } 44return printUsage (); 45 } 46 47if (idx != 2 ) 48return printUsage (); 49 50return true; 51}