24 #if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
37 #if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
40 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
42 GetConsoleMode(hOut, &dwMode);
43 dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
44 SetConsoleMode(hOut, dwMode);
59 SHLOG(
"ISA capibilites: (does not work on Windows)");
62 SHLOG(
"__SSE__: true");
64 SHLOG(
"__SSE__: false");
68 SHLOG(
"__SSE2__: true");
70 SHLOG(
"__SSE2__: false");
74 SHLOG(
"__SSE3__: true");
76 SHLOG(
"__SSE3__: false");
80 SHLOG(
"__SSE4_2__ : true");
82 SHLOG(
"__SSE4_2__ : false");
86 SHLOG(
"__AVX__: true");
88 SHLOG(
"__AVX__: false");
92 SHLOG(
"__AVX2__: true");
94 SHLOG(
"__AVX2__: false");
98 SHLOG(
"__AVX512BW__ : true");
100 SHLOG(
"__AVX512BW__ : false");
104 SHLOG(
"__AVX512CD__ : true");
106 SHLOG(
"__AVX512CD__ : false");
110 SHLOG(
"__AVX512DQ__ : true");
112 SHLOG(
"__AVX512DQ__ : false");
116 SHLOG(
"__AVX512F__ : true");
118 SHLOG(
"__AVX512F__ : false");
122 SHLOG(
"__AVX512VL__ : true");
124 SHLOG(
"__AVX512VL__ : false");
129 auto path = std::filesystem::current_path();
131 for (std::size_t i{ 0 }; i < count; ++i) {
132 std::filesystem::current_path(path.parent_path());
145 SHLOG_I(
"The binary is running from the directory " << std::filesystem::current_path() <<
"...");
148 inline bool file_exists(
const std::string& filepath) {
return std::filesystem::exists(filepath); }
150 inline bool dir_exists(
const std::string& path) {
return std::filesystem::is_directory(path); }
154 if (!std::filesystem::is_directory(path)) {
155 std::filesystem::create_directories(path);
Definition: os-utils.hpp:30
bool dir_create(const std::string &path)
Definition: os-utils.hpp:152
void cd_back(std::size_t count=1)
Definition: os-utils.hpp:128
void print_ISA_capibilites()
Prints available instruction set extensions (not working with MSVC).
Definition: os-utils.hpp:58
bool dir_exists(const std::string &path)
Definition: os-utils.hpp:150
bool file_exists(const std::string &filepath)
Definition: os-utils.hpp:148
void initialize_aplication()
Runs all initialization routines related to the OS.
Definition: os-utils.hpp:139
void setup_terminal()
Setups the attached terminal accordingly.
Definition: os-utils.hpp:35
#define SHLOG_I(x)
Definition: static-logger.hpp:172
#define SHLOG(x)
Undecorated log to the current log stream.
Definition: static-logger.hpp:116