wasi-nn: Add support of wasi-nn as shared lib (#2310)
## Context Currently, WAMR supports compiling iwasm with flag `WAMR_BUILD_WASI_NN`. However, there are scenarios where the user might prefer having it as a shared library. ## Proposed Changes Decouple wasi-nn context management by internally managing the context given a module instance reference.
This commit is contained in:
13
core/iwasm/libraries/wasi-nn/external/README.md
vendored
Normal file
13
core/iwasm/libraries/wasi-nn/external/README.md
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# wasi-nn as shared library
|
||||
|
||||
Example on how to create libwasi-nn (external library) instead of embedding wasi-nn inside iwasm
|
||||
|
||||
From folder `core/iwasm/libraries/wasi-nn/test`, build the test and run
|
||||
|
||||
```sh
|
||||
../external/build/iwasm \
|
||||
--dir=. \
|
||||
--env="TARGET=cpu" \
|
||||
--native-lib=../external/build/libwasi-nn.so \
|
||||
test_tensorflow.wasm
|
||||
```
|
||||
Reference in New Issue
Block a user