The precompiled head.
More...
#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <fstream>
#include <vector>
#include <cstdint>
#include <unordered_map>
#include <functional>
#include <fmt/core.h>
#include <fmt/chrono.h>
#include <fmt/ranges.h>
#include <fmt/os.h>
#include <fmt/color.h>
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/reader.h>
#include <rapidjson/stringbuffer.h>
#include <glog/logging.h>
Go to the source code of this file.
|
| #define | FMT_HEADER_ONLY |
| | _WIN32 More...
|
| |
| #define | CB_GLOG 1 |
| |
| #define | LOG_INFO LOG(INFO) |
| |
| #define | LOG_ERR LOG(ERROR) |
| |
| #define | LOG_WARN LOG(WARN) |
| |
| #define | LOG_FATAL LOG(FATAL) |
| |
| #define | LOG_CHECK(x, ...) |
| |
| #define | CHECK_LOWER_THAN(x, y, ...) LOG_CHECK((x) < (y), __VA_ARGS__) |
| |
| #define | CHECK_GREATER_THAN(x, y, ...) LOG_CHECK((x) > (y), __VA_ARGS__) |
| |
| #define | CHECK_EQUAL(x, y, ...) LOG_CHECK((x) == (y), __VA_ARGS__) |
| |
| #define | CHECK_LOWER_EQUAL(x, y, ...) LOG_CHECK((x) <= (y), __VA_ARGS__) |
| |
| #define | CHECK_GREATER_EQUAL(x, y, ...) LOG_CHECK((x) >= (y), __VA_ARGS__) |
| |
| #define | CHECK_NOT_EQUAL(x, y, ...) LOG_CHECK((x) != (y), __VA_ARGS__) |
| |
| #define | CHECK_NULL(x, ...) LOG_CHECK((x) != NULL, __VA_ARGS__) |
| |
| #define | CB_ALIGNED(x) __attribute__((aligned(x))) |
| | CB_GLOG == 0. More...
|
| |
| #define | CB_FORCE_INLINE inline __attribute__((always_inline)) |
| |
| #define | CB_INLINE_CPU CB_FORCE_INLINE |
| |
| #define | CB_INLINE_NORMAL inline |
| |
| #define | CB_CONSTEXPR constexpr |
| |
| #define | CB_IS_NAN(func) std::isnan(func) |
| |
| #define | CB_IS_INF(func) std::isinf(func) |
| |
| #define | NO_TYPE_PTR void* |
| |
| #define | CB_SHAPE_ERROR_EXIT 1 |
| |
| #define | CB_TYPE_ERROR_EXIT 2 |
| |
| #define | CB_MEM_ERROR_EXIT 3 |
| |
| #define | CB_OTHER_ERROR_EXIT 4 |
| |
| #define | CB_USE_SOL true |
| |
| #define | MAKE_SHARED(x) std::make_shared<x> |
| |
| #define | SHARED_PTR(x) std::shared_ptr<x> |
| |
The precompiled head.
- Author
- chenghua Wang (cheng.nosp@m.hua..nosp@m.wang..nosp@m.edu@.nosp@m.gmail.nosp@m..com)
- Version
- 0.1
- Date
- 2022-10-22
- Copyright
- Copyright (c) 2022
Definition in file pch.hpp.
◆ CB_ALIGNED
| #define CB_ALIGNED |
( |
|
x | ) |
__attribute__((aligned(x))) |
CB_GLOG == 0.
To align the data.
x normally set to 4, 8, 16. This attribute will make data aligned to x. For example, you can use this macro like this: float foo_1[10] CB_ALIGNED(4); int32_t foo_2[10] CB_ALIGNED(8);
Definition at line 157 of file pch.hpp.
◆ CB_CONSTEXPR
| #define CB_CONSTEXPR constexpr |
◆ CB_FORCE_INLINE
| #define CB_FORCE_INLINE inline __attribute__((always_inline)) |
◆ CB_GLOG
◆ CB_INLINE_CPU
◆ CB_INLINE_NORMAL
| #define CB_INLINE_NORMAL inline |
◆ CB_IS_INF
| #define CB_IS_INF |
( |
|
func | ) |
std::isinf(func) |
◆ CB_IS_NAN
| #define CB_IS_NAN |
( |
|
func | ) |
std::isnan(func) |
◆ CB_MEM_ERROR_EXIT
| #define CB_MEM_ERROR_EXIT 3 |
◆ CB_OTHER_ERROR_EXIT
| #define CB_OTHER_ERROR_EXIT 4 |
◆ CB_SHAPE_ERROR_EXIT
| #define CB_SHAPE_ERROR_EXIT 1 |
◆ CB_TYPE_ERROR_EXIT
| #define CB_TYPE_ERROR_EXIT 2 |
◆ CB_USE_SOL
◆ CHECK_EQUAL
| #define CHECK_EQUAL |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) == (y), __VA_ARGS__) |
◆ CHECK_GREATER_EQUAL
| #define CHECK_GREATER_EQUAL |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) >= (y), __VA_ARGS__) |
◆ CHECK_GREATER_THAN
| #define CHECK_GREATER_THAN |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) > (y), __VA_ARGS__) |
◆ CHECK_LOWER_EQUAL
| #define CHECK_LOWER_EQUAL |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) <= (y), __VA_ARGS__) |
◆ CHECK_LOWER_THAN
| #define CHECK_LOWER_THAN |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) < (y), __VA_ARGS__) |
◆ CHECK_NOT_EQUAL
| #define CHECK_NOT_EQUAL |
( |
|
x, |
|
|
|
y, |
|
|
|
... |
|
) |
| LOG_CHECK((x) != (y), __VA_ARGS__) |
◆ CHECK_NULL
| #define CHECK_NULL |
( |
|
x, |
|
|
|
... |
|
) |
| LOG_CHECK((x) != NULL, __VA_ARGS__) |
◆ FMT_HEADER_ONLY
_WIN32
defined(unix) && defined(clang) _WIN32 unix
Definition at line 43 of file pch.hpp.
◆ LOG_CHECK
| #define LOG_CHECK |
( |
|
x, |
|
|
|
... |
|
) |
| |
Value: if (!(x)) { \
LOG_ERR << "Failed when testing " << #x << "\n"; \
std::cerr, __VA_ARGS__, std::endl; \
std::exit(1); \
}
Definition at line 132 of file pch.hpp.
◆ LOG_ERR
| #define LOG_ERR LOG(ERROR) |
◆ LOG_FATAL
| #define LOG_FATAL LOG(FATAL) |
◆ LOG_INFO
| #define LOG_INFO LOG(INFO) |
◆ LOG_WARN
| #define LOG_WARN LOG(WARN) |
◆ MAKE_SHARED
| #define MAKE_SHARED |
( |
|
x | ) |
std::make_shared<x> |
◆ NO_TYPE_PTR
| #define NO_TYPE_PTR void* |
◆ SHARED_PTR
| #define SHARED_PTR |
( |
|
x | ) |
std::shared_ptr<x> |