1 | #pragma once |
---|---|
2 | |
3 | #include "taichi/common/core.h" |
4 | |
5 | #include <string> |
6 | #include <cstdlib> |
7 | |
8 | namespace taichi::lang { |
9 | |
10 | static inline int get_environ_config(const std::string &name, |
11 | int default_value = 0) { |
12 | char *res = std::getenv(name.c_str()); |
13 | if (res == nullptr) |
14 | return default_value; |
15 | return std::stoi(res); |
16 | } |
17 | |
18 | } // namespace taichi::lang |
19 |