orca/src/ext/wasm3/test/wasi/smallpt
Ben Visness 29cb9f50e4 Add commands to deal with Orca source code:
- Add a vendor commands
- Add a command that helps you set up a C compiler
- Move ext into the src folder
- Update Mac build scripts for consistency
- Update Windows batch scripts
2023-09-16 17:54:56 +02:00
..
README.md Add commands to deal with Orca source code: 2023-09-16 17:54:56 +02:00
image.jpg Add commands to deal with Orca source code: 2023-09-16 17:54:56 +02:00
smallpt-ex.cpp Add commands to deal with Orca source code: 2023-09-16 17:54:56 +02:00
smallpt.cpp Add commands to deal with Orca source code: 2023-09-16 17:54:56 +02:00

README.md

smallpt

Based on https://www.kevinbeason.com/smallpt/

Results

TODO

Building

wasic++ -g0 -Oz -Wl,--stack-first -Wl,-z,stack-size=$[1024*1024] smallpt-ex.cpp -o smallpt-ex.wasm

Running

export ENGINES_PATH=/opt/wasm_engines

# Wasm3
../../../build/wasm3 smallpt-ex.wasm > image.ppm

# WAC
$ENGINES_PATH/wac/wax smallpt-ex.wasm > image.ppm

# wasm-micro-runtime
$ENGINES_PATH/wasm-micro-runtime/core/iwasm/products/linux/build/iwasm smallpt-ex.wasm > image.ppm

# wasmtime
wasmtime --optimize smallpt-ex.wasm > image.ppm

# Wasmer
wasmer run smallpt-ex.wasm > image.ppm
wasmer run --backend singlepass smallpt-ex.wasm > image.ppm
wasmer run --backend llvm       smallpt-ex.wasm > image.ppm

# Wasmer-JS (V8)
wasmer-js run smallpt-ex.wasm > image.ppm

node --wasm_interpret_all $(which wasmer-js) run smallpt-ex.wasm > image.ppm

# WAVM
$ENGINES_PATH/WAVM/Release/bin/wavm run smallpt-ex.wasm > image.ppm