Block-Structured AMR Software Framework
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 {
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
43typedef unsigned __int128 amrex_uint128_t; // NOLINT(modernize-use-using)
44typedef __int128 amrex_int128_t; // NOLINT(modernize-use-using)
45
46#ifdef __cplusplus
47namespace 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