wasi-nn: Add external delegation to support several NPU/GPU (#2162)

Add VX delegation as an external delegation of TFLite, so that several NPU/GPU
(from VeriSilicon, NXP, Amlogic) can be controlled via WASI-NN.

Test Code can work with the X86 simulator.
This commit is contained in:
ayakoakasaka
2023-05-05 10:29:36 +02:00
committed by GitHub
parent 5a23ae465c
commit 89be5622a5
4 changed files with 159 additions and 3 deletions

View File

@ -341,6 +341,13 @@ if (WAMR_BUILD_WASI_NN EQUAL 1)
message (" WASI-NN: GPU enabled")
add_definitions (-DWASI_NN_ENABLE_GPU=1)
endif ()
if (WAMR_BUILD_WASI_NN_ENABLE_EXT EQUAL 1)
message (" WASI-NN: External Delegation enabled")
add_definitions (-DWASI_NN_ENABLE_EXTERNAL_DELEGATE=1)
endif ()
if (DEFINED WASI_NN_EXT_DELEGATE_PATH)
add_definitions (-DWASI_NN_EXT_DELEGATE_PATH="${WASI_NN_EXT_DELEGATE_PATH}")
endif ()
endif ()
if (WAMR_BUILD_ALLOC_WITH_USER_DATA EQUAL 1)
add_definitions(-DWASM_MEM_ALLOC_WITH_USER_DATA=1)