Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
[target.wasm32-wasip1]
rustflags = [
"-C",
"target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128",
"-C",
"link-arg=--max-memory=4294967296",
]
runner = "scripts/wasm-runner.sh"

[target.wasm32-wasip1-threads]
rustflags = [
"-C",
"target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128",
"-C",
"link-arg=--max-memory=4294967296",
]
runner = "wasmtime --wasi threads"
runner = "scripts/wasm-runner.sh"
15 changes: 15 additions & 0 deletions scripts/wasm-runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

if [ -z "${WASM_HARNESS_ENV_RAYON_NUM_THREADS:-}" ]; then
if command -v nproc >/dev/null 2>&1; then
cores=$(nproc)
elif command -v sysctl >/dev/null 2>&1; then
cores=$(sysctl -n hw.ncpu)
else
cores=1
fi
export WASM_HARNESS_ENV_RAYON_NUM_THREADS=$cores
fi

exec wasm-harness "$@"
Loading