From 11c399b70c7ad5664b6060b39632e6b9fa815350 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 18 Jan 2023 20:35:30 +0100 Subject: Optional startup flags to override performance-related defaults for the compute shaders --- Whisper/API/eGpuModelFlags.h | 13 +++++++++++++ Whisper/API/iContext.cl.h | 3 ++- Whisper/API/iContext.h | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Whisper/API/eGpuModelFlags.h (limited to 'Whisper/API') diff --git a/Whisper/API/eGpuModelFlags.h b/Whisper/API/eGpuModelFlags.h new file mode 100644 index 0000000..96f5a76 --- /dev/null +++ b/Whisper/API/eGpuModelFlags.h @@ -0,0 +1,13 @@ +#pragma once +#include + +namespace Whisper +{ + enum struct eGpuModelFlags : uint32_t + { + Wave32 = 1, + Wave64 = 2, + NoReshapedMatMul = 4, + UseReshapedMatMul = 8, + }; +} \ No newline at end of file diff --git a/Whisper/API/iContext.cl.h b/Whisper/API/iContext.cl.h index 97d34c7..fdb15ce 100644 --- a/Whisper/API/iContext.cl.h +++ b/Whisper/API/iContext.cl.h @@ -5,6 +5,7 @@ #include "loggerApi.h" #include "sLanguageList.h" #include "sLoadModelCallbacks.h" +#include "eGpuModelFlags.h" namespace Whisper { @@ -55,7 +56,7 @@ namespace Whisper }; HRESULT COMLIGHTCALL setupLogger( const sLoggerSetup& setup ); - HRESULT COMLIGHTCALL loadModel( const wchar_t* path, eModelImplementation impl, const sLoadModelCallbacks* callbacks, iModel** pp ); + HRESULT COMLIGHTCALL loadModel( const wchar_t* path, eModelImplementation impl, uint32_t flags, const sLoadModelCallbacks* callbacks, iModel** pp ); uint32_t COMLIGHTCALL findLanguageKeyW( const wchar_t* lang ); uint32_t COMLIGHTCALL findLanguageKeyA( const char* lang ); diff --git a/Whisper/API/iContext.h b/Whisper/API/iContext.h index 9661093..d6ca29c 100644 --- a/Whisper/API/iContext.h +++ b/Whisper/API/iContext.h @@ -4,6 +4,7 @@ #include "loggerApi.h" #include "sLanguageList.h" #include "sLoadModelCallbacks.h" +#include "eGpuModelFlags.h" namespace Whisper { @@ -50,7 +51,7 @@ namespace Whisper }; HRESULT __stdcall setupLogger( const sLoggerSetup& setup ); - HRESULT __stdcall loadModel( const wchar_t* path, eModelImplementation impl, const sLoadModelCallbacks* callbacks, iModel** pp ); + HRESULT __stdcall loadModel( const wchar_t* path, eModelImplementation impl, uint32_t flags, const sLoadModelCallbacks* callbacks, iModel** pp ); uint32_t __stdcall findLanguageKeyW( const wchar_t* lang ); uint32_t __stdcall findLanguageKeyA( const char* lang ); -- cgit v1.2.3