Integrate WASI-NN into WAMR (#1521)

Initial integration of WASI-NN based on #1225:
- Implement the library core/iwasm/libraries/wasi-nn
- Support TensorFlow, CPU, F32 at the first stage
- Add cmake variable `-DWAMR_BUILD_WASI_NN`
- Add test case based on Docker image and update document

Refer to #1573
This commit is contained in:
tonibofarull
2022-10-12 06:09:29 +02:00
committed by GitHub
parent 78c38d088e
commit e53ab91439
25 changed files with 1459 additions and 0 deletions

View File

@ -33,6 +33,9 @@ get_spectest_export_apis(NativeSymbol **p_libc_builtin_apis);
uint32
get_libc_wasi_export_apis(NativeSymbol **p_libc_wasi_apis);
uint32_t
get_wasi_nn_export_apis(NativeSymbol **p_libc_wasi_apis);
uint32
get_base_lib_export_apis(NativeSymbol **p_base_lib_apis);
@ -425,6 +428,13 @@ wasm_native_init()
goto fail;
#endif /* WASM_ENABLE_LIB_RATS */
#if WASM_ENABLE_WASI_NN != 0
n_native_symbols = get_wasi_nn_export_apis(&native_symbols);
if (!wasm_native_register_natives("wasi_nn", native_symbols,
n_native_symbols))
return false;
#endif
return true;
fail:
wasm_native_destroy();