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
776 B34 linesraw
1#pragma once
2#include <stdint.h>
3#include <assert.h>
4
5namespace DirectCompute
6{
7	enum struct eDataType : uint8_t
8	{
9		FP16,
10		FP32,
11		U32,
12	};
13
14	inline size_t elementSize( eDataType dt )
15	{
16		assert( dt == eDataType::FP16 || dt == eDataType::FP32 || dt == eDataType::U32 );
17
18		return ( dt == eDataType::FP16 ) ? 2 : 4;
19	}
20
21	DXGI_FORMAT viewFormat( eDataType dt );
22
23	enum struct eBufferUse : uint8_t
24	{
25		// Immutable tensor, readable from GPU
26		Immutable,
27		// Read+write tensor, readable and writable on GPU
28		ReadWrite,
29		// Read+write tensor, readable and writable on GPU, which supports downloads from GPU
30		ReadWriteDownload,
31		// The tensor is accessible by both GPU (read only) and CPU (write only). Optimized for resources frequently updated from CPU.
32		Dynamic,
33	};
34}