Thrill  0.1
config.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * thrill/common/config.hpp
3  *
4  * Global configuration flags.
5  *
6  * Part of Project Thrill - http://project-thrill.org
7  *
8  * Copyright (C) 2015 Timo Bingmann <[email protected]>
9  *
10  * All rights reserved. Published under the BSD-2 license in the LICENSE file.
11  ******************************************************************************/
12 
13 #pragma once
14 #ifndef THRILL_COMMON_CONFIG_HEADER
15 #define THRILL_COMMON_CONFIG_HEADER
16 
17 namespace thrill {
18 namespace common {
19 
20 //! global ndebug flag as a boolean, NDEBUG means no debug in Release mode.
21 #if NDEBUG
22 static constexpr bool g_ndebug = true;
23 #else
24 static constexpr bool g_ndebug = false;
25 #endif
26 
27 //! debug mode is active, if NDEBUG is false.
28 static constexpr bool g_debug_mode = !g_ndebug;
29 
30 //! global flag to enable code parts doing self-verification. Later this may be
31 //! set false if NDEBUG is set in production mode.
32 static constexpr bool g_self_verify = g_debug_mode;
33 
34 //! global flag to enable background profiler thread
35 static constexpr bool g_profile_thread = true;
36 
37 //! Finding cache line size is hard - we assume 64 byte.
38 static constexpr unsigned g_cache_line_size = 64;
39 
40 //! global flag to warn user when two DIANodes could push data directly via a
41 //! File (skipping one data round trip) if the function stack were empty. This
42 //! can be used to find lambda which could be be fused to reduce the number of
43 //! data round trips.
44 static constexpr bool g_debug_push_file = false;
45 
46 #if !defined(_MSC_VER)
47 #define THRILL_HAVE_NET_TCP 1
48 #endif
49 
50 #if __linux__
51 #define THRILL_HAVE_LINUXAIO_FILE 1
52 #endif
53 
54 #if defined(_MSC_VER)
55 #define THRILL_WINDOWS 1
56 #define THRILL_MSVC 1
57 #endif
58 
59 #ifndef THRILL_WINDOWS
60 #define THRILL_HAVE_MMAP_FILE 1
61 #endif
62 
63 // MSVC doesn't define __SSE4_1__, so also check for __AVX__ // NOLINT
64 #if defined(__SSE4_1__) || defined(__AVX__)
65 #define THRILL_HAVE_SSE4_1
66 #endif
67 
68 // MSVC doesn't define __SSE4_2__, so also check for __AVX__ // NOLINT
69 #if defined(__SSE4_2__) || defined(__AVX__)
70 #define THRILL_HAVE_SSE4_2
71 #endif
72 
73 #if defined(__AVX2__)
74 #define THRILL_HAVE_AVX2
75 #endif
76 
77 } // namespace common
78 } // namespace thrill
79 
80 #endif // !THRILL_COMMON_CONFIG_HEADER
81 
82 /******************************************************************************/
static constexpr bool g_profile_thread
global flag to enable background profiler thread
Definition: config.hpp:35
static constexpr bool g_debug_push_file
Definition: config.hpp:44
static constexpr bool g_self_verify
Definition: config.hpp:32
static constexpr bool g_ndebug
global ndebug flag as a boolean, NDEBUG means no debug in Release mode.
Definition: config.hpp:24
static constexpr bool g_debug_mode
debug mode is active, if NDEBUG is false.
Definition: config.hpp:28
static constexpr unsigned g_cache_line_size
Finding cache line size is hard - we assume 64 byte.
Definition: config.hpp:38