Skip to content
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

AMREX_FLATTEN #3840

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Src/Base/AMReX_Extension.H
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
#elif defined(__GNUC__)
#define AMREX_FORCE_INLINE inline __attribute__((always_inline))

#elif defined(_MSC_VER)
#define AMREX_FORCE_INLINE inline __forceinline

#else
#define AMREX_FORCE_INLINE inline

Expand All @@ -133,6 +136,15 @@
#define AMREX_NO_INLINE
#endif

// flatten
#if defined(_MSC_VER)
#define AMREX_FLATTEN [[msvc::flatten]]
#elif defined(__clang__) || defined(__GNUC__)
#define AMREX_FLATTEN __attribute__((flatten))
#else
#define AMREX_FLATTEN
#endif

// unroll loop
#define AMREX_TO_STRING_HELPER(X) #X
#define AMREX_TO_STRING(X) AMREX_TO_STRING_HELPER(X)
Expand Down
Loading