File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ set -e
3+
4+ source " $( dirname " ${BASH_SOURCE[0]} " ) /../../.ci/scripts/utils.sh"
5+
6+ test_build_wasm () {
7+ local model_name=$1
8+ local model_export_name=" ${model_name} .pte"
9+ local model_dir_name=" ./models_test/"
10+ echo " Exporting ${model_name} "
11+ mkdir -p " ${model_dir_name} "
12+ ${PYTHON_EXECUTABLE} -m examples.portable.scripts.export --model_name=" ${model_name} " --output_dir=" $model_dir_name "
13+
14+ local example_dir=examples/wasm
15+ local build_dir=cmake-out/${example_dir}
16+ rm -rf ${build_dir}
17+ retry emcmake cmake -DWASM_MODEL_DIR=" $( realpath " ${model_dir_name} " ) " -B${build_dir} .
18+
19+ echo " Building ${example_dir} "
20+ cmake --build ${build_dir} -j9 --target executor_runner
21+
22+ echo " Removing ${model_dir_name} "
23+ rm -rf " ${model_dir_name} "
24+
25+ echo ' Running wasm build test'
26+ node ${build_dir} /executor_runner.js --model_path=" ${model_export_name} "
27+ }
28+
29+ if [[ -z $PYTHON_EXECUTABLE ]];
30+ then
31+ PYTHON_EXECUTABLE=python3
32+ fi
33+
34+ cmake_install_executorch_lib
35+
36+ test_build_wasm add_mul
37+ test_build_wasm mv2
You can’t perform that action at this time.
0 commit comments