Commit 3c19c52
Use std:: qualified math functions to avoid float-to-double promotion (#5088)
Summary:
Pull Request resolved: #5088
Fix 4 `performance-type-promotion-in-math-fn` lint warnings by using `std::floor`, `std::fabs`, and `std::pow` instead of the unqualified C versions. The unqualified versions promote `float` arguments to `double`, causing unnecessary precision loss and performance overhead. Also added missing `#include <cmath>` in `IndexIVFSpectralHash.cpp`.
Reviewed By: mnorris11
Differential Revision: D100576274
fbshipit-source-id: f491b1e9432a42f56a5660002f5b10ed0f594f4c1 parent 7cc6342 commit 3c19c52
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
| 776 | + | |
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| |||
0 commit comments