Block-Structured AMR Software Framework
AMReX_INT.H
Go to the documentation of this file.
1 #ifndef AMREX_INT_H_
2 #define AMREX_INT_H_
3 #include <AMReX_Config.H>
4 
5 #ifdef __cplusplus
6 #include <type_traits>
7 #include <cinttypes>
8 #include <climits>
9 #else
10 #ifdef AMREX_TYPECHECK
11 #define __attribute__(x)
12 #define __extension__
13 #define __restrict
14 #endif
15 #include <inttypes.h>
16 #include <limits.h>
17 #endif
18 
19 #if (INT_MAX == LONG_MAX)
20 typedef long long amrex_long; // NOLINT(modernize-use-using) // so that this can be a C header
21 typedef unsigned long long amrex_ulong; // NOLINT(modernize-use-using)
22 #else
23 typedef long amrex_long; // NOLINT(modernize-use-using)
24 typedef unsigned long amrex_ulong; // NOLINT(modernize-use-using)
25 #endif
26 
27 #ifdef __cplusplus
28 namespace amrex {
29  using Long = amrex_long;
30  using ULong = amrex_ulong;
31 }
32 #endif
33 
34 #if (defined(__x86_64) || defined (__aarch64__)) && !defined(_WIN32) && (defined(__GNUC__) || defined(__clang__)) && !defined(__NVCOMPILER)
35 
36 #define AMREX_INT128_SUPPORTED 1
37 
38 #if defined(__GNUC__)
39 #pragma GCC diagnostic push
40 #pragma GCC diagnostic ignored "-Wpedantic"
41 #endif
42 
43 typedef unsigned __int128 amrex_uint128_t; // NOLINT(modernize-use-using)
44 typedef __int128 amrex_int128_t; // NOLINT(modernize-use-using)
45 
46 #ifdef __cplusplus
47 namespace amrex {
48  using UInt128_t = amrex_uint128_t;
49  using Int128_t = amrex_int128_t;
50 }
51 #endif
52 
53 #if defined(__GNUC__)
54 #pragma GCC diagnostic pop
55 #endif
56 
57 #endif /* (defined(__x86_64) || defined (__aarch64__)) && !defined(_WIN32) && (defined(__GNUC__) || defined(__clang__)) */
58 
59 #endif
unsigned long long amrex_ulong
Definition: AMReX_INT.H:21
long long amrex_long
Definition: AMReX_INT.H:20
Definition: AMReX_Amr.cpp:49