summaryrefslogtreecommitdiffstats
path: root/Whisper/modelFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Whisper/modelFactory.cpp')
-rw-r--r--Whisper/modelFactory.cpp19
1 files changed, 19 insertions, 0 deletions
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