ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.17k stars 310 forks source link

Appropriate flags for scons while building Arm Compute Library #606

Closed saswat0 closed 2 years ago

saswat0 commented 2 years ago

I was trying to build ARM Compute Library on my Khadas VIM 3 board and was confused regarding the flags that I need to pass to scons. The guide shows the following

scons arch=arm64-v8a neon=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 

But I'm not sure which one to use. Or if my hardware has neon. Is there any way to figure out the correct flags for my board?

Thanks in advance

MikeJKelly commented 2 years ago

Hi @saswat0

from looking at the specs that board has a quad core ARM Cortex-A73 and dual core Cortex-A53, those CPUs have an arm64-v8a architecture with the neon extensions.

https://developer.arm.com/ip-products/processors/cortex-a/cortex-a73 https://developer.arm.com/ip-products/processors/cortex-a/cortex-a53

It also has an ARM Mali-G52 GPU so if you want you can enable the GPU acceleration too:

https://developer.arm.com/ip-products/graphics-and-multimedia/mali-gpus/mali-g52-gpu

If you only want to use the CPU then the following should work:

scons arch=arm64-v8a neon=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0

If you want to use the GPU too then you can use this:

scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0

Best regards, Mike

saswat0 commented 2 years ago

Thanks a ton @MikeJKelly. This pretty much solves my case

I just had one more question. What's the difference between building a stand-alone TfLite Delegate and Delegate with Arm NN. Will they yield different performances or so?