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
531 B23 linesraw
1RWBuffer<float> buffer: register( u0 );
2
3cbuffer Constants: register( b0 )
4{
5	uint4 src0_elements: packoffset( c0 );
6	uint4 src0_strides: packoffset( c1 );
7	float multiplier: packoffset( c2.x );
8}
9
10[ numthreads( 32, 1, 1 ) ]
11void main( uint3 group: SV_GroupID, uint thread : SV_GroupIndex )
12{
13	const uint nc0 = src0_elements[ 0 ];
14	uint i = group.x * src0_strides[ 1 ];
15	const uint iEnd = i + nc0;
16	const float mul = multiplier;
17	for( i += thread; i < iEnd; i += 32 )
18	{
19		float f = buffer[ i ];
20		f *= mul;
21		buffer[ i ] = f;
22	}
23}