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
e953396
master
1#include "stdafx.h" 2#include "ModelAdvancedDlg.h" 3using Whisper ::eGpuModelFlags ; 4 5LRESULT ModelAdvancedDlg ::onInitDialog (UINT nMessage ,WPARAM wParam ,LPARAM lParam ,BOOL & bHandled ) 6{ 7cbWave = GetDlgItem (IDC_WAVE ); 8cbReshapedMatMul = GetDlgItem (IDC_RESHAPED_MAT_MUL ); 9const uint32_t flags = appState .gpuFlagsLoad (); 10 11// Setup the "Compute shaders" combobox 12cbWave .AddString (L"Wave64 shaders on AMD" ); 13cbWave .AddString (L"Wave32, always" ); 14cbWave .AddString (L"Wave64, always" ); 15int i = 0 ; 16if (0 != (flags & (uint32_t )eGpuModelFlags::Wave32 ) ) 17i = 1 ; 18else if (0 != (flags & (uint32_t )eGpuModelFlags::Wave64 ) ) 19i = 2 ; 20cbWave .SetCurSel (i ); 21 22// Setup the "Reshaped multiply" combobox 23cbReshapedMatMul .AddString (L"Reshape on AMD" ); 24cbReshapedMatMul .AddString (L"Don’t reshape tensors" ); 25cbReshapedMatMul .AddString (L"Reshape some tensors" ); 26i = 0 ; 27if (0 != (flags & (uint32_t )eGpuModelFlags::NoReshapedMatMul ) ) 28i = 1 ; 29else if (0 != (flags & (uint32_t )eGpuModelFlags::UseReshapedMatMul ) ) 30i = 2 ; 31cbReshapedMatMul .SetCurSel (i ); 32 33return 0 ; 34} 35 36bool ModelAdvancedDlg ::show (HWND owner ) 37{ 38auto res = DoModal (owner ); 39return res == IDOK ; 40} 41 42void ModelAdvancedDlg ::onOk () 43{ 44// Gather values from these comboboxes 45uint32_t flags = 0 ; 46 47int i = cbWave .GetCurSel (); 48if (1 == i ) 49flags |= (uint32_t )eGpuModelFlags::Wave32 ; 50else if (2 == i ) 51flags |= (uint32_t )eGpuModelFlags::Wave64 ; 52 53i = cbReshapedMatMul .GetCurSel (); 54if (1 == i ) 55flags |= (uint32_t )eGpuModelFlags::NoReshapedMatMul ; 56else if (2 == i ) 57flags |= (uint32_t )eGpuModelFlags::UseReshapedMatMul ; 58 59// Save to registry 60appState .gpuFlagsStore (flags ); 61 62EndDialog (IDOK ); 63}