MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tconfig.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_TEMPLATE_CONFIG
13 #define MFEM_TEMPLATE_CONFIG
14 
15 // the main MFEM config header
16 #include "config.hpp"
17 
18 // --- MFEM_STATIC_ASSERT
19 #if (__cplusplus >= 201103L)
20 #define MFEM_STATIC_ASSERT(cond, msg) static_assert((cond), msg)
21 #else
22 #define MFEM_STATIC_ASSERT(cond, msg) if (cond) { }
23 #endif
24 
25 // --- MFEM_ALWAYS_INLINE
26 #if !defined(MFEM_DEBUG) && (defined(__GNUC__) || defined(__clang__))
27 #define MFEM_ALWAYS_INLINE __attribute__((always_inline))
28 #else
29 #define MFEM_ALWAYS_INLINE
30 #endif
31 
32 #define MFEM_TEMPLATE_BLOCK_SIZE 4
33 #define MFEM_SIMD_SIZE 32
34 #define MFEM_TEMPLATE_ENABLE_SERIALIZE
35 
36 // #define MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
37 // #define MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
38 // #define MFEM_TEMPLATE_FIELD_EVAL_DATA_HAS_DOFS
39 #define MFEM_TEMPLATE_INTRULE_COEFF_PRECOMP
40 
41 // derived macros
42 #define MFEM_ROUNDUP(val,base) ((((val)+(base)-1)/(base))*(base))
43 #define MFEM_ALIGN_SIZE(size,type) \
44  MFEM_ROUNDUP(size,(MFEM_SIMD_SIZE)/sizeof(type))
45 
46 #ifdef MFEM_COUNT_FLOPS
47 namespace mfem
48 {
49 namespace internal
50 {
51 extern long long flop_count;
52 }
53 }
54 #define MFEM_FLOPS_RESET() (mfem::internal::flop_count = 0)
55 #define MFEM_FLOPS_ADD(cnt) (mfem::internal::flop_count += (cnt))
56 #define MFEM_FLOPS_GET() (mfem::internal::flop_count)
57 #else
58 #define MFEM_FLOPS_RESET()
59 #define MFEM_FLOPS_ADD(cnt)
60 #define MFEM_FLOPS_GET() (0)
61 #endif
62 
63 #endif // MFEM_TEMPLATE_CONFIG