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
764 B27 linesraw
1RWBuffer<float> result: register( u0 );
2
3cbuffer Constants: register( b0 )
4{
5	uint elements: packoffset( c0.x );
6}
7
8// Thread group index is 16 bits per coordinate:
9// https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-id3d11devicecontext-dispatch
10// We want this shader to support buffers up to 2 GB.
11#ifndef THREADS
12static const uint THREADS = 512;
13#endif
14#ifndef ITERATIONS
15static const uint ITERATIONS = 128;
16#endif
17
18static const uint itemsPerGroup = THREADS * ITERATIONS;
19
20[numthreads( THREADS, 1, 1 )]
21void main( uint3 group: SV_GroupID, uint thread : SV_GroupIndex )
22{
23	uint rdi = group.x * itemsPerGroup;
24	const uint rdiEnd = min( rdi + itemsPerGroup, elements );
25	for( rdi += thread; rdi < rdiEnd; rdi += THREADS )
26		result[ rdi ] = 0.0;
27}