-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wasi support #5534
Add wasi support #5534
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5534 +/- ##
===========================================
- Coverage 94.66% 92.65% -2.02%
===========================================
Files 787 368 -419
Lines 248712 91067 -157645
===========================================
- Hits 235432 84374 -151058
+ Misses 13280 6693 -6587 ☔ View full report in Codecov by Sentry. |
src/benchmark.cpp
Outdated
#include <thread> | ||
#else | ||
#include <unistd.h> // usleep() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I made another mistake.
cmake -B build -DCMAKE_BUILD_TYPE=Release \ --toolchain ${wasi_sdk}/share/cmake/wasi-sdk.cmake \ -DNCNN_RUNTIME_CPU=OFF \ -DNCNN_DISABLE_EXCEPTION=ON \ -DNCNN_THREADS=OFF cmake --build build After build, you can run benchncnn on cmdline with wasmtime: wasmtime --dir . benchncnn
Thanks for your contribution ! |
WASI is WebAssembly System Interface. Now we can build ncnn with wasi-sdk[1] to create a WebAssembly binary module, and run it with wasmtime on cmdline.
[1] https://github.com/WebAssembly/wasi-sdk
[2] https://github.com/bytecodealliance/wasmtime