catboost 1.25.1 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEPLOYMENT.md +22 -15
- package/README.md +37 -27
- package/binding.gyp +5 -7
- package/build_scripts/bootstrap.js +2 -1
- package/build_scripts/out/build.js +46 -68
- package/build_scripts/out/build_model.js +1 -1
- package/build_scripts/out/{build_ya.js → build_native.js} +1 -1
- package/build_scripts/out/ci.js +5 -5
- package/build_scripts/out/config.js +32 -18
- package/build_scripts/out/install.js +5 -3
- package/build_scripts/out/package_prepublish.js +1 -1
- package/build_scripts/out/packaging.js +1 -19
- package/build_scripts/out/run_tests.js +1 -1
- package/build_scripts/out/test.js +8 -3
- package/config.json +18 -11
- package/inc/catboost/libs/model_interface/c_api.h +349 -3
- package/lib/catboost.d.ts +65 -21
- package/package.json +4 -4
- package/src/api_helpers.cpp +100 -24
- package/src/api_helpers.h +8 -7
- package/src/api_module.cpp +1 -2
- package/src/model.cpp +483 -83
- package/src/model.h +24 -9
- package/inc/contrib/libs/cxxsupp/system_stl/include/stlfwd +0 -14
- package/inc/util/charset/recode_result.h +0 -9
- package/inc/util/charset/unicode_table.h +0 -123
- package/inc/util/charset/unidata.h +0 -421
- package/inc/util/charset/utf8.h +0 -384
- package/inc/util/charset/wide.h +0 -843
- package/inc/util/charset/wide_specific.h +0 -22
- package/inc/util/datetime/base.h +0 -669
- package/inc/util/datetime/constants.h +0 -7
- package/inc/util/datetime/cputimer.h +0 -124
- package/inc/util/datetime/parser.h +0 -292
- package/inc/util/datetime/systime.h +0 -47
- package/inc/util/datetime/uptime.h +0 -8
- package/inc/util/digest/city.h +0 -88
- package/inc/util/digest/fnv.h +0 -73
- package/inc/util/digest/multi.h +0 -14
- package/inc/util/digest/murmur.h +0 -57
- package/inc/util/digest/numeric.h +0 -86
- package/inc/util/digest/sequence.h +0 -48
- package/inc/util/draft/date.h +0 -129
- package/inc/util/draft/datetime.h +0 -184
- package/inc/util/draft/enum.h +0 -136
- package/inc/util/draft/holder_vector.h +0 -102
- package/inc/util/draft/ip.h +0 -131
- package/inc/util/draft/matrix.h +0 -108
- package/inc/util/draft/memory.h +0 -40
- package/inc/util/folder/dirent_win.h +0 -46
- package/inc/util/folder/dirut.h +0 -121
- package/inc/util/folder/filelist.h +0 -81
- package/inc/util/folder/fts.h +0 -108
- package/inc/util/folder/iterator.h +0 -109
- package/inc/util/folder/lstat_win.h +0 -20
- package/inc/util/folder/path.h +0 -225
- package/inc/util/folder/pathsplit.h +0 -113
- package/inc/util/folder/tempdir.h +0 -42
- package/inc/util/generic/adaptor.h +0 -134
- package/inc/util/generic/algorithm.h +0 -765
- package/inc/util/generic/array_ref.h +0 -282
- package/inc/util/generic/array_size.h +0 -24
- package/inc/util/generic/benchmark/vector_count_ctor/f.h +0 -9
- package/inc/util/generic/bitmap.h +0 -1115
- package/inc/util/generic/bitops.h +0 -459
- package/inc/util/generic/bt_exception.h +0 -24
- package/inc/util/generic/buffer.h +0 -232
- package/inc/util/generic/cast.h +0 -176
- package/inc/util/generic/deque.h +0 -24
- package/inc/util/generic/explicit_type.h +0 -42
- package/inc/util/generic/fastqueue.h +0 -55
- package/inc/util/generic/flags.h +0 -244
- package/inc/util/generic/function.h +0 -103
- package/inc/util/generic/fwd.h +0 -171
- package/inc/util/generic/guid.h +0 -61
- package/inc/util/generic/hash.h +0 -2032
- package/inc/util/generic/hash_primes.h +0 -140
- package/inc/util/generic/hash_set.h +0 -490
- package/inc/util/generic/hide_ptr.h +0 -3
- package/inc/util/generic/intrlist.h +0 -876
- package/inc/util/generic/is_in.h +0 -53
- package/inc/util/generic/iterator.h +0 -137
- package/inc/util/generic/iterator_range.h +0 -105
- package/inc/util/generic/lazy_value.h +0 -66
- package/inc/util/generic/list.h +0 -22
- package/inc/util/generic/map.h +0 -44
- package/inc/util/generic/mapfindptr.h +0 -60
- package/inc/util/generic/maybe.h +0 -713
- package/inc/util/generic/maybe_traits.h +0 -164
- package/inc/util/generic/mem_copy.h +0 -55
- package/inc/util/generic/noncopyable.h +0 -38
- package/inc/util/generic/object_counter.h +0 -53
- package/inc/util/generic/ptr.h +0 -1113
- package/inc/util/generic/queue.h +0 -57
- package/inc/util/generic/refcount.h +0 -162
- package/inc/util/generic/reserve.h +0 -11
- package/inc/util/generic/scope.h +0 -65
- package/inc/util/generic/serialized_enum.h +0 -406
- package/inc/util/generic/set.h +0 -42
- package/inc/util/generic/singleton.h +0 -136
- package/inc/util/generic/size_literals.h +0 -65
- package/inc/util/generic/stack.h +0 -18
- package/inc/util/generic/store_policy.h +0 -120
- package/inc/util/generic/strbase.h +0 -612
- package/inc/util/generic/strbuf.h +0 -552
- package/inc/util/generic/strfcpy.h +0 -17
- package/inc/util/generic/string.h +0 -1572
- package/inc/util/generic/string_hash.h +0 -21
- package/inc/util/generic/string_ut.h +0 -1175
- package/inc/util/generic/type_name.h +0 -34
- package/inc/util/generic/typelist.h +0 -114
- package/inc/util/generic/typetraits.h +0 -325
- package/inc/util/generic/utility.h +0 -132
- package/inc/util/generic/va_args.h +0 -400
- package/inc/util/generic/variant.h +0 -631
- package/inc/util/generic/variant_traits.h +0 -171
- package/inc/util/generic/vector.h +0 -119
- package/inc/util/generic/xrange.h +0 -258
- package/inc/util/generic/yexception.h +0 -212
- package/inc/util/generic/yexception_ut.h +0 -14
- package/inc/util/generic/ylimits.h +0 -92
- package/inc/util/generic/ymath.h +0 -206
- package/inc/util/memory/addstorage.h +0 -93
- package/inc/util/memory/alloc.h +0 -27
- package/inc/util/memory/blob.h +0 -296
- package/inc/util/memory/mmapalloc.h +0 -8
- package/inc/util/memory/pool.h +0 -432
- package/inc/util/memory/segmented_string_pool.h +0 -194
- package/inc/util/memory/segpool_alloc.h +0 -118
- package/inc/util/memory/smallobj.h +0 -141
- package/inc/util/memory/tempbuf.h +0 -111
- package/inc/util/network/address.h +0 -136
- package/inc/util/network/endpoint.h +0 -61
- package/inc/util/network/hostip.h +0 -16
- package/inc/util/network/init.h +0 -60
- package/inc/util/network/interface.h +0 -17
- package/inc/util/network/iovec.h +0 -65
- package/inc/util/network/ip.h +0 -116
- package/inc/util/network/nonblock.h +0 -8
- package/inc/util/network/pair.h +0 -9
- package/inc/util/network/poller.h +0 -58
- package/inc/util/network/pollerimpl.h +0 -707
- package/inc/util/network/sock.h +0 -608
- package/inc/util/network/socket.h +0 -421
- package/inc/util/random/common_ops.h +0 -130
- package/inc/util/random/easy.h +0 -47
- package/inc/util/random/entropy.h +0 -21
- package/inc/util/random/fast.h +0 -101
- package/inc/util/random/init_atfork.h +0 -3
- package/inc/util/random/lcg_engine.h +0 -66
- package/inc/util/random/mersenne.h +0 -46
- package/inc/util/random/mersenne32.h +0 -50
- package/inc/util/random/mersenne64.h +0 -50
- package/inc/util/random/normal.h +0 -38
- package/inc/util/random/random.h +0 -30
- package/inc/util/random/shuffle.h +0 -39
- package/inc/util/str_stl.h +0 -266
- package/inc/util/stream/aligned.h +0 -99
- package/inc/util/stream/buffer.h +0 -119
- package/inc/util/stream/buffered.h +0 -225
- package/inc/util/stream/debug.h +0 -53
- package/inc/util/stream/direct_io.h +0 -43
- package/inc/util/stream/file.h +0 -108
- package/inc/util/stream/format.h +0 -444
- package/inc/util/stream/fwd.h +0 -100
- package/inc/util/stream/hex.h +0 -8
- package/inc/util/stream/holder.h +0 -44
- package/inc/util/stream/input.h +0 -273
- package/inc/util/stream/labeled.h +0 -19
- package/inc/util/stream/length.h +0 -100
- package/inc/util/stream/mem.h +0 -255
- package/inc/util/stream/multi.h +0 -32
- package/inc/util/stream/null.h +0 -61
- package/inc/util/stream/output.h +0 -304
- package/inc/util/stream/pipe.h +0 -112
- package/inc/util/stream/printf.h +0 -25
- package/inc/util/stream/str.h +0 -207
- package/inc/util/stream/tee.h +0 -28
- package/inc/util/stream/tempbuf.h +0 -21
- package/inc/util/stream/tokenizer.h +0 -214
- package/inc/util/stream/trace.h +0 -60
- package/inc/util/stream/walk.h +0 -35
- package/inc/util/stream/zerocopy.h +0 -91
- package/inc/util/stream/zerocopy_output.h +0 -57
- package/inc/util/stream/zlib.h +0 -173
- package/inc/util/string/ascii.h +0 -236
- package/inc/util/string/builder.h +0 -39
- package/inc/util/string/cast.h +0 -347
- package/inc/util/string/cstriter.h +0 -14
- package/inc/util/string/escape.h +0 -70
- package/inc/util/string/hex.h +0 -59
- package/inc/util/string/join.h +0 -194
- package/inc/util/string/printf.h +0 -13
- package/inc/util/string/reverse.h +0 -16
- package/inc/util/string/split.h +0 -1080
- package/inc/util/string/strip.h +0 -257
- package/inc/util/string/strspn.h +0 -65
- package/inc/util/string/subst.h +0 -56
- package/inc/util/string/type.h +0 -50
- package/inc/util/string/util.h +0 -195
- package/inc/util/string/vector.h +0 -132
- package/inc/util/system/align.h +0 -50
- package/inc/util/system/atexit.h +0 -22
- package/inc/util/system/atomic.h +0 -51
- package/inc/util/system/atomic_gcc.h +0 -90
- package/inc/util/system/atomic_ops.h +0 -189
- package/inc/util/system/atomic_win.h +0 -114
- package/inc/util/system/backtrace.h +0 -39
- package/inc/util/system/byteorder.h +0 -186
- package/inc/util/system/compat.h +0 -84
- package/inc/util/system/compiler.h +0 -620
- package/inc/util/system/condvar.h +0 -71
- package/inc/util/system/context.h +0 -181
- package/inc/util/system/context_aarch64.h +0 -8
- package/inc/util/system/context_i686.h +0 -9
- package/inc/util/system/context_x86.h +0 -12
- package/inc/util/system/context_x86_64.h +0 -7
- package/inc/util/system/cpu_id.h +0 -159
- package/inc/util/system/daemon.h +0 -28
- package/inc/util/system/datetime.h +0 -98
- package/inc/util/system/defaults.h +0 -149
- package/inc/util/system/demangle.h +0 -5
- package/inc/util/system/demangle_impl.h +0 -23
- package/inc/util/system/direct_io.h +0 -71
- package/inc/util/system/dynlib.h +0 -119
- package/inc/util/system/env.h +0 -32
- package/inc/util/system/error.h +0 -95
- package/inc/util/system/event.h +0 -122
- package/inc/util/system/execpath.h +0 -17
- package/inc/util/system/fasttime.h +0 -6
- package/inc/util/system/fhandle.h +0 -27
- package/inc/util/system/file.h +0 -210
- package/inc/util/system/file_lock.h +0 -34
- package/inc/util/system/filemap.h +0 -383
- package/inc/util/system/flock.h +0 -35
- package/inc/util/system/fs.h +0 -156
- package/inc/util/system/fs_win.h +0 -29
- package/inc/util/system/fstat.h +0 -46
- package/inc/util/system/getpid.h +0 -12
- package/inc/util/system/guard.h +0 -179
- package/inc/util/system/hi_lo.h +0 -139
- package/inc/util/system/hostname.h +0 -10
- package/inc/util/system/hp_timer.h +0 -36
- package/inc/util/system/info.h +0 -12
- package/inc/util/system/interrupt_signals.h +0 -22
- package/inc/util/system/madvise.h +0 -30
- package/inc/util/system/maxlen.h +0 -32
- package/inc/util/system/mem_info.h +0 -18
- package/inc/util/system/mincore.h +0 -38
- package/inc/util/system/mktemp.h +0 -11
- package/inc/util/system/mlock.h +0 -43
- package/inc/util/system/mutex.h +0 -67
- package/inc/util/system/nice.h +0 -3
- package/inc/util/system/pipe.h +0 -90
- package/inc/util/system/platform.h +0 -246
- package/inc/util/system/progname.h +0 -13
- package/inc/util/system/protect.h +0 -25
- package/inc/util/system/rusage.h +0 -26
- package/inc/util/system/rwlock.h +0 -78
- package/inc/util/system/sanitizers.h +0 -122
- package/inc/util/system/sem.h +0 -41
- package/inc/util/system/shellcommand.h +0 -472
- package/inc/util/system/shmat.h +0 -32
- package/inc/util/system/sigset.h +0 -78
- package/inc/util/system/spin_wait.h +0 -10
- package/inc/util/system/spinlock.h +0 -121
- package/inc/util/system/src_location.h +0 -25
- package/inc/util/system/src_root.h +0 -68
- package/inc/util/system/sys_alloc.h +0 -43
- package/inc/util/system/sysstat.h +0 -52
- package/inc/util/system/tempfile.h +0 -34
- package/inc/util/system/thread.h +0 -167
- package/inc/util/system/tls.h +0 -307
- package/inc/util/system/types.h +0 -119
- package/inc/util/system/unaligned_mem.h +0 -67
- package/inc/util/system/user.h +0 -5
- package/inc/util/system/utime.h +0 -6
- package/inc/util/system/valgrind.h +0 -48
- package/inc/util/system/winint.h +0 -43
- package/inc/util/system/yassert.h +0 -121
- package/inc/util/system/yield.h +0 -4
- package/inc/util/thread/factory.h +0 -65
- package/inc/util/thread/fwd.h +0 -30
- package/inc/util/thread/lfqueue.h +0 -406
- package/inc/util/thread/lfstack.h +0 -188
- package/inc/util/thread/pool.h +0 -388
- package/inc/util/thread/singleton.h +0 -42
- package/inc/util/ysafeptr.h +0 -427
- package/inc/util/ysaveload.h +0 -700
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include "align.h"
|
|
4
|
-
#include "defaults.h"
|
|
5
|
-
#include "compiler.h"
|
|
6
|
-
#include "sanitizers.h"
|
|
7
|
-
|
|
8
|
-
#include <util/generic/array_ref.h>
|
|
9
|
-
#include <util/generic/utility.h>
|
|
10
|
-
#include <util/generic/yexception.h>
|
|
11
|
-
|
|
12
|
-
#define STACK_ALIGN (8 * PLATFORM_DATA_ALIGN)
|
|
13
|
-
|
|
14
|
-
#if defined(_x86_64_) || defined(_i386_) || defined(_arm_) || defined(_ppc64_)
|
|
15
|
-
#define STACK_GROW_DOWN 1
|
|
16
|
-
#else
|
|
17
|
-
#error todo
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
/*
|
|
21
|
-
* switch method
|
|
22
|
-
*/
|
|
23
|
-
#if defined(_bionic_) || defined(__IOS__)
|
|
24
|
-
#define USE_GENERIC_CONT
|
|
25
|
-
#elif defined(_cygwin_)
|
|
26
|
-
#define USE_UCONTEXT_CONT
|
|
27
|
-
#elif defined(_win_)
|
|
28
|
-
#define USE_FIBER_CONT
|
|
29
|
-
#elif (defined(_i386_) || defined(_x86_64_) || defined(_arm64_)) && !defined(_k1om_)
|
|
30
|
-
#define USE_JUMP_CONT
|
|
31
|
-
#else
|
|
32
|
-
#define USE_UCONTEXT_CONT
|
|
33
|
-
#endif
|
|
34
|
-
|
|
35
|
-
#if defined(USE_JUMP_CONT)
|
|
36
|
-
#if defined(_arm64_)
|
|
37
|
-
#include "context_aarch64.h"
|
|
38
|
-
#else
|
|
39
|
-
#include "context_x86.h"
|
|
40
|
-
#endif
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
#if defined(USE_UCONTEXT_CONT)
|
|
44
|
-
#include <ucontext.h>
|
|
45
|
-
#endif
|
|
46
|
-
|
|
47
|
-
struct ITrampoLine {
|
|
48
|
-
virtual ~ITrampoLine() = default;
|
|
49
|
-
|
|
50
|
-
virtual void DoRun();
|
|
51
|
-
virtual void DoRunNaked();
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
struct TContClosure {
|
|
55
|
-
ITrampoLine* TrampoLine;
|
|
56
|
-
TArrayRef<char> Stack;
|
|
57
|
-
const char* ContName = nullptr;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
#if defined(USE_UCONTEXT_CONT)
|
|
61
|
-
class TContMachineContext {
|
|
62
|
-
typedef void (*ucontext_func_t)(void);
|
|
63
|
-
|
|
64
|
-
public:
|
|
65
|
-
inline TContMachineContext() {
|
|
66
|
-
getcontext(&Ctx_);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
inline TContMachineContext(const TContClosure& c) {
|
|
70
|
-
getcontext(&Ctx_);
|
|
71
|
-
|
|
72
|
-
Ctx_.uc_link = 0;
|
|
73
|
-
Ctx_.uc_stack.ss_sp = (void*)c.Stack.data();
|
|
74
|
-
Ctx_.uc_stack.ss_size = c.Stack.size();
|
|
75
|
-
Ctx_.uc_stack.ss_flags = 0;
|
|
76
|
-
|
|
77
|
-
extern void ContextTrampoLine(void* arg);
|
|
78
|
-
makecontext(&Ctx_, (ucontext_func_t)ContextTrampoLine, 1, c.TrampoLine);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
inline ~TContMachineContext() {
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
inline void SwitchTo(TContMachineContext* next) noexcept {
|
|
85
|
-
swapcontext(&Ctx_, &next->Ctx_);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
private:
|
|
89
|
-
ucontext_t Ctx_;
|
|
90
|
-
};
|
|
91
|
-
#endif
|
|
92
|
-
|
|
93
|
-
#if defined(USE_GENERIC_CONT)
|
|
94
|
-
class TContMachineContext {
|
|
95
|
-
struct TImpl;
|
|
96
|
-
|
|
97
|
-
public:
|
|
98
|
-
TContMachineContext();
|
|
99
|
-
TContMachineContext(const TContClosure& c);
|
|
100
|
-
|
|
101
|
-
~TContMachineContext();
|
|
102
|
-
|
|
103
|
-
void SwitchTo(TContMachineContext* next) noexcept;
|
|
104
|
-
|
|
105
|
-
private:
|
|
106
|
-
THolder<TImpl> Impl_;
|
|
107
|
-
};
|
|
108
|
-
#endif
|
|
109
|
-
|
|
110
|
-
#if defined(USE_FIBER_CONT)
|
|
111
|
-
class TContMachineContext {
|
|
112
|
-
public:
|
|
113
|
-
TContMachineContext();
|
|
114
|
-
TContMachineContext(const TContClosure& c);
|
|
115
|
-
~TContMachineContext();
|
|
116
|
-
|
|
117
|
-
void SwitchTo(TContMachineContext* next) noexcept;
|
|
118
|
-
|
|
119
|
-
private:
|
|
120
|
-
void* Fiber_;
|
|
121
|
-
bool MainFiber_;
|
|
122
|
-
};
|
|
123
|
-
#endif
|
|
124
|
-
|
|
125
|
-
#if defined(USE_JUMP_CONT)
|
|
126
|
-
class TContMachineContext {
|
|
127
|
-
public:
|
|
128
|
-
inline TContMachineContext() {
|
|
129
|
-
Zero(Buf_);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
TContMachineContext(const TContClosure& c);
|
|
133
|
-
|
|
134
|
-
inline ~TContMachineContext() = default;
|
|
135
|
-
|
|
136
|
-
void SwitchTo(TContMachineContext* next) noexcept;
|
|
137
|
-
|
|
138
|
-
private:
|
|
139
|
-
__myjmp_buf Buf_;
|
|
140
|
-
|
|
141
|
-
struct TSan: public ITrampoLine, public ::NSan::TFiberContext {
|
|
142
|
-
TSan() noexcept;
|
|
143
|
-
TSan(const TContClosure& c) noexcept;
|
|
144
|
-
|
|
145
|
-
void DoRunNaked() override;
|
|
146
|
-
|
|
147
|
-
ITrampoLine* TL;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
#if defined(_asan_enabled_) || defined(_tsan_enabled_)
|
|
151
|
-
TSan San_;
|
|
152
|
-
#endif
|
|
153
|
-
};
|
|
154
|
-
#endif
|
|
155
|
-
|
|
156
|
-
static inline size_t MachineContextSize() noexcept {
|
|
157
|
-
return sizeof(TContMachineContext);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/*
|
|
161
|
-
* be polite
|
|
162
|
-
*/
|
|
163
|
-
#if !defined(FROM_CONTEXT_IMPL)
|
|
164
|
-
#undef USE_JUMP_CONT
|
|
165
|
-
#undef USE_FIBER_CONT
|
|
166
|
-
#undef USE_GENERIC_CONT
|
|
167
|
-
#undef USE_UCONTEXT_CONT
|
|
168
|
-
#undef PROGR_CNT
|
|
169
|
-
#undef STACK_CNT
|
|
170
|
-
#undef EXTRA_PUSH_ARGS
|
|
171
|
-
#endif
|
|
172
|
-
|
|
173
|
-
struct TExceptionSafeContext: public TContMachineContext {
|
|
174
|
-
using TContMachineContext::TContMachineContext;
|
|
175
|
-
|
|
176
|
-
void SwitchTo(TExceptionSafeContext* to) noexcept;
|
|
177
|
-
|
|
178
|
-
#if defined(_unix_)
|
|
179
|
-
void* Buf_[2] = {nullptr, nullptr};
|
|
180
|
-
#endif
|
|
181
|
-
};
|
package/inc/util/system/cpu_id.h
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include "types.h"
|
|
4
|
-
#include "compiler.h"
|
|
5
|
-
#include <util/generic/singleton.h>
|
|
6
|
-
|
|
7
|
-
#define Y_CPU_ID_ENUMERATE(F) \
|
|
8
|
-
F(SSE) \
|
|
9
|
-
F(SSE2) \
|
|
10
|
-
F(SSE3) \
|
|
11
|
-
F(SSSE3) \
|
|
12
|
-
F(SSE41) \
|
|
13
|
-
F(SSE42) \
|
|
14
|
-
F(F16C) \
|
|
15
|
-
F(POPCNT) \
|
|
16
|
-
F(BMI1) \
|
|
17
|
-
F(BMI2) \
|
|
18
|
-
F(PCLMUL) \
|
|
19
|
-
F(AES) \
|
|
20
|
-
F(AVX) \
|
|
21
|
-
F(FMA) \
|
|
22
|
-
F(AVX2) \
|
|
23
|
-
F(AVX512F) \
|
|
24
|
-
F(AVX512DQ) \
|
|
25
|
-
F(AVX512IFMA) \
|
|
26
|
-
F(AVX512PF) \
|
|
27
|
-
F(AVX512ER) \
|
|
28
|
-
F(AVX512CD) \
|
|
29
|
-
F(AVX512BW) \
|
|
30
|
-
F(AVX512VL) \
|
|
31
|
-
F(AVX512VBMI) \
|
|
32
|
-
F(PREFETCHWT1) \
|
|
33
|
-
F(SHA) \
|
|
34
|
-
F(ADX) \
|
|
35
|
-
F(RDRAND) \
|
|
36
|
-
F(RDSEED) \
|
|
37
|
-
F(PCOMMIT) \
|
|
38
|
-
F(RDTSCP) \
|
|
39
|
-
F(CLFLUSHOPT) \
|
|
40
|
-
F(CLWB) \
|
|
41
|
-
F(XSAVE) \
|
|
42
|
-
F(OSXSAVE)
|
|
43
|
-
|
|
44
|
-
#define Y_CPU_ID_ENUMERATE_OUTLINED_CACHED_DEFINE(F) \
|
|
45
|
-
F(F16C) \
|
|
46
|
-
F(BMI1) \
|
|
47
|
-
F(BMI2) \
|
|
48
|
-
F(PCLMUL) \
|
|
49
|
-
F(AES) \
|
|
50
|
-
F(AVX) \
|
|
51
|
-
F(FMA) \
|
|
52
|
-
F(AVX2) \
|
|
53
|
-
F(AVX512F) \
|
|
54
|
-
F(AVX512DQ) \
|
|
55
|
-
F(AVX512IFMA) \
|
|
56
|
-
F(AVX512PF) \
|
|
57
|
-
F(AVX512ER) \
|
|
58
|
-
F(AVX512CD) \
|
|
59
|
-
F(AVX512BW) \
|
|
60
|
-
F(AVX512VL) \
|
|
61
|
-
F(AVX512VBMI) \
|
|
62
|
-
F(PREFETCHWT1) \
|
|
63
|
-
F(SHA) \
|
|
64
|
-
F(ADX) \
|
|
65
|
-
F(RDRAND) \
|
|
66
|
-
F(RDSEED) \
|
|
67
|
-
F(PCOMMIT) \
|
|
68
|
-
F(RDTSCP) \
|
|
69
|
-
F(CLFLUSHOPT) \
|
|
70
|
-
F(CLWB) \
|
|
71
|
-
F(XSAVE) \
|
|
72
|
-
F(OSXSAVE)
|
|
73
|
-
|
|
74
|
-
namespace NX86 {
|
|
75
|
-
/**
|
|
76
|
-
* returns false on non-x86 platforms
|
|
77
|
-
*/
|
|
78
|
-
bool CpuId(ui32 op, ui32 res[4]) noexcept;
|
|
79
|
-
bool CpuId(ui32 op, ui32 subOp, ui32 res[4]) noexcept;
|
|
80
|
-
|
|
81
|
-
#define Y_DEF_NAME(X) Y_CONST_FUNCTION bool Have##X() noexcept;
|
|
82
|
-
Y_CPU_ID_ENUMERATE(Y_DEF_NAME)
|
|
83
|
-
#undef Y_DEF_NAME
|
|
84
|
-
|
|
85
|
-
#define Y_DEF_NAME(X) Y_CONST_FUNCTION bool CachedHave##X() noexcept;
|
|
86
|
-
Y_CPU_ID_ENUMERATE_OUTLINED_CACHED_DEFINE(Y_DEF_NAME)
|
|
87
|
-
#undef Y_DEF_NAME
|
|
88
|
-
|
|
89
|
-
struct TFlagsCache {
|
|
90
|
-
#define Y_DEF_NAME(X) const bool Have##X##_ = NX86::Have##X();
|
|
91
|
-
Y_CPU_ID_ENUMERATE(Y_DEF_NAME)
|
|
92
|
-
#undef Y_DEF_NAME
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
#define Y_LOOKUP_CPU_ID_IMPL(X) return SingletonWithPriority<TFlagsCache, 0>()->Have##X##_;
|
|
96
|
-
|
|
97
|
-
inline bool CachedHaveSSE() noexcept {
|
|
98
|
-
#ifdef _sse_
|
|
99
|
-
return true;
|
|
100
|
-
#else
|
|
101
|
-
Y_LOOKUP_CPU_ID_IMPL(SSE)
|
|
102
|
-
#endif
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
inline bool CachedHaveSSE2() noexcept {
|
|
107
|
-
#ifdef _sse2_
|
|
108
|
-
return true;
|
|
109
|
-
#else
|
|
110
|
-
Y_LOOKUP_CPU_ID_IMPL(SSE2)
|
|
111
|
-
#endif
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
inline bool CachedHaveSSE3() noexcept {
|
|
115
|
-
#ifdef _sse3_
|
|
116
|
-
return true;
|
|
117
|
-
#else
|
|
118
|
-
Y_LOOKUP_CPU_ID_IMPL(SSE3)
|
|
119
|
-
#endif
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
inline bool CachedHaveSSSE3() noexcept {
|
|
123
|
-
#ifdef _ssse3_
|
|
124
|
-
return true;
|
|
125
|
-
#else
|
|
126
|
-
Y_LOOKUP_CPU_ID_IMPL(SSSE3)
|
|
127
|
-
#endif
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
inline bool CachedHaveSSE41() noexcept {
|
|
131
|
-
#ifdef _sse4_1_
|
|
132
|
-
return true;
|
|
133
|
-
#else
|
|
134
|
-
Y_LOOKUP_CPU_ID_IMPL(SSE41)
|
|
135
|
-
#endif
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
inline bool CachedHaveSSE42() noexcept {
|
|
139
|
-
#ifdef _sse4_2_
|
|
140
|
-
return true;
|
|
141
|
-
#else
|
|
142
|
-
Y_LOOKUP_CPU_ID_IMPL(SSE42)
|
|
143
|
-
#endif
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
inline bool CachedHavePOPCNT() noexcept {
|
|
147
|
-
#ifdef _popcnt_
|
|
148
|
-
return true;
|
|
149
|
-
#else
|
|
150
|
-
Y_LOOKUP_CPU_ID_IMPL(POPCNT)
|
|
151
|
-
#endif
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
#undef Y_LOOKUP_CPU_ID_IMPL
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const char* CpuBrand(ui32 store[12]) noexcept;
|
package/inc/util/system/daemon.h
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
namespace NDaemonMaker {
|
|
4
|
-
enum ECloseDescriptors {
|
|
5
|
-
closeAll = 0,
|
|
6
|
-
closeStdIoOnly
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
enum EStdIoDescriptors {
|
|
10
|
-
openNone = 0,
|
|
11
|
-
openDevNull,
|
|
12
|
-
openYandexStd
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
enum EChDir {
|
|
16
|
-
chdirNone = 0,
|
|
17
|
-
chdirRoot
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
enum EParent {
|
|
21
|
-
callExitFromParent = 0,
|
|
22
|
-
returnFromParent
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
bool MakeMeDaemon(ECloseDescriptors cd = closeAll, EStdIoDescriptors iod = openDevNull, EChDir chd = chdirRoot, EParent parent = callExitFromParent);
|
|
27
|
-
void CloseFrom(int fd);
|
|
28
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include "defaults.h"
|
|
4
|
-
#include "platform.h"
|
|
5
|
-
|
|
6
|
-
#if defined(_win_)
|
|
7
|
-
#include <intrin.h>
|
|
8
|
-
#pragma intrinsic(__rdtsc)
|
|
9
|
-
#endif // _win_
|
|
10
|
-
|
|
11
|
-
#if defined(_darwin_) && !defined(_x86_)
|
|
12
|
-
#include <mach/mach_time.h>
|
|
13
|
-
#endif
|
|
14
|
-
|
|
15
|
-
/// util/system/datetime.h contains only system time providers
|
|
16
|
-
/// for handy datetime utilities include util/datetime/base.h
|
|
17
|
-
|
|
18
|
-
/// Current time in microseconds since epoch
|
|
19
|
-
ui64 MicroSeconds() noexcept;
|
|
20
|
-
/// Current time in milliseconds since epoch
|
|
21
|
-
inline ui64 MilliSeconds() {
|
|
22
|
-
return MicroSeconds() / ui64(1000);
|
|
23
|
-
}
|
|
24
|
-
/// Current time in milliseconds since epoch (deprecated, use MilliSeconds instead)
|
|
25
|
-
inline ui64 millisec() {
|
|
26
|
-
return MilliSeconds();
|
|
27
|
-
}
|
|
28
|
-
/// Current time in seconds since epoch
|
|
29
|
-
ui32 Seconds() noexcept;
|
|
30
|
-
///Current thread time in microseconds
|
|
31
|
-
ui64 ThreadCPUUserTime() noexcept;
|
|
32
|
-
ui64 ThreadCPUSystemTime() noexcept;
|
|
33
|
-
ui64 ThreadCPUTime() noexcept;
|
|
34
|
-
|
|
35
|
-
void NanoSleep(ui64 ns) noexcept;
|
|
36
|
-
|
|
37
|
-
// GetCycleCount guarantees to return synchronous values on different cores
|
|
38
|
-
// and provide constant rate only on modern Intel and AMD processors
|
|
39
|
-
// NOTE: rdtscp is used to prevent out of order execution
|
|
40
|
-
// rdtsc can be reordered, while rdtscp cannot be reordered
|
|
41
|
-
// with preceding instructions
|
|
42
|
-
// PERFORMANCE: rdtsc - 15 cycles per call , rdtscp - 19 cycles per call
|
|
43
|
-
// WARNING: following instruction can be executed out-of-order
|
|
44
|
-
Y_FORCE_INLINE ui64 GetCycleCount() noexcept {
|
|
45
|
-
#if defined(_MSC_VER)
|
|
46
|
-
// Generates the rdtscp instruction, which returns the processor time stamp.
|
|
47
|
-
// The processor time stamp records the number of clock cycles since the last reset.
|
|
48
|
-
extern const bool HaveRdtscp;
|
|
49
|
-
|
|
50
|
-
if (HaveRdtscp) {
|
|
51
|
-
unsigned int aux;
|
|
52
|
-
return __rdtscp(&aux);
|
|
53
|
-
} else {
|
|
54
|
-
return __rdtsc();
|
|
55
|
-
}
|
|
56
|
-
#elif defined(_x86_64_)
|
|
57
|
-
extern const bool HaveRdtscp;
|
|
58
|
-
|
|
59
|
-
unsigned hi, lo;
|
|
60
|
-
|
|
61
|
-
if (HaveRdtscp) {
|
|
62
|
-
__asm__ __volatile__("rdtscp"
|
|
63
|
-
: "=a"(lo), "=d"(hi)::"%rcx");
|
|
64
|
-
} else {
|
|
65
|
-
__asm__ __volatile__("rdtsc"
|
|
66
|
-
: "=a"(lo), "=d"(hi));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return ((unsigned long long)lo) | (((unsigned long long)hi) << 32);
|
|
70
|
-
#elif defined(_i386_)
|
|
71
|
-
extern const bool HaveRdtscp;
|
|
72
|
-
|
|
73
|
-
ui64 x;
|
|
74
|
-
if (HaveRdtscp) {
|
|
75
|
-
__asm__ volatile("rdtscp\n\t"
|
|
76
|
-
: "=A"(x)::"%ecx");
|
|
77
|
-
} else {
|
|
78
|
-
__asm__ volatile("rdtsc\n\t"
|
|
79
|
-
: "=A"(x));
|
|
80
|
-
}
|
|
81
|
-
return x;
|
|
82
|
-
#elif defined(_darwin_)
|
|
83
|
-
return mach_absolute_time();
|
|
84
|
-
#elif defined(__clang__) && !defined(_arm_)
|
|
85
|
-
return __builtin_readcyclecounter();
|
|
86
|
-
#elif defined(_arm32_)
|
|
87
|
-
return MicroSeconds();
|
|
88
|
-
#elif defined(_arm64_)
|
|
89
|
-
ui64 x;
|
|
90
|
-
|
|
91
|
-
__asm__ __volatile__("isb; mrs %0, cntvct_el0"
|
|
92
|
-
: "=r"(x));
|
|
93
|
-
|
|
94
|
-
return x;
|
|
95
|
-
#else
|
|
96
|
-
#error "unsupported arch"
|
|
97
|
-
#endif
|
|
98
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include "platform.h"
|
|
4
|
-
|
|
5
|
-
#if defined _unix_
|
|
6
|
-
#define LOCSLASH_C '/'
|
|
7
|
-
#define LOCSLASH_S "/"
|
|
8
|
-
#else
|
|
9
|
-
#define LOCSLASH_C '\\'
|
|
10
|
-
#define LOCSLASH_S "\\"
|
|
11
|
-
#endif // _unix_
|
|
12
|
-
|
|
13
|
-
#if defined(__INTEL_COMPILER) && defined(__cplusplus)
|
|
14
|
-
#include <new>
|
|
15
|
-
#endif
|
|
16
|
-
|
|
17
|
-
// low and high parts of integers
|
|
18
|
-
#if !defined(_win_)
|
|
19
|
-
#include <sys/param.h>
|
|
20
|
-
#endif
|
|
21
|
-
|
|
22
|
-
#if defined(BSD) || defined(_android_)
|
|
23
|
-
|
|
24
|
-
#if defined(BSD)
|
|
25
|
-
#include <machine/endian.h>
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
#if defined(_android_)
|
|
29
|
-
#include <endian.h>
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
|
33
|
-
#define _little_endian_
|
|
34
|
-
#elif (BYTE_ORDER == BIG_ENDIAN)
|
|
35
|
-
#define _big_endian_
|
|
36
|
-
#else
|
|
37
|
-
#error unknown endian not supported
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
#elif (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(WHATEVER_THAT_HAS_BIG_ENDIAN)
|
|
41
|
-
#define _big_endian_
|
|
42
|
-
#else
|
|
43
|
-
#define _little_endian_
|
|
44
|
-
#endif
|
|
45
|
-
|
|
46
|
-
// alignment
|
|
47
|
-
#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_QUADS)
|
|
48
|
-
#define _must_align8_
|
|
49
|
-
#endif
|
|
50
|
-
|
|
51
|
-
#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_LONGS)
|
|
52
|
-
#define _must_align4_
|
|
53
|
-
#endif
|
|
54
|
-
|
|
55
|
-
#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_SHORTS)
|
|
56
|
-
#define _must_align2_
|
|
57
|
-
#endif
|
|
58
|
-
|
|
59
|
-
#if defined(__GNUC__)
|
|
60
|
-
#define alias_hack __attribute__((__may_alias__))
|
|
61
|
-
#endif
|
|
62
|
-
|
|
63
|
-
#ifndef alias_hack
|
|
64
|
-
#define alias_hack
|
|
65
|
-
#endif
|
|
66
|
-
|
|
67
|
-
#include "types.h"
|
|
68
|
-
|
|
69
|
-
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
70
|
-
#define PRAGMA(x) _Pragma(#x)
|
|
71
|
-
#define RCSID(idstr) PRAGMA(comment(exestr, idstr))
|
|
72
|
-
#else
|
|
73
|
-
#define RCSID(idstr) static const char rcsid[] = idstr
|
|
74
|
-
#endif
|
|
75
|
-
|
|
76
|
-
#include "compiler.h"
|
|
77
|
-
|
|
78
|
-
#ifdef _win_
|
|
79
|
-
#include <malloc.h>
|
|
80
|
-
#elif defined(_sun_)
|
|
81
|
-
#include <alloca.h>
|
|
82
|
-
#endif
|
|
83
|
-
|
|
84
|
-
#ifdef NDEBUG
|
|
85
|
-
#define Y_IF_DEBUG(X)
|
|
86
|
-
#else
|
|
87
|
-
#define Y_IF_DEBUG(X) X
|
|
88
|
-
#endif
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @def Y_ARRAY_SIZE
|
|
92
|
-
*
|
|
93
|
-
* This macro is needed to get number of elements in a statically allocated fixed size array. The
|
|
94
|
-
* expression is a compile-time constant and therefore can be used in compile time computations.
|
|
95
|
-
*
|
|
96
|
-
* @code
|
|
97
|
-
* enum ENumbers {
|
|
98
|
-
* EN_ONE,
|
|
99
|
-
* EN_TWO,
|
|
100
|
-
* EN_SIZE
|
|
101
|
-
* }
|
|
102
|
-
*
|
|
103
|
-
* const char* NAMES[] = {
|
|
104
|
-
* "one",
|
|
105
|
-
* "two"
|
|
106
|
-
* }
|
|
107
|
-
*
|
|
108
|
-
* static_assert(Y_ARRAY_SIZE(NAMES) == EN_SIZE, "you should define `NAME` for each enumeration");
|
|
109
|
-
* @endcode
|
|
110
|
-
*
|
|
111
|
-
* This macro also catches type errors. If you see a compiler error like "warning: division by zero
|
|
112
|
-
* is undefined" when using `Y_ARRAY_SIZE` then you are probably giving it a pointer.
|
|
113
|
-
*
|
|
114
|
-
* Since all of our code is expected to work on a 64 bit platform where pointers are 8 bytes we may
|
|
115
|
-
* falsefully accept pointers to types of sizes that are divisors of 8 (1, 2, 4 and 8).
|
|
116
|
-
*/
|
|
117
|
-
#if defined(__cplusplus)
|
|
118
|
-
#include <util/generic/array_size.h>
|
|
119
|
-
#else
|
|
120
|
-
#undef Y_ARRAY_SIZE
|
|
121
|
-
#define Y_ARRAY_SIZE(arr) \
|
|
122
|
-
((sizeof(arr) / sizeof((arr)[0])) / static_cast<size_t>(!(sizeof(arr) % sizeof((arr)[0]))))
|
|
123
|
-
#endif
|
|
124
|
-
|
|
125
|
-
#undef Y_ARRAY_BEGIN
|
|
126
|
-
#define Y_ARRAY_BEGIN(arr) (arr)
|
|
127
|
-
|
|
128
|
-
#undef Y_ARRAY_END
|
|
129
|
-
#define Y_ARRAY_END(arr) ((arr) + Y_ARRAY_SIZE(arr))
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Concatenates two symbols, even if one of them is itself a macro.
|
|
133
|
-
*/
|
|
134
|
-
#define Y_CAT(X, Y) Y_CAT_I(X, Y)
|
|
135
|
-
#define Y_CAT_I(X, Y) Y_CAT_II(X, Y)
|
|
136
|
-
#define Y_CAT_II(X, Y) X##Y
|
|
137
|
-
|
|
138
|
-
#define Y_STRINGIZE(X) UTIL_PRIVATE_STRINGIZE_AUX(X)
|
|
139
|
-
#define UTIL_PRIVATE_STRINGIZE_AUX(X) #X
|
|
140
|
-
|
|
141
|
-
#if defined(__COUNTER__)
|
|
142
|
-
#define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __COUNTER__)
|
|
143
|
-
#endif
|
|
144
|
-
|
|
145
|
-
#if !defined(Y_GENERATE_UNIQUE_ID)
|
|
146
|
-
#define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __LINE__)
|
|
147
|
-
#endif
|
|
148
|
-
|
|
149
|
-
#define NPOS ((size_t)-1)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <util/generic/ptr.h>
|
|
4
|
-
#include <util/generic/string.h>
|
|
5
|
-
|
|
6
|
-
namespace NPrivate {
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* cxxabi::__cxa_demangle (and thus TCppDemanger) have terrible memory ownership model.
|
|
10
|
-
*
|
|
11
|
-
* Consider using CppDemangle instead. It is slow, but robust.
|
|
12
|
-
*/
|
|
13
|
-
class TCppDemangler {
|
|
14
|
-
public:
|
|
15
|
-
const char* Demangle(const char* name);
|
|
16
|
-
|
|
17
|
-
private:
|
|
18
|
-
THolder<char, TFree> TmpBuf_;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
} //namespace NPrivate
|
|
22
|
-
|
|
23
|
-
|