Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
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)
20typedef long long amrex_long; // NOLINT(modernize-use-using) // so that this can be a C header
21typedef unsigned long long amrex_ulong; // NOLINT(modernize-use-using)
22#else
23typedef long amrex_long; // NOLINT(modernize-use-using)
24typedef unsigned long amrex_ulong; // NOLINT(modernize-use-using)
25#endif
26
27#ifdef __cplusplus
28namespace amrex {
30 using Long = amrex_long;
33}
34#endif
35
36#if (defined(__x86_64) || defined (__aarch64__)) && !defined(_WIN32) && (defined(__GNUC__) || defined(__clang__)) && !defined(__NVCOMPILER)
37
38#define AMREX_INT128_SUPPORTED 1
39
40#if defined(__GNUC__)
41#pragma GCC diagnostic push
42#pragma GCC diagnostic ignored "-Wpedantic"
43#endif
44
45typedef unsigned __int128 amrex_uint128_t; // NOLINT(modernize-use-using)
46typedef __int128 amrex_int128_t; // NOLINT(modernize-use-using)
47
48#ifdef __cplusplus
49namespace amrex {
50 using UInt128_t = amrex_uint128_t;
51 using Int128_t = amrex_int128_t;
52}
53#endif
54
55#if defined(__GNUC__)
56#pragma GCC diagnostic pop
57#endif
58
59#endif /* (defined(__x86_64) || defined (__aarch64__)) && !defined(_WIN32) && (defined(__GNUC__) || defined(__clang__)) */
60
61#endif
unsigned long long amrex_ulong
Definition AMReX_INT.H:21
long long amrex_long
Definition AMReX_INT.H:20
amrex_ulong ULong
Unsigned integer type guaranteed to be wider than unsigned int.
Definition AMReX_INT.H:32
amrex_long Long
Definition AMReX_INT.H:30
Definition AMReX_Amr.cpp:49