cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CONFIG_H
4#define pRC_CONFIG_H
5
6#include <cstddef>
7
9
10namespace pRC
11{
12#ifndef DEFAULT_FLOAT
13 #define DEFAULT_FLOAT 64
14#endif // DEFAULT_FLOAT
15
16#if DEFAULT_FLOAT == 16
17 #error \
18 "Can not set default floating-point type to Float<16>." \
19 "Half-precision support is limited to storage only."
20#endif // DEFAULT_FLOAT
21
22 enum class LogLevel
23 {
24 Error,
25 Warning,
26 Info,
27 Debug,
28 Trace,
29 };
30
31#ifdef LOG_LEVEL
32 constexpr auto cLogLevel = LogLevel::LOG_LEVEL;
33#else
34 constexpr auto cLogLevel = LogLevel::Info;
35#endif // LOG_LEVEL
36
37 enum class DebugLevel
38 {
39 None,
40 Low,
41 Mid,
42 High,
43 };
44
45#ifdef DEBUG_LEVEL
46 constexpr auto cDebugLevel = DebugLevel::DEBUG_LEVEL;
47#else
48 constexpr auto cDebugLevel = DebugLevel::Low;
49#endif // DEBUG_LEVEL
50
51 constexpr Size cHugepageSizeByte = 2 * 1024 * 1024;
52 constexpr Size cPageSizeByte = 4 * 1024;
53 constexpr Size cCacheLineSizeByte = 64;
54 constexpr Size cMaxDefaultAlignment = alignof(std::max_align_t);
55 constexpr Size cSimdSizeByte =
56#if defined __AVX512F__
57 64;
58#elif defined __AVX__
59 32;
60#else
61 16;
62#endif
63}
64#endif // pRC_CONFIG_H
Definition cholesky.hpp:10
DebugLevel
Definition config.hpp:38
std::size_t Size
Definition basics.hpp:31
constexpr Size cCacheLineSizeByte
Definition config.hpp:53
constexpr Size cHugepageSizeByte
Definition config.hpp:51
LogLevel
Definition config.hpp:23
constexpr Size cSimdSizeByte
Definition config.hpp:55
constexpr auto cDebugLevel
Definition config.hpp:48
constexpr auto cLogLevel
Definition config.hpp:34
constexpr Size cPageSizeByte
Definition config.hpp:52
constexpr Size cMaxDefaultAlignment
Definition config.hpp:54