From 8c4603c73675958efc960fbd4bb599a2909d106a Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 16 Jan 2023 14:52:43 +0100 Subject: Source codes --- Whisper/modelFactory.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Whisper/modelFactory.cpp (limited to 'Whisper/modelFactory.cpp') diff --git a/Whisper/modelFactory.cpp b/Whisper/modelFactory.cpp new file mode 100644 index 0000000..a708551 --- /dev/null +++ b/Whisper/modelFactory.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" +#include "modelFactory.h" +#include "API/iContext.cl.h" + +HRESULT COMLIGHTCALL Whisper::loadModel( const wchar_t* path, eModelImplementation impl, const sLoadModelCallbacks* callbacks, iModel** pp ) +{ + switch( impl ) + { + case eModelImplementation::GPU: + return loadGpuModel( path, false, callbacks, pp ); + case eModelImplementation::Hybrid: + return loadGpuModel( path, true, callbacks, pp ); + case eModelImplementation::Reference: + return loadReferenceCpuModel( path, pp ); + } + + logError( u8"Unknown model implementation 0x%X", (int)impl ); + return E_INVALIDARG; +} \ No newline at end of file -- cgit v1.2.3