AMReX-Codes / Amrvis

Amrvis is a visualization package specifically designed to read and display output and profiling data from codes built on the AMReX framework.
https://amrex-codes.github.io/amrex/docs_html/Visualization.html
16 stars 16 forks source link

fix 'abs' -> 'std:abs' #10

Closed JBlaschke closed 4 years ago

JBlaschke commented 4 years ago

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

asalmgren commented 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

Patch Links:

— 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

WeiqunZhang commented 4 years ago

The abs is not running on GPU. So std::abs works too.