Wenyong Huang a9cb9206d6 Fix build issue of the meshoptimizer workload (#1452) hace 3 años
..
.gitignore a3074df21b Import SIMD feature and add some workload samples (#438) hace 5 años
CMakeLists.txt d41543f829 cmake: Use CMAKE_BINARY_DIR instead of ${CMAKE_CURRENT_SOURCE_DIR}/build (#1410) hace 3 años
README.md 0db04e0b8f Fix some compile issues of samples (#690) hace 4 años
build_workload.sh 7be0d385a6 Implement SIMD latest opcodes and update LLVM to 13.0 (#758) hace 4 años
codecbench.patch a9cb9206d6 Fix build issue of the meshoptimizer workload (#1452) hace 3 años

README.md

"codecbench of meshoptimizer" sample introduction

This sample demonstrates how to build codecbench of messoptimizer 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 codecbench.wasm

Or build with EMSDK

EMSDK is another toolchain to compile C/C++ code to WASM. In this case, the output wasm file might have a higher performance than the file generated by wasi-sdk.

$ git clone https://github.com/zeux/meshoptimizer.git
$ cd messoptimizer
$ em++ tools/codecbench.cpp src/vertexcodec.cpp src/vertexfilter.cpp \
       src/overdrawanalyzer.cpp src/indexgenerator.cpp src/vcacheoptimizer.cpp \
       src/clusterizer.cpp src/indexcodec.cpp src/vfetchanalyzer.cpp \
       src/spatialorder.cpp src/allocator.cpp src/vcacheanalyzer.cpp \
       src/vfetchoptimizer.cpp src/overdrawoptimizer.cpp src/simplifier.cpp \
       src/stripifier.cpp -O3 -msimd128 \
       -s TOTAL_MEMORY=268435456 \
       -o codecbench.wasm
$ ls -l codecbench.wasm

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
$ make

Then compile wasm file to aot file and run:

$ <wamr dir>/wamr-compiler/build/wamrc --enable-simd -o codecbench.aot codecbench.wasm
$ <wamr dir>/product-mini/platforms/linux/build/iwasm codecbench.aot