pRC
multi-purpose Tensor Train library for C++
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
7
8namespace pRC
9{
10#ifndef DEFAULT_FLOAT
11# define DEFAULT_FLOAT 64
12#endif // DEFAULT_FLOAT
13
14#if DEFAULT_FLOAT == 16
15# error \
16 "Can not set default floating-point type to Float<16>." \
17 "Half-precision support is limited to storage only."
18#endif // DEFAULT_FLOAT
19
20 enum class LogLevel
21 {
22 Error,
23 Warning,
24 Info,
25 Debug,
26 Trace,
27 };
28
29#ifdef LOG_LEVEL
30 constexpr auto cLogLevel = LogLevel::LOG_LEVEL;
31#else
32 constexpr auto cLogLevel = LogLevel::Info;
33#endif // LOG_LEVEL
34
35 enum class DebugLevel
36 {
37 None,
38 Low,
39 Mid,
40 High,
41 };
42
43#ifdef DEBUG_LEVEL
44 constexpr auto cDebugLevel = DebugLevel::DEBUG_LEVEL;
45#else
46 constexpr auto cDebugLevel = DebugLevel::Low;
47#endif // DEBUG_LEVEL
48
49 constexpr Size cHugepageSizeByte = 2 * 1024 * 1024;
50 constexpr Size cPageSizeByte = 4 * 1024;
51 constexpr Size cCacheLineSizeByte = 64;
52 constexpr Size cSimdSizeByte =
53#if defined __AVX512F__
54 64;
55#elif defined __AVX__
56 32;
57#else
58 16;
59#endif
60}
61#endif // pRC_CONFIG_H
Definition cholesky.hpp:18
DebugLevel
Definition config.hpp:36
constexpr Size cCacheLineSizeByte
Definition config.hpp:51
All< Not< Bs >... > None
Definition type_traits.hpp:83
std::size_t Size
Definition type_traits.hpp:20
constexpr Size cHugepageSizeByte
Definition config.hpp:49
LogLevel
Definition config.hpp:21
constexpr Size cSimdSizeByte
Definition config.hpp:52
constexpr auto cDebugLevel
Definition config.hpp:46
constexpr auto cLogLevel
Definition config.hpp:32
constexpr Size cPageSizeByte
Definition config.hpp:50
Definition trace.hpp:11