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:
tonibofarull
2023-06-27 12:18:26 +02:00
committed by GitHub
parent 0a0739ef23
commit ab96e01f5e
9 changed files with 212 additions and 112 deletions

View File

@ -241,10 +241,6 @@ typedef struct WASMModuleInstanceExtra {
&& WASM_ENABLE_LAZY_JIT != 0)
WASMModuleInstance *next;
#endif
#if WASM_ENABLE_WASI_NN != 0
WASINNContext *wasi_nn_ctx;
#endif
} WASMModuleInstanceExtra;
struct AOTFuncPerfProfInfo;