This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/samples/workload/wasm-av1
Wenyong Huang 7be0d385a6
Implement SIMD latest opcodes and update LLVM to 13.0 (#758)
Implement the latest SIMD opcodes and update LLVM 13.0,
update the llvm build scripts, update the sample workloads‘ build scripts,
and build customized wasi-sdk to build some workloads.
Also refine the CI rules.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-09-17 19:12:57 +08:00
..
.gitignore Update sample workload wasm-av1 and add workload XNNPACK (#443) 2020-11-13 17:53:23 +08:00
av1-clang.patch Update sample workload wasm-av1 and add workload XNNPACK (#443) 2020-11-13 17:53:23 +08:00
build_workload.sh Implement SIMD latest opcodes and update LLVM to 13.0 (#758) 2021-09-17 19:12:57 +08:00
build.sh Implement SIMD latest opcodes and update LLVM to 13.0 (#758) 2021-09-17 19:12:57 +08:00
CMakeLists.avx_wasm.txt Implement SIMD latest opcodes and update LLVM to 13.0 (#758) 2021-09-17 19:12:57 +08:00
CMakeLists.txt Implement SIMD latest opcodes and update LLVM to 13.0 (#758) 2021-09-17 19:12:57 +08:00
README.md Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
wasm-av1.patch Add more checks to enhance security (#446) 2020-11-24 14:00:09 +08:00

"wasm-av1" sample introduction

This sample demonstrates how to build wasm-av1 into WebAssembly with simd support and run it with iwasm.

Preparation

please refer to installation instructions.

Build with wasi-sdk

$ mkdir build && cd build
$ cmake ..
$ make
# to verify
$ ls testavx.wasm

Or build with EMSDK

just run the convenience script:

./build.sh

the script builds wasm-av1 and runs it with iwasm, which basically contains the following steps:

  • hack emcc to delete some objects in libc.a
  • patch wasm-av1 and build it with emcc compiler
  • build iwasm with simd and libc-emcc support
  • run testav1.aot with iwasm

Run workload

Firstly please build iwasm with simd support:

$ cd <wamr dir>/product-mini/platforms/linux/
$ mkdir build && cd build
$ cmake .. -DWAMR_BUILD_SIMD=1 -DWAMR_BUILD_LIBC_EMCC=1
$ make

Then compile wasm file to aot file and run:

$ cd <dir of testavx.wasm>
$ <wamr dir>/wamr-compiler/build/wamrc --enable-simd -o testavx.aot testavx.wasm
# copy sample data like <wamr dir>/samples/workload/wasm-av1/av1/third_party/samples/elephants_dream_480p24.ivf
# make sure you declare the access priority of the directory in which the sample data is
$ <wamr dir>/product-mini/platforms/linux/build/iwasm --dir=. testavx.aot elephants_dream_480p24.ivf