Closed JBlaschke closed 4 years ago
I believe that amrex::Math::abs would be more robust across architectures
On Sat, Aug 22, 2020 at 12:23 PM Johannes Blaschke notifications@github.com wrote:
I think changes in AMReX mean that abs is no longer resolved to the non-C version -- resulting in the error:
PltApp.cpp:3681:28: error: call of overloaded 'abs(int)' is ambiguous 3681 | rHeight = abs(newY-anchorY);
(I might be wrong, because the change was easy to implement, so I didn't investigate exactly why the error above pops up now when it hadn't in the past)
The solution is to replace abs with std::abs
You can view, comment on, or merge this pull request online at:
https://github.com/AMReX-Codes/Amrvis/pull/10 Commit Summary
- fix 'abs' -> 'std:abs'
File Changes
- M PltApp.cpp https://github.com/AMReX-Codes/Amrvis/pull/10/files#diff-d6c2605bad00a7bb8582fc11a3cef673 (32)
- M XYPlotWin.cpp https://github.com/AMReX-Codes/Amrvis/pull/10/files#diff-5a8aadaef6565e588ee8e39ec2841e84 (12)
Patch Links:
- https://github.com/AMReX-Codes/Amrvis/pull/10.patch
- https://github.com/AMReX-Codes/Amrvis/pull/10.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Codes/Amrvis/pull/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRE6YQLWYSI3E3ATVXYQ73SCALJJANCNFSM4QIH3FAQ .
-- Ann Almgren Senior Scientist; CCSE Group Lead
The abs is not running on GPU. So std::abs works too.
I think changes in AMReX mean that
abs
is no longer resolved to the non-C version -- resulting in the error:(I might be wrong, because the change was easy to implement, so I didn't investigate exactly why the error above pops up now when it hadn't in the past)
The solution is to replace
abs
withstd::abs