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

KonstantinSource codes8c4603c

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