wip : WASM 128-bit SIMD support

This commit is contained in:
Georgi Gerganov
2022-10-22 13:45:43 +03:00
parent e905c6f827
commit db460b78ff
5 changed files with 189 additions and 13 deletions

View File

@@ -21,13 +21,14 @@ if (WHISPER_WASM_SINGLE_FILE)
)
endif()
#-s TOTAL_MEMORY=536870912 \
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
--bind \
-s MODULARIZE=1 \
-s ASSERTIONS=1 \
-s USE_PTHREADS=1 \
-s PTHREAD_POOL_SIZE=8 \
-s TOTAL_MEMORY=536870912 \
-s PTHREAD_POOL_SIZE=9 \
-s ALLOW_MEMORY_GROWTH=1 \
-s FORCE_FILESYSTEM=1 \
-s EXPORT_NAME=\"'whisper_factory'\" \
${EXTRA_FLAGS} \

View File

@@ -4,6 +4,7 @@
#include <emscripten/bind.h>
#include <vector>
#include <thread>
std::vector<struct whisper_context *> g_contexts(4, nullptr);
@@ -47,7 +48,7 @@ EMSCRIPTEN_BINDINGS(whisper) {
params.print_special_tokens = false;
params.translate = false;
params.language = "en";
params.n_threads = 4;
params.n_threads = std::min(8, (int) std::thread::hardware_concurrency());
params.offset_ms = 0;
std::vector<float> pcmf32;

File diff suppressed because one or more lines are too long