# in root directory of MNN
mkdir build
cd build
cmake .. && make -j4
then execute the commmand:
./benchmark.out models_folder [loop_count] [forwardtype]
forwardtype is in these options: 0->CPU,1->Metal,3->OpenCL,6->OpenGL,7->Vulkan. Here are benchmark models: models.
You can directly execute the script bench_android.sh
in the benchmark directory. It builds in armeabi-v7a architecture by default, and in arm64-v8a architecture if builds with parameter of arm64-v8a. BenchmarkModels will be pushed to your device if executed with parameter of -p.
benchmark.txt
will be generated in benchmark directory after the execution.
- Prepare models with running the script
get_model.sh
in the tools/scropt; - Open demo project in demo/iOS and run with
Benchmark
button at right-top edge, you can switch model, forward type and thread number for banchmark with bottom toolbar.