Minor cleanup in build-wasm.sh file

This commit is contained in:
Abhishek Aggarwal 2021-04-14 14:51:08 +02:00
parent 1574a4586c
commit a7f6bb51d9

View File

@ -66,10 +66,8 @@ emcmake cmake -DCOMPILE_WASM=on -DPACKAGE_DIR="../models/" ../
emmake make -j3
# 3. Enable SIMD Wormhole via Wasm instantiation API in generated artifacts
sed -i.bak 's/var result = WebAssembly.instantiateStreaming(response, info);/var result = WebAssembly.instantiateStreaming(response, info,{simdWormhole:true});/g' wasm/bergamot-translator-worker.js
sed -i.bak 's/return WebAssembly.instantiate(binary, info);/return WebAssembly.instantiate(binary, info, {simdWormhole:true});/g' wasm/bergamot-translator-worker.js
sed -i.bak 's/var module = new WebAssembly.Module(bytes);/var module = new WebAssembly.Module(bytes, {simdWormhole:true});/g' wasm/bergamot-translator-worker.js
bash ../wasm/patch-artifacts-enable-wormhole.sh
# The artefacts (.js and .wasm files) will be available in `wasm` folder of build directory ("build-wasm" in this case).
# The artifacts (.js and .wasm files) will be available in `wasm` folder of build directory ("build-wasm" in this case).
exit 0