jatinchowdhury18 / RTNeural

Real-time neural network inferencing
BSD 3-Clause "New" or "Revised" License
551 stars 57 forks source link

update to the latest xsimd for better performance on Android #80

Closed atsushieno closed 7 months ago

atsushieno commented 1 year ago

I'm building my own audio plugin framework for Android (if you remember we once talked about ChowPhaser port a few years ago), and today I got BYOD working. Though the performance is horrible, as I have to patch xsimd in RTNeural to disable the optimized versions of exp and exp10 operations that do not compile.

But I figured that chowdsp_simd also uses xsimd and it just compiles. The only reason RTNeural does not compile is that it references somewhat older version of xsimd. I have updated xsimd to the latest locally, but that caused another build breakage due to removal of xsimd/stl/algorithms.hpp so I made some additional changes (just replaced xsimd::transform() and xsimd::reduce() to those in std:: namespace) and it seems to work, in much better performance.

I'll be forking RTNeural and sending a PR to fix the issue, but I think the change makes it depend on C++20 part of std::transform and std::reduce. If it is not acceptable, I'll keep using my own fork.