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
569 B25 linesraw
1#pragma once
2#include "../D3D/device.h"
3#include "TensorShape.h"
4
5namespace DirectCompute
6{
7	// 96 bytes dynamic constant buffers, with dimensions and VRAM layout of 2-3 tensors
8	class ConstantBuffer
9	{
10		CComPtr<ID3D11Buffer> buffer;
11
12	public:
13		HRESULT create();
14		HRESULT update( const TensorShape& t0 );
15		HRESULT update( const TensorShape& t0, const TensorShape& t1 );
16		HRESULT update( const TensorShape& t0, const TensorShape& t1, const TensorShape& t2 );
17
18		void bind() const;
19
20		__m128i getMemoryUse() const
21		{
22			return bufferMemoryUsage( buffer );
23		}
24	};
25}