wasi-nn: Improve TPU support (#2447)
1. Allow TPU and GPU support at the same time. 2. Add Dockerfile to run example with [Coral USB](https://coral.ai/products/accelerator/).
This commit is contained in:
@ -18,12 +18,16 @@ if(NOT EXISTS ${TENSORFLOW_LITE})
|
||||
|
||||
set(TENSORFLOW_SOURCE_DIR "${WAMR_ROOT_DIR}/core/deps/tensorflow-src")
|
||||
|
||||
if(WASI_NN_ENABLE_GPU EQUAL 1)
|
||||
if(WAMR_BUILD_WASI_NN_ENABLE_GPU EQUAL 1)
|
||||
# Tensorflow specific:
|
||||
# * https://www.tensorflow.org/lite/guide/build_cmake#available_options_to_build_tensorflow_lite
|
||||
set (TFLITE_ENABLE_GPU ON)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set (TFLITE_ENABLE_XNNPACK OFF)
|
||||
endif()
|
||||
|
||||
add_subdirectory(
|
||||
"${TENSORFLOW_SOURCE_DIR}/tensorflow/lite"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/tensorflow-lite"
|
||||
|
||||
Reference in New Issue
Block a user