Hi,
I am using SNPE for NN inference on a Snapdragon 845 running Android P. Both gpu and dsp performance is good, however, cpu performance is poor. I have determined that the number of threads launched is the cause of poor cpu performance - snpe uses all available cores. Using 8 cores, I can infer 8 images per second, however, when I disactivate 7 of the 8 cpu cores (keeping an A75), I can infer 35 images per second. As well as having increased performance on one core, I would like to keep the other cpu cores free for other tasks. Is it possible to manually specify the number of threads via the snpe C++ api?
Thanks
Hi,
This issue can be addressed based on the concepts in parallel processing.Threads use rand() and rand_r() function to generate random numbers. rand_r() is thread safe while rand() is not.The function rand() internally has its own mutex locking which may causing this slowdown.
And yes, we can control/specify the number of threads using vectors in C++. I would suggest you to follow this link(https://unix.stackexchange.com/questions/444653/why-is-my-program-slower-despite-using-more-threads) which has a similar issue.But I'm not sure whether SNPE has this support.