6#ifndef THEORETICA_REPROD_H
7#define THEORETICA_REPROD_H
27 std::string arch {
""};
30 std::string compiler {
""};
33 std::string compiler_version {
""};
36 std::string cpp_standard {
""};
39 std::string build_date {
""};
42 bool has_avx2 {
false};
45 bool has_avx512 {
false};
48 bool has_cuda {
false};
57 std::string str =
"Environment Information\n";
58 str +=
"OS: " + os +
"\n";
59 str +=
"Architecture: " + arch +
"\n";
60 str +=
"Compiler: " + compiler +
" " + compiler_version +
"\n";
61 str +=
"C++ Standard: " + cpp_standard +
"\n";
64 if (has_avx2) str +=
"AVX2 ";
65 if (has_avx512) str +=
"AVX512 ";
66 if (has_cuda) str +=
"CUDA ";
67 if (has_omp) str +=
"OpenMP ";
71 str +=
"Build Date: " + build_date +
"\n";
77 inline operator std::string() {
84 return out << obj.to_string();
100 env. arch =
"x86_64";
104 #elif defined(__APPLE__)
111 #elif defined(__linux__)
115 #elif defined(__aarch64__)
124 env.compiler =
"gcc";
125 env.compiler_version = std::to_string(__GNUC__) +
"."
126 + std::to_string(__GNUC_MINOR__) +
"."
127 + std::to_string(__GNUC_PATCHLEVEL__);
128 #elif defined(__clang__)
129 env.compiler =
"clang";
130 env.compiler_version = std::to_string(__clang_major__) +
"."
131 + std:: to_string(__clang_minor__) +
"."
132 + std::to_string(__clang_patchlevel__);
133 #elif defined(_MSC_VER)
134 env.compiler =
"msvc";
135 env.compiler_version = std::to_string(_MSC_VER);
139 #if __cplusplus == 202002L
140 env.cpp_standard =
"C++20";
141 #elif __cplusplus == 201703L
142 env.cpp_standard =
"C++17";
143 #elif __cplusplus == 201402L
144 env.cpp_standard =
"C++14";
146 env.cpp_standard =
"C++11 or earlier";
155 env.has_avx512 =
true;
169 env.build_date = __DATE__
" " __TIME__;
Main namespace of the library which contains all functions and objects.
Definition algebra.h:27
environment get_env()
Get an environment structure holding information about the current executing environment.
Definition reprod.h:92
Structure containing information about the build environment, such as operating system and compiler,...
Definition reprod.h:21
friend std::ostream & operator<<(std::ostream &out, const environment &obj)
Stream the environment in string representation to an output stream (std::ostream)
Definition reprod.h:83
std::string to_string() const
Convert the environment to human-readable string representation.
Definition reprod.h:55