-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix build for mips loongarch risc-v with simplemath #6024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6024 +/- ##
==========================================
+ Coverage 95.41% 95.52% +0.10%
==========================================
Files 825 825
Lines 269192 269647 +455
==========================================
+ Hits 256848 257567 +719
+ Misses 12344 12080 -264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes build issues in the MIPS MSA simplemath module by replacing calls to the double-precision function "atan2" with the appropriate single-precision "atan2f".
- Replaced four calls to "atan2" with "atan2f" in the vectorized math function
- Ensures consistent float precision handling for processing v4f32 data
Comments suppressed due to low confidence (1)
src/layer/mips/msa_mathfun.h:263
- Replacing 'atan2' with 'atan2f' corrects the precision for float computations; please confirm that similar changes are not needed elsewhere in the module.
tmpx[0] = atan2f(tmpx[0], tmpy[0]);
The binary size change of libncnn.so (bytes)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes build issues on MIPS, Loongarch, and RISC-V platforms by updating math function calls to their float-specific versions (e.g. replacing exp with expf and tanh with tanhf).
- Updated math functions in GRU implementations and binary/element-wise ops
- Consistently replaced standard math functions with their f variants across MIPS, Loongarch, and RISC-V files
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/layer/riscv/gru_riscv_zfh.cpp | Replaced exp and tanh with expf and tanhf respectively |
src/layer/riscv/gru_riscv.cpp | Updated math functions to use the f variants |
src/layer/riscv/binaryop_riscv_zfh.cpp | Changed pow, atan2, etc. to use powf and atan2f |
src/layer/riscv/binaryop_riscv.cpp | Similar changes with math functions for binary ops |
src/layer/mips/unaryop_mips.cpp | Replaced fabs, floor, ceil, sqrt, exp, log, sin, etc. with f variants |
src/layer/mips/tanh_mips.cpp | Updated tanh to tanhf |
src/layer/mips/swish_mips.cpp | Updated exp to expf |
src/layer/mips/softmax_mips.cpp | Updated exp to expf in softmax computation |
src/layer/mips/sigmoid_mips.cpp | Updated sigmoid computation to use expf |
src/layer/mips/msa_mathfun.h | Replaced atan2 calls with atan2f |
src/layer/mips/mish_mips.cpp | Updated mish function calls to use tanhf and logf |
src/layer/mips/binaryop_mips.cpp | Updated pow, atan2, and related functions to use f variants |
src/layer/loongarch/unaryop_loongarch.cpp | Updated math functions to f variants |
src/layer/loongarch/tanh_loongarch.cpp | Updated tanh to tanhf |
src/layer/loongarch/swish_loongarch.cpp | Updated exp to expf |
src/layer/loongarch/softmax_loongarch.cpp | Updated exp to expf |
src/layer/loongarch/sigmoid_loongarch.cpp | Updated sigmoid computation to use expf |
src/layer/loongarch/mish_loongarch.cpp | Updated mish function calls to use tanhf and logf |
src/layer/loongarch/lsx_mathfun.h | Replaced atan2 with atan2f |
src/layer/loongarch/binaryop_loongarch.cpp | Updated pow, atan2, and related functions to use f variants |
No description provided.