├── LICENSE ├── Makefile ├── README.md ├── Switch ├── README.md ├── ansifmt.h ├── base64.cpp ├── base64.h ├── buffer.h ├── compress.h ├── data.cpp ├── data.h ├── date.h ├── ext │ ├── .travis.yml │ ├── FastPFor │ │ ├── .travis.yml │ │ ├── CHANGELOG │ │ ├── CMakeCache.txt │ │ ├── CMakeFiles │ │ │ ├── 3.5.1 │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ ├── CompilerIdC │ │ │ │ │ └── CMakeCCompilerId.c │ │ │ │ └── CompilerIdCXX │ │ │ │ │ └── CMakeCXXCompilerId.cpp │ │ │ ├── CMakeDirectoryInformation.cmake │ │ │ ├── CMakeOutput.log │ │ │ ├── CMakeRuleHashes.txt │ │ │ ├── FastPFor.dir │ │ │ │ ├── C.includecache │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── cmake_clean_target.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── Makefile.cmake │ │ │ ├── Makefile2 │ │ │ ├── TargetDirectories.txt │ │ │ ├── benchbitpacking.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── check.dir │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ └── progress.make │ │ │ ├── cmake.check_cache │ │ │ ├── codecs.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── csv2maropu.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── entropy.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── example.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── feature_tests.bin │ │ │ ├── feature_tests.c │ │ │ ├── feature_tests.cxx │ │ │ ├── gapstats.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── inmemorybenchmark.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── partitionbylength.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ │ ├── progress.marks │ │ │ └── unit.dir │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ └── progress.make │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── TODO.md │ │ ├── benchbitpacking │ │ ├── cmake_install.cmake │ │ ├── cmake_modules │ │ │ ├── AppendCompilerFlags.cmake │ │ │ ├── DetectCPUFeatures.cmake │ │ │ └── Findsnappy.cmake │ │ ├── codecs │ │ ├── csv2maropu │ │ ├── data │ │ │ ├── ClueWeb09LogSizeFreqs.1 │ │ │ └── README │ │ ├── entropy │ │ ├── example │ │ ├── example.cpp │ │ ├── gapstats │ │ ├── headers │ │ │ ├── VarIntG8IU.h │ │ │ ├── bitpacking.h │ │ │ ├── bitpackingaligned.h │ │ │ ├── bitpackinghelpers.h │ │ │ ├── bitpackingunaligned.h │ │ │ ├── blockpacking.h │ │ │ ├── codecfactory.h │ │ │ ├── codecs.h │ │ │ ├── common.h │ │ │ ├── compositecodec.h │ │ │ ├── cpubenchmark.h │ │ │ ├── csv.h │ │ │ ├── deltautil.h │ │ │ ├── entropy.h │ │ │ ├── externalvector.h │ │ │ ├── fastpfor.h │ │ │ ├── horizontalbitpacking.h │ │ │ ├── maropuparser.h │ │ │ ├── memutil.h │ │ │ ├── mersenne.h │ │ │ ├── newpfor.h │ │ │ ├── optpfor.h │ │ │ ├── packingvectors.h │ │ │ ├── pfor.h │ │ │ ├── pfor2008.h │ │ │ ├── rolledbitpacking.h │ │ │ ├── simdbinarypacking.h │ │ │ ├── simdbitpacking.h │ │ │ ├── simdfastpfor.h │ │ │ ├── simdnewpfor.h │ │ │ ├── simdoptpfor.h │ │ │ ├── simdpfor.h │ │ │ ├── simdvariablebyte.h │ │ │ ├── simple16.h │ │ │ ├── simple8b.h │ │ │ ├── simple8b_rle.h │ │ │ ├── simple9.h │ │ │ ├── simple9_rle.h │ │ │ ├── snappydelta.h │ │ │ ├── streamvariablebyte.h │ │ │ ├── stringutil.h │ │ │ ├── synthetic.h │ │ │ ├── usimdbitpacking.h │ │ │ ├── util.h │ │ │ ├── variablebyte.h │ │ │ ├── varintgb.h │ │ │ ├── vsencoding.h │ │ │ └── ztimer.h │ │ ├── inmemorybenchmark │ │ ├── msvc │ │ │ ├── FastPFor.sln │ │ │ ├── FastPFor.vcxproj │ │ │ ├── benchbitpacking.vcxproj │ │ │ ├── codecs.vcxproj │ │ │ ├── csv2maropu.vcxproj │ │ │ ├── entropy.vcxproj │ │ │ ├── example.vcxproj │ │ │ ├── gapstats.vcxproj │ │ │ ├── getopt.vcxproj │ │ │ ├── getopt │ │ │ │ ├── getopt.c │ │ │ │ └── getopt.h │ │ │ ├── inmemorybenchmark.vcxproj │ │ │ └── unit.vcxproj │ │ ├── partitionbylength │ │ ├── src │ │ │ ├── benchbitpacking.cpp │ │ │ ├── bitpacking.cpp │ │ │ ├── bitpackingaligned.cpp │ │ │ ├── bitpackingunaligned.cpp │ │ │ ├── codecs.cpp │ │ │ ├── csv2maropu.cpp │ │ │ ├── entropy.cpp │ │ │ ├── gapstats.cpp │ │ │ ├── horizontalbitpacking.cpp │ │ │ ├── inmemorybenchmark.cpp │ │ │ ├── partitionbylength.cpp │ │ │ ├── simdbitpacking.cpp │ │ │ ├── simdunalignedbitpacking.cpp │ │ │ ├── streamvbyte.c │ │ │ ├── unit.cpp │ │ │ └── varintdecode.c │ │ ├── tools │ │ │ └── clang-format.sh │ │ └── unit │ ├── ext_xxhash.c │ ├── flat_hash_map.h │ ├── json.hpp │ └── tl │ │ └── optional.hpp ├── ext_snappy │ ├── Makefile │ ├── config.h │ ├── snappy-internal.h │ ├── snappy-sinksource.cc │ ├── snappy-sinksource.h │ ├── snappy-stubs-internal.cc │ ├── snappy-stubs-internal.h │ ├── snappy-stubs-public.h │ ├── snappy-test.h │ ├── snappy.cc │ └── snappy.h ├── fs.h ├── network.h ├── portability.h ├── prioqueue.h ├── sparsefixedbitset.h ├── switch.h ├── switch_algorithms.h ├── switch_atomicops.h ├── switch_bitops.h ├── switch_common.h ├── switch_compiler_aux.h ├── switch_dictionary.h ├── switch_exceptions.h ├── switch_hash.h ├── switch_ll.h ├── switch_mallocators.h ├── switch_numops.h ├── switch_print.h ├── switch_ranges.h ├── switch_refcnt.h ├── switch_security.cpp ├── switch_security.h ├── switch_vector.h ├── text.cpp ├── text.h ├── thread.h └── timings.h ├── kms_client.cpp ├── kms_client.h ├── service.cpp └── sss ├── .editorconfig ├── LICENSE ├── Makefile ├── README.md ├── hazmat.c ├── hazmat.h ├── randombytes.c ├── randombytes.h ├── randombytes ├── .editorconfig ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── appveyor.yml ├── randombytes.c ├── randombytes.h └── test.c ├── sss.c ├── sss.h ├── test_hazmat.c ├── test_sss.c ├── tweetnacl.c └── tweetnacl.h /Makefile: -------------------------------------------------------------------------------- 1 | HOST:=$(shell hostname) 2 | 3 | ifeq ($(HOST), origin) 4 | # running one our development machine 5 | include /home/system/Development/Switch/Makefile.dfl 6 | CXXFLAGS=$(CPPFLAGS_SANITY_DEBUG) -I./sss/ 7 | EOBJS:= 8 | LDFLAGS:=-lswitch 9 | CLEANUP_EXTRA:= 10 | # Explicitly using a mySQL 5.7+ distribution client for <=5.6 distribution clients 11 | # can't connect to mySQL servers via SSL 12 | MYSQL_LIBS:=/usr/local/mysql-57/lib/libmysqlclient.a 13 | TARGETS:=service client 14 | else 15 | CC:=clang 16 | CXX:=clang++ 17 | CC:=$(CXX) # use clang++ for compiling c modules as well, because, syms.resolver 18 | CXXFLAGS:=-std=c++1z -Wall -I./Switch/ -DSWITCH_MIN -Wno-unknown-pragmas -Wno-undefined-inline -Ofast 19 | CFLAGS:=-xc++ -Ofast 20 | LDFLAGS_TLS:=-ldl -lssl -lcrypto 21 | LDFLAGS_SANITY:= 22 | LDFLAGS:= 23 | EOBJS:=Switch/text.o Switch/ext/ext_xxhash.o Switch/base64.o Switch/data.o Switch/switch_security.o 24 | MYSQL_LIBS:=-lmysqlclient 25 | CLEANUP_EXTRA:=rm -f $(EOBJS) 26 | # We are only going to build service for now, not the C++ client, which depends on all kind of various Switch modules 27 | # Will be enabled later though 28 | TARGETS:=service 29 | endif 30 | 31 | all: $(TARGETS) 32 | 33 | service: $(EOBJS) service.o 34 | make -C sss/ libsss.a 35 | $(CC) service.o $(EOBJS) -o kms $(LDFLAGS_SANITY) $(LDFLAGS) -pthread $(LDFLAGS_TLS) $(MYSQL_LIBS) sss/libsss.a 36 | 37 | client: kms_client.o 38 | ar rcs libkms.a kms_client.o 39 | 40 | clean: 41 | rm -f *.o kms 42 | $(CLEANUP_EXTRA) 43 | 44 | .o: .cpp 45 | 46 | .PHONY: clean 47 | -------------------------------------------------------------------------------- /Switch/README.md: -------------------------------------------------------------------------------- 1 | This is a very leak distribution of Switch; it includes the absolute minimum code for this project. 2 | Eventually, we plan to OSS all Switch. Switch is similar in scope and goals to Facebook's Folly library. 3 | 4 | Most of the methods and datastructures here are either wrappers for STL equivalent classes/functions, or are very trimmed down constructs written so that this project can be compiled with them. 5 | -------------------------------------------------------------------------------- /Switch/ansifmt.h: -------------------------------------------------------------------------------- 1 | // http://en.wikipedia.org/wiki/ANSI_escape_code 2 | #pragma once 3 | 4 | namespace ansifmt 5 | { 6 | // http://en.wikipedia.org/wiki/ANSI_escape_code 7 | static constexpr const char *bold = "\033[1m"; 8 | static constexpr const char *reset = "\033[0m"; 9 | static constexpr const char *inverse = "\033[3m"; 10 | 11 | static constexpr const char *color_black = "\033[30m"; 12 | static constexpr const char *color_red = "\033[31m"; 13 | static constexpr const char *color_green = "\033[32m"; 14 | static constexpr const char *color_brown = "\033[33m"; 15 | static constexpr const char *color_blue = "\033[34m"; 16 | static constexpr const char *color_magenta = "\033[35m"; 17 | static constexpr const char *color_cyan = "\033[36m"; 18 | static constexpr const char *color_gray = "\033[37m"; 19 | 20 | 21 | static constexpr const char *bgcolor_black = "\033[40m"; 22 | static constexpr const char *bgcolor_red = "\033[41m"; 23 | static constexpr const char *bgcolor_green = "\033[42m"; 24 | static constexpr const char *bgcolor_brown = "\033[43m"; 25 | static constexpr const char *bgcolor_blue = "\033[44m"; 26 | static constexpr const char *bgcolor_magenta = "\033[45m"; 27 | static constexpr const char *bgcolor_cyan = "\033[46m"; 28 | static constexpr const char *bgcolor_gray = "\033[47m"; 29 | static constexpr const char *cls = "\033[2J\033[1;1H"; 30 | 31 | // http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html 32 | struct set_col 33 | { 34 | const uint32_t column; 35 | 36 | set_col(const uint32_t v) 37 | : column{v} 38 | { 39 | 40 | } 41 | }; 42 | }; 43 | 44 | [[maybe_unused]] static void PrintImpl(Buffer &out, const ansifmt::set_col &c) 45 | { 46 | // We need to reset to 0 first with \r and then advance 47 | // maybe there's another escape sequence for explicitly setting the column 48 | out.AppendFmt("\r\033\[<%uC", c.column); 49 | } 50 | -------------------------------------------------------------------------------- /Switch/base64.cpp: -------------------------------------------------------------------------------- 1 | #include "switch.h" 2 | #include "base64.h" 3 | 4 | std::size_t Base64::decoded_repr_length(const str_view32 s) { 5 | size_t l = s.size(), padding; 6 | 7 | if (l && s.data()[l - 1] == '=') { 8 | if (l >= 2 && s.data()[l - 2] == '=') 9 | padding = 2; 10 | else 11 | padding = 1; 12 | } 13 | padding = 0; 14 | 15 | return (l * 3) / 4 - padding; 16 | } 17 | 18 | uint16_t b64_int(const uint8_t c) noexcept { 19 | if (c == 43) 20 | return 62; 21 | else if (c == 47) 22 | return 63; 23 | else if (c == 61) 24 | return 64; 25 | else if (c > 47 && c < 58) 26 | return c + 4; 27 | else if (c > 64 && c < 91) 28 | return c - 'A'; 29 | else if (c > 96 && c < 123) 30 | return (c - 'a') + 26; 31 | else 32 | return 256; 33 | } 34 | 35 | uint32_t Base64::Encode(const uint8_t *in, size_t in_len, Buffer *out) { 36 | static constexpr const char *b64_chr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 37 | uint32_t s[3], j{0}; 38 | const auto saved{out->size()}; 39 | 40 | for (uint32_t i{0}; i != in_len; ++i) { 41 | s[j++] = in[i]; 42 | 43 | if (j == 3) { 44 | uint8_t o[4]; 45 | 46 | o[0] = b64_chr[(s[0] & 255) >> 2]; 47 | o[1] = b64_chr[((s[0] & 0x03) << 4) + ((s[1] & 0xF0) >> 4)]; 48 | o[2] = b64_chr[((s[1] & 0x0F) << 2) + ((s[2] & 0xC0) >> 6)]; 49 | o[3] = b64_chr[s[2] & 0x3F]; 50 | j = 0; 51 | 52 | out->append(str_view32(reinterpret_cast(o), 4)); 53 | } 54 | } 55 | 56 | if (j) { 57 | uint8_t o[4]; 58 | 59 | if (j == 1) 60 | s[1] = 0; 61 | 62 | o[0] = b64_chr[(s[0] & 255) >> 2]; 63 | o[1] = b64_chr[((s[0] & 0x03) << 4) + ((s[1] & 0xF0) >> 4)]; 64 | 65 | if (j == 2) 66 | o[2] = b64_chr[((s[1] & 0x0F) << 2)]; 67 | else 68 | o[2] = '='; 69 | 70 | o[3] = '='; 71 | 72 | out->append(str_view32(reinterpret_cast(o), 4)); 73 | } 74 | 75 | return out->size() - saved; 76 | } 77 | 78 | int32_t Base64::Decode(const uint8_t *in, const size_t in_len, Buffer *out) { 79 | uint32_t s[4], j{0}; 80 | const auto saved{out->size()}; 81 | 82 | for (uint32_t i{0}; i < in_len; i++) { 83 | if (const auto v = b64_int(in[i]); v == 256) 84 | return -1; 85 | else 86 | s[j++] = v; 87 | 88 | if (j == 4) { 89 | uint8_t k{0}, o[4]; 90 | 91 | o[0] = ((s[0] & 255) << 2) + ((s[1] & 0x30) >> 4); 92 | if (s[2] != 64) { 93 | o[1] = ((s[1] & 0x0F) << 4) + ((s[2] & 0x3C) >> 2); 94 | 95 | if ((s[3] != 64)) { 96 | o[2] = ((s[2] & 0x03) << 6) + (s[3]); 97 | k = 3; 98 | } else { 99 | k = 2; 100 | } 101 | } else { 102 | k = 1; 103 | } 104 | 105 | out->append(str_view32(reinterpret_cast(o), k)); 106 | j = 0; 107 | } 108 | } 109 | 110 | return out->size() - saved; 111 | } 112 | -------------------------------------------------------------------------------- /Switch/base64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "switch.h" 3 | #include "buffer.h" 4 | #include 5 | #include 6 | 7 | static inline bool is_base64(const uint8_t c) noexcept 8 | { 9 | return c == '+' || c == '/' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); 10 | } 11 | 12 | 13 | namespace Base64 14 | { 15 | size_t decoded_repr_length(const str_view32 s); 16 | 17 | uint32_t Encode(const uint8_t *in, size_t in_len, Buffer *out); 18 | 19 | int32_t Decode(const uint8_t *in, const size_t in_len, Buffer *out); 20 | } 21 | -------------------------------------------------------------------------------- /Switch/date.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Date 4 | { 5 | struct ts_repr 6 | { 7 | const time_t t; 8 | 9 | ts_repr(const time_t v) 10 | : t{v} 11 | { 12 | } 13 | 14 | strwlen8_t Get(char *const out) const 15 | { 16 | struct tm tm; 17 | 18 | localtime_r(&t, &tm); 19 | return strwlen8_t(out, sprintf(out, "%02u.%02u.%02u %02u:%02u:%02u", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec)); 20 | } 21 | }; 22 | } 23 | 24 | static inline void PrintImpl(Buffer &out, const Date::ts_repr &r) 25 | { 26 | struct tm tm; 27 | 28 | localtime_r(&r.t, &tm); 29 | out.AppendFmt("%02u.%02u.%02u %02u:%02u:%02u", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); 30 | } 31 | -------------------------------------------------------------------------------- /Switch/ext/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | sudo: false 3 | compiler: 4 | - clang 5 | 6 | script: cmake . && make && ./unit 7 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | sudo: false 3 | compiler: 4 | - clang 5 | 6 | script: cmake . && make && ./unit 7 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CHANGELOG: -------------------------------------------------------------------------------- 1 | 0.1.6 April 14th 2016 2 | FastPFOR and SIMDFastPFOR updated to use 512-int blocks (like JavaFastPFOR) 3 | Added SIMDSimplePFOR 4 | Added MaskedVByte 5 | Added StreamVByte 6 | More verbose error messages 7 | 0.1.5 August 21st 2014 8 | Added SIMD versions of OptPFD and NewPFD. 9 | Fixed buffer overrun in varintg8iu 10 | Factor out decodeBlock method from decodeArray (Matthias Petri) 11 | Renamed the FastPfor namespace FastPforLib to avoid name clash 12 | 0.1.4 May 21st 2014 13 | Added "myths" section to README file 14 | 0.1.3 January 22nd 2014 15 | Various minor fixes 16 | 0.1.2 January 22nd 2014 17 | Namespace fixes (Andrea Bedini) 18 | 0.1.1 December 29th 2013 19 | Bug fix in SimplePFOR 20 | 0.1.0 December 3rd 2013 21 | This is the first stable release. Code has been available for nearly a year ago and it has been well tested. 22 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "5.4.1") 5 | set(CMAKE_C_COMPILER_WRAPPER "") 6 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 7 | set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") 8 | set(CMAKE_C90_COMPILE_FEATURES "c_function_prototypes") 9 | set(CMAKE_C99_COMPILE_FEATURES "c_restrict;c_variadic_macros") 10 | set(CMAKE_C11_COMPILE_FEATURES "c_static_assert") 11 | 12 | set(CMAKE_C_PLATFORM_ID "Linux") 13 | set(CMAKE_C_SIMULATE_ID "") 14 | set(CMAKE_C_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/usr/bin/ar") 17 | set(CMAKE_RANLIB "/usr/bin/ranlib") 18 | set(CMAKE_LINKER "/usr/bin/ld") 19 | set(CMAKE_COMPILER_IS_GNUCC 1) 20 | set(CMAKE_C_COMPILER_LOADED 1) 21 | set(CMAKE_C_COMPILER_WORKS TRUE) 22 | set(CMAKE_C_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_C_COMPILER_ID_RUN 1) 36 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 37 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 38 | set(CMAKE_C_LINKER_PREFERENCE 10) 39 | 40 | # Save compiler ABI information. 41 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 42 | set(CMAKE_C_COMPILER_ABI "ELF") 43 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 44 | 45 | if(CMAKE_C_SIZEOF_DATA_PTR) 46 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 47 | endif() 48 | 49 | if(CMAKE_C_COMPILER_ABI) 50 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 51 | endif() 52 | 53 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 54 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 55 | endif() 56 | 57 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 58 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 59 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 60 | endif() 61 | 62 | 63 | 64 | 65 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") 66 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 67 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 68 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/3.5.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-4.4.0-28-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-28-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-4.4.0-28-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "4.4.0-28-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/CMakeRuleHashes.txt: -------------------------------------------------------------------------------- 1 | # Hashes of file build rules. 2 | 89dcfb7a8ad6f50823da9a6c6d234b05 CMakeFiles/check 3 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/C.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/streamvbyte.c 10 | intrin.h 11 | - 12 | iso646.h 13 | - 14 | stdint.h 15 | - 16 | x86intrin.h 17 | - 18 | arm_neon.h 19 | - 20 | mmintrin.h 21 | - 22 | altivec.h 23 | - 24 | spe.h 25 | - 26 | stdint.h 27 | - 28 | stdio.h 29 | - 30 | stdlib.h 31 | - 32 | assert.h 33 | - 34 | string.h 35 | - 36 | /opt/intel/iaca/include/iacaMarks.h 37 | - 38 | 39 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/varintdecode.c 40 | intrin.h 41 | - 42 | x86intrin.h 43 | - 44 | arm_neon.h 45 | - 46 | mmintrin.h 47 | - 48 | altivec.h 49 | - 50 | spe.h 51 | - 52 | stdint.h 53 | - 54 | stdio.h 55 | - 56 | 57 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpacking.cpp 10 | bitpacking.h 11 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpacking.h 12 | 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingaligned.cpp 14 | bitpackingaligned.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingaligned.h 16 | 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingunaligned.cpp 18 | exception 19 | - 20 | bitpackingunaligned.h 21 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingunaligned.h 22 | 23 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/horizontalbitpacking.cpp 24 | horizontalbitpacking.h 25 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/horizontalbitpacking.h 26 | 27 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdbitpacking.cpp 28 | simdbitpacking.h 29 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdbitpacking.h 30 | 31 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdunalignedbitpacking.cpp 32 | usimdbitpacking.h 33 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/usimdbitpacking.h 34 | 35 | headers/bitpacking.h 36 | common.h 37 | headers/common.h 38 | 39 | headers/bitpackingaligned.h 40 | common.h 41 | headers/common.h 42 | 43 | headers/bitpackingunaligned.h 44 | common.h 45 | headers/common.h 46 | 47 | headers/common.h 48 | errno.h 49 | - 50 | fcntl.h 51 | - 52 | immintrin.h 53 | - 54 | stdio.h 55 | - 56 | stdlib.h 57 | - 58 | string.h 59 | - 60 | sys/mman.h 61 | - 62 | sys/resource.h 63 | - 64 | sys/stat.h 65 | - 66 | sys/time.h 67 | - 68 | sys/types.h 69 | - 70 | time.h 71 | - 72 | algorithm 73 | - 74 | cassert 75 | - 76 | chrono 77 | - 78 | cmath 79 | - 80 | cstdint 81 | - 82 | fstream 83 | - 84 | iomanip 85 | - 86 | iostream 87 | - 88 | map 89 | - 90 | memory 91 | - 92 | numeric 93 | - 94 | queue 95 | - 96 | set 97 | - 98 | sstream 99 | - 100 | stdexcept 101 | - 102 | string 103 | - 104 | unordered_map 105 | - 106 | unordered_set 107 | - 108 | iso646.h 109 | - 110 | stdint.h 111 | - 112 | intrin.h 113 | - 114 | 115 | headers/horizontalbitpacking.h 116 | common.h 117 | headers/common.h 118 | 119 | headers/simdbitpacking.h 120 | common.h 121 | headers/common.h 122 | 123 | headers/usimdbitpacking.h 124 | common.h 125 | headers/common.h 126 | 127 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "C" 4 | "CXX" 5 | ) 6 | # The set of files for implicit dependencies of each language: 7 | set(CMAKE_DEPENDS_CHECK_C 8 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/streamvbyte.c" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/streamvbyte.c.o" 9 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/varintdecode.c" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/varintdecode.c.o" 10 | ) 11 | set(CMAKE_C_COMPILER_ID "GNU") 12 | 13 | # The include file search paths: 14 | set(CMAKE_C_TARGET_INCLUDE_PATH 15 | "headers" 16 | ) 17 | set(CMAKE_DEPENDS_CHECK_CXX 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpacking.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o" 19 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingaligned.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o" 20 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingunaligned.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o" 21 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/horizontalbitpacking.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o" 22 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdbitpacking.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o" 23 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdunalignedbitpacking.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o" 24 | ) 25 | set(CMAKE_CXX_COMPILER_ID "GNU") 26 | 27 | # The include file search paths: 28 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 29 | "headers" 30 | ) 31 | 32 | # Targets to which this target links. 33 | set(CMAKE_TARGET_LINKED_INFO_FILES 34 | ) 35 | 36 | # Fortran module output directory. 37 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 38 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o" 3 | "CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o" 4 | "CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o" 5 | "CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o" 6 | "CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o" 7 | "CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o" 8 | "CMakeFiles/FastPFor.dir/src/varintdecode.c.o" 9 | "CMakeFiles/FastPFor.dir/src/streamvbyte.c.o" 10 | "libFastPFor.pdb" 11 | "libFastPFor.a" 12 | ) 13 | 14 | # Per-language clean rules from dependency scanning. 15 | foreach(lang C CXX) 16 | include(CMakeFiles/FastPFor.dir/cmake_clean_${lang}.cmake OPTIONAL) 17 | endforeach() 18 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libFastPFor.a" 3 | ) 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/FastPFor.dir/src/streamvbyte.c.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/streamvbyte.c 6 | CMakeFiles/FastPFor.dir/src/varintdecode.c.o 7 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/varintdecode.c 8 | CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpacking.cpp 10 | headers/bitpacking.h 11 | headers/common.h 12 | CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingaligned.cpp 14 | headers/bitpackingaligned.h 15 | headers/common.h 16 | CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackingunaligned.cpp 18 | headers/bitpackingunaligned.h 19 | headers/common.h 20 | CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o 21 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/horizontalbitpacking.cpp 22 | headers/common.h 23 | headers/horizontalbitpacking.h 24 | CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o 25 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdbitpacking.cpp 26 | headers/common.h 27 | headers/simdbitpacking.h 28 | CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o 29 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdunalignedbitpacking.cpp 30 | headers/common.h 31 | headers/usimdbitpacking.h 32 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/FastPFor.dir/src/streamvbyte.c.o: src/streamvbyte.c 5 | 6 | CMakeFiles/FastPFor.dir/src/varintdecode.c.o: src/varintdecode.c 7 | 8 | CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o: src/bitpacking.cpp 9 | CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o: headers/bitpacking.h 10 | CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o: headers/common.h 11 | 12 | CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o: src/bitpackingaligned.cpp 13 | CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o: headers/bitpackingaligned.h 14 | CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o: headers/common.h 15 | 16 | CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o: src/bitpackingunaligned.cpp 17 | CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o: headers/bitpackingunaligned.h 18 | CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o: headers/common.h 19 | 20 | CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o: src/horizontalbitpacking.cpp 21 | CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o: headers/common.h 22 | CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o: headers/horizontalbitpacking.h 23 | 24 | CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o: src/simdbitpacking.cpp 25 | CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o: headers/common.h 26 | CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o: headers/simdbitpacking.h 27 | 28 | CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o: src/simdunalignedbitpacking.cpp 29 | CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o: headers/common.h 30 | CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o: headers/usimdbitpacking.h 31 | 32 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile C with /usr/bin/cc 5 | # compile CXX with /usr/bin/c++ 6 | C_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c99 -march=native 7 | 8 | C_DEFINES = 9 | 10 | C_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 11 | 12 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 13 | 14 | CXX_DEFINES = 15 | 16 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 17 | 18 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/ar qc libFastPFor.a CMakeFiles/FastPFor.dir/src/bitpacking.cpp.o CMakeFiles/FastPFor.dir/src/bitpackingaligned.cpp.o CMakeFiles/FastPFor.dir/src/bitpackingunaligned.cpp.o CMakeFiles/FastPFor.dir/src/horizontalbitpacking.cpp.o CMakeFiles/FastPFor.dir/src/simdunalignedbitpacking.cpp.o CMakeFiles/FastPFor.dir/src/simdbitpacking.cpp.o CMakeFiles/FastPFor.dir/src/varintdecode.c.o CMakeFiles/FastPFor.dir/src/streamvbyte.c.o 2 | /usr/bin/ranlib libFastPFor.a 3 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | CMAKE_PROGRESS_4 = 4 5 | CMAKE_PROGRESS_5 = 5 6 | CMAKE_PROGRESS_6 = 6 7 | CMAKE_PROGRESS_7 = 7 8 | CMAKE_PROGRESS_8 = 8 9 | CMAKE_PROGRESS_9 = 9 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "CMakeFiles/3.5.1/CMakeCCompiler.cmake" 11 | "CMakeFiles/3.5.1/CMakeCXXCompiler.cmake" 12 | "CMakeFiles/3.5.1/CMakeSystem.cmake" 13 | "CMakeLists.txt" 14 | "cmake_modules/AppendCompilerFlags.cmake" 15 | "cmake_modules/DetectCPUFeatures.cmake" 16 | "cmake_modules/Findsnappy.cmake" 17 | "/usr/share/cmake-3.5/Modules/CMakeCInformation.cmake" 18 | "/usr/share/cmake-3.5/Modules/CMakeCXXInformation.cmake" 19 | "/usr/share/cmake-3.5/Modules/CMakeCommonLanguageInclude.cmake" 20 | "/usr/share/cmake-3.5/Modules/CMakeGenericSystem.cmake" 21 | "/usr/share/cmake-3.5/Modules/CMakeLanguageInformation.cmake" 22 | "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInformation.cmake" 23 | "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInitialize.cmake" 24 | "/usr/share/cmake-3.5/Modules/CheckCSourceCompiles.cmake" 25 | "/usr/share/cmake-3.5/Modules/CheckCXXSourceCompiles.cmake" 26 | "/usr/share/cmake-3.5/Modules/Compiler/GNU-C.cmake" 27 | "/usr/share/cmake-3.5/Modules/Compiler/GNU-CXX.cmake" 28 | "/usr/share/cmake-3.5/Modules/Compiler/GNU.cmake" 29 | "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-C.cmake" 30 | "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-CXX.cmake" 31 | "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU.cmake" 32 | "/usr/share/cmake-3.5/Modules/Platform/Linux.cmake" 33 | "/usr/share/cmake-3.5/Modules/Platform/UnixPaths.cmake" 34 | ) 35 | 36 | # The corresponding makefile is: 37 | set(CMAKE_MAKEFILE_OUTPUTS 38 | "Makefile" 39 | "CMakeFiles/cmake.check_cache" 40 | ) 41 | 42 | # Byproducts of CMake generate step: 43 | set(CMAKE_MAKEFILE_PRODUCTS 44 | "CMakeFiles/CMakeDirectoryInformation.cmake" 45 | ) 46 | 47 | # Dependency information for all targets: 48 | set(CMAKE_DEPEND_INFO_FILES 49 | "CMakeFiles/unit.dir/DependInfo.cmake" 50 | "CMakeFiles/example.dir/DependInfo.cmake" 51 | "CMakeFiles/inmemorybenchmark.dir/DependInfo.cmake" 52 | "CMakeFiles/codecs.dir/DependInfo.cmake" 53 | "CMakeFiles/gapstats.dir/DependInfo.cmake" 54 | "CMakeFiles/FastPFor.dir/DependInfo.cmake" 55 | "CMakeFiles/check.dir/DependInfo.cmake" 56 | "CMakeFiles/csv2maropu.dir/DependInfo.cmake" 57 | "CMakeFiles/entropy.dir/DependInfo.cmake" 58 | "CMakeFiles/partitionbylength.dir/DependInfo.cmake" 59 | "CMakeFiles/benchbitpacking.dir/DependInfo.cmake" 60 | ) 61 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/rebuild_cache.dir 2 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/unit.dir 3 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/example.dir 4 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/codecs.dir 6 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/gapstats.dir 7 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir 8 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/check.dir 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir 10 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/edit_cache.dir 11 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/entropy.dir 12 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir 14 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/benchbitpacking.cpp 10 | exception 11 | - 12 | iostream 13 | - 14 | iomanip 15 | - 16 | vector 17 | - 18 | util.h 19 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/util.h 20 | bitpackinghelpers.h 21 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/bitpackinghelpers.h 22 | simdbitpacking.h 23 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/simdbitpacking.h 24 | rolledbitpacking.h 25 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/rolledbitpacking.h 26 | synthetic.h 27 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/synthetic.h 28 | ztimer.h 29 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/ztimer.h 30 | horizontalbitpacking.h 31 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/horizontalbitpacking.h 32 | 33 | headers/bitpacking.h 34 | common.h 35 | headers/common.h 36 | 37 | headers/bitpackinghelpers.h 38 | bitpacking.h 39 | headers/bitpacking.h 40 | 41 | headers/common.h 42 | errno.h 43 | - 44 | fcntl.h 45 | - 46 | immintrin.h 47 | - 48 | stdio.h 49 | - 50 | stdlib.h 51 | - 52 | string.h 53 | - 54 | sys/mman.h 55 | - 56 | sys/resource.h 57 | - 58 | sys/stat.h 59 | - 60 | sys/time.h 61 | - 62 | sys/types.h 63 | - 64 | time.h 65 | - 66 | algorithm 67 | - 68 | cassert 69 | - 70 | chrono 71 | - 72 | cmath 73 | - 74 | cstdint 75 | - 76 | fstream 77 | - 78 | iomanip 79 | - 80 | iostream 81 | - 82 | map 83 | - 84 | memory 85 | - 86 | numeric 87 | - 88 | queue 89 | - 90 | set 91 | - 92 | sstream 93 | - 94 | stdexcept 95 | - 96 | string 97 | - 98 | unordered_map 99 | - 100 | unordered_set 101 | - 102 | iso646.h 103 | - 104 | stdint.h 105 | - 106 | intrin.h 107 | - 108 | 109 | headers/horizontalbitpacking.h 110 | common.h 111 | headers/common.h 112 | 113 | headers/memutil.h 114 | common.h 115 | headers/common.h 116 | 117 | headers/mersenne.h 118 | common.h 119 | headers/common.h 120 | util.h 121 | headers/util.h 122 | 123 | headers/rolledbitpacking.h 124 | exception 125 | - 126 | common.h 127 | headers/common.h 128 | util.h 129 | headers/util.h 130 | 131 | headers/simdbitpacking.h 132 | common.h 133 | headers/common.h 134 | 135 | headers/synthetic.h 136 | vector 137 | - 138 | set 139 | - 140 | common.h 141 | headers/common.h 142 | util.h 143 | headers/util.h 144 | mersenne.h 145 | headers/mersenne.h 146 | memutil.h 147 | headers/memutil.h 148 | 149 | headers/util.h 150 | common.h 151 | headers/common.h 152 | 153 | headers/ztimer.h 154 | common.h 155 | headers/common.h 156 | windows.h 157 | - 158 | 159 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/benchbitpacking.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o" 3 | "benchbitpacking.pdb" 4 | "benchbitpacking" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/benchbitpacking.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/benchbitpacking.cpp 6 | headers/bitpacking.h 7 | headers/bitpackinghelpers.h 8 | headers/common.h 9 | headers/horizontalbitpacking.h 10 | headers/memutil.h 11 | headers/mersenne.h 12 | headers/rolledbitpacking.h 13 | headers/simdbitpacking.h 14 | headers/synthetic.h 15 | headers/util.h 16 | headers/ztimer.h 17 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: src/benchbitpacking.cpp 5 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/bitpacking.h 6 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/bitpackinghelpers.h 7 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/common.h 8 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/horizontalbitpacking.h 9 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/memutil.h 10 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/mersenne.h 11 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/rolledbitpacking.h 12 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/simdbitpacking.h 13 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/synthetic.h 14 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/util.h 15 | CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o: headers/ztimer.h 16 | 17 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/benchbitpacking.dir/src/benchbitpacking.cpp.o -o benchbitpacking -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/benchbitpacking.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 10 2 | CMAKE_PROGRESS_2 = 11 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/check.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | ) 4 | # The set of files for implicit dependencies of each language: 5 | 6 | # Targets to which this target links. 7 | set(CMAKE_TARGET_LINKED_INFO_FILES 8 | ) 9 | 10 | # Fortran module output directory. 11 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 12 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/check.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /usr/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /usr/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor 50 | 51 | # Utility rule file for check. 52 | 53 | # Include the progress variables for this target. 54 | include CMakeFiles/check.dir/progress.make 55 | 56 | CMakeFiles/check: unit 57 | ./unit 58 | 59 | check: CMakeFiles/check 60 | check: CMakeFiles/check.dir/build.make 61 | 62 | .PHONY : check 63 | 64 | # Rule to build all files generated by this target. 65 | CMakeFiles/check.dir/build: check 66 | 67 | .PHONY : CMakeFiles/check.dir/build 68 | 69 | CMakeFiles/check.dir/clean: 70 | $(CMAKE_COMMAND) -P CMakeFiles/check.dir/cmake_clean.cmake 71 | .PHONY : CMakeFiles/check.dir/clean 72 | 73 | CMakeFiles/check.dir/depend: 74 | cd /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/check.dir/DependInfo.cmake --color=$(COLOR) 75 | .PHONY : CMakeFiles/check.dir/depend 76 | 77 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/check.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/check" 3 | ) 4 | 5 | # Per-language clean rules from dependency scanning. 6 | foreach(lang ) 7 | include(CMakeFiles/check.dir/cmake_clean_${lang}.cmake OPTIONAL) 8 | endforeach() 9 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/check.dir/progress.make: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/codecs.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/codecs.dir/src/codecs.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/codecs.dir/src/codecs.cpp.o" 3 | "codecs.pdb" 4 | "codecs" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/codecs.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/codecs.dir/src/codecs.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/codecs.cpp 6 | headers/VarIntG8IU.h 7 | headers/bitpacking.h 8 | headers/bitpackingaligned.h 9 | headers/bitpackinghelpers.h 10 | headers/bitpackingunaligned.h 11 | headers/blockpacking.h 12 | headers/codecfactory.h 13 | headers/codecs.h 14 | headers/common.h 15 | headers/compositecodec.h 16 | headers/cpubenchmark.h 17 | headers/deltautil.h 18 | headers/entropy.h 19 | headers/fastpfor.h 20 | headers/memutil.h 21 | headers/mersenne.h 22 | headers/newpfor.h 23 | headers/optpfor.h 24 | headers/packingvectors.h 25 | headers/pfor.h 26 | headers/pfor2008.h 27 | headers/simdbinarypacking.h 28 | headers/simdbitpacking.h 29 | headers/simdfastpfor.h 30 | headers/simdnewpfor.h 31 | headers/simdoptpfor.h 32 | headers/simdpfor.h 33 | headers/simdvariablebyte.h 34 | headers/simple16.h 35 | headers/simple8b.h 36 | headers/simple8b_rle.h 37 | headers/simple9.h 38 | headers/simple9_rle.h 39 | headers/snappydelta.h 40 | headers/streamvariablebyte.h 41 | headers/stringutil.h 42 | headers/synthetic.h 43 | headers/usimdbitpacking.h 44 | headers/util.h 45 | headers/variablebyte.h 46 | headers/varintgb.h 47 | headers/vsencoding.h 48 | headers/ztimer.h 49 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/codecs.dir/src/codecs.cpp.o: src/codecs.cpp 5 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/VarIntG8IU.h 6 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/bitpacking.h 7 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/bitpackingaligned.h 8 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/bitpackinghelpers.h 9 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/bitpackingunaligned.h 10 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/blockpacking.h 11 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/codecfactory.h 12 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/codecs.h 13 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/common.h 14 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/compositecodec.h 15 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/cpubenchmark.h 16 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/deltautil.h 17 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/entropy.h 18 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/fastpfor.h 19 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/memutil.h 20 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/mersenne.h 21 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/newpfor.h 22 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/optpfor.h 23 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/packingvectors.h 24 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/pfor.h 25 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/pfor2008.h 26 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdbinarypacking.h 27 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdbitpacking.h 28 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdfastpfor.h 29 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdnewpfor.h 30 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdoptpfor.h 31 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdpfor.h 32 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simdvariablebyte.h 33 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simple16.h 34 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simple8b.h 35 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simple8b_rle.h 36 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simple9.h 37 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/simple9_rle.h 38 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/snappydelta.h 39 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/streamvariablebyte.h 40 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/stringutil.h 41 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/synthetic.h 42 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/usimdbitpacking.h 43 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/util.h 44 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/variablebyte.h 45 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/varintgb.h 46 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/vsencoding.h 47 | CMakeFiles/codecs.dir/src/codecs.cpp.o: headers/ztimer.h 48 | 49 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/codecs.dir/src/codecs.cpp.o -o codecs -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/codecs.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 12 2 | CMAKE_PROGRESS_2 = 13 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/csv2maropu.cpp 10 | vector 11 | - 12 | iostream 13 | - 14 | csv.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/csv.h 16 | externalvector.h 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/externalvector.h 18 | util.h 19 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/util.h 20 | 21 | headers/common.h 22 | errno.h 23 | - 24 | fcntl.h 25 | - 26 | immintrin.h 27 | - 28 | stdio.h 29 | - 30 | stdlib.h 31 | - 32 | string.h 33 | - 34 | sys/mman.h 35 | - 36 | sys/resource.h 37 | - 38 | sys/stat.h 39 | - 40 | sys/time.h 41 | - 42 | sys/types.h 43 | - 44 | time.h 45 | - 46 | algorithm 47 | - 48 | cassert 49 | - 50 | chrono 51 | - 52 | cmath 53 | - 54 | cstdint 55 | - 56 | fstream 57 | - 58 | iomanip 59 | - 60 | iostream 61 | - 62 | map 63 | - 64 | memory 65 | - 66 | numeric 67 | - 68 | queue 69 | - 70 | set 71 | - 72 | sstream 73 | - 74 | stdexcept 75 | - 76 | string 77 | - 78 | unordered_map 79 | - 80 | unordered_set 81 | - 82 | iso646.h 83 | - 84 | stdint.h 85 | - 86 | intrin.h 87 | - 88 | 89 | headers/csv.h 90 | fstream 91 | - 92 | map 93 | - 94 | set 95 | - 96 | vector 97 | - 98 | common.h 99 | headers/common.h 100 | 101 | headers/externalvector.h 102 | vector 103 | - 104 | queue 105 | - 106 | common.h 107 | headers/common.h 108 | 109 | headers/util.h 110 | common.h 111 | headers/common.h 112 | 113 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/csv2maropu.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | ) 19 | 20 | # Fortran module output directory. 21 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 22 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o" 3 | "csv2maropu.pdb" 4 | "csv2maropu" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/csv2maropu.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/csv2maropu.cpp 6 | headers/common.h 7 | headers/csv.h 8 | headers/externalvector.h 9 | headers/util.h 10 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o: src/csv2maropu.cpp 5 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o: headers/common.h 6 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o: headers/csv.h 7 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o: headers/externalvector.h 8 | CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o: headers/util.h 9 | 10 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/csv2maropu.dir/src/csv2maropu.cpp.o -o csv2maropu -rdynamic 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/csv2maropu.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 14 2 | CMAKE_PROGRESS_2 = 15 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/entropy.cpp 10 | common.h 11 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/common.h 12 | maropuparser.h 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/maropuparser.h 14 | util.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/util.h 16 | entropy.h 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/entropy.h 18 | deltautil.h 19 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/deltautil.h 20 | 21 | headers/bitpacking.h 22 | common.h 23 | headers/common.h 24 | 25 | headers/bitpackinghelpers.h 26 | bitpacking.h 27 | headers/bitpacking.h 28 | 29 | headers/codecs.h 30 | common.h 31 | headers/common.h 32 | util.h 33 | headers/util.h 34 | bitpackinghelpers.h 35 | headers/bitpackinghelpers.h 36 | 37 | headers/common.h 38 | errno.h 39 | - 40 | fcntl.h 41 | - 42 | immintrin.h 43 | - 44 | stdio.h 45 | - 46 | stdlib.h 47 | - 48 | string.h 49 | - 50 | sys/mman.h 51 | - 52 | sys/resource.h 53 | - 54 | sys/stat.h 55 | - 56 | sys/time.h 57 | - 58 | sys/types.h 59 | - 60 | time.h 61 | - 62 | algorithm 63 | - 64 | cassert 65 | - 66 | chrono 67 | - 68 | cmath 69 | - 70 | cstdint 71 | - 72 | fstream 73 | - 74 | iomanip 75 | - 76 | iostream 77 | - 78 | map 79 | - 80 | memory 81 | - 82 | numeric 83 | - 84 | queue 85 | - 86 | set 87 | - 88 | sstream 89 | - 90 | stdexcept 91 | - 92 | string 93 | - 94 | unordered_map 95 | - 96 | unordered_set 97 | - 98 | iso646.h 99 | - 100 | stdint.h 101 | - 102 | intrin.h 103 | - 104 | 105 | headers/deltautil.h 106 | vector 107 | - 108 | exception 109 | - 110 | common.h 111 | headers/common.h 112 | codecs.h 113 | headers/codecs.h 114 | memutil.h 115 | headers/memutil.h 116 | entropy.h 117 | headers/entropy.h 118 | ztimer.h 119 | headers/ztimer.h 120 | 121 | headers/entropy.h 122 | common.h 123 | headers/common.h 124 | util.h 125 | headers/util.h 126 | 127 | headers/maropuparser.h 128 | common.h 129 | headers/common.h 130 | 131 | headers/memutil.h 132 | common.h 133 | headers/common.h 134 | 135 | headers/util.h 136 | common.h 137 | headers/common.h 138 | 139 | headers/ztimer.h 140 | common.h 141 | headers/common.h 142 | windows.h 143 | - 144 | 145 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/entropy.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/entropy.dir/src/entropy.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/entropy.dir/src/entropy.cpp.o" 3 | "entropy.pdb" 4 | "entropy" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/entropy.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/entropy.dir/src/entropy.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/entropy.cpp 6 | headers/bitpacking.h 7 | headers/bitpackinghelpers.h 8 | headers/codecs.h 9 | headers/common.h 10 | headers/deltautil.h 11 | headers/entropy.h 12 | headers/maropuparser.h 13 | headers/memutil.h 14 | headers/util.h 15 | headers/ztimer.h 16 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/entropy.dir/src/entropy.cpp.o: src/entropy.cpp 5 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/bitpacking.h 6 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/bitpackinghelpers.h 7 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/codecs.h 8 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/common.h 9 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/deltautil.h 10 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/entropy.h 11 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/maropuparser.h 12 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/memutil.h 13 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/util.h 14 | CMakeFiles/entropy.dir/src/entropy.cpp.o: headers/ztimer.h 15 | 16 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/entropy.dir/src/entropy.cpp.o -o entropy -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/entropy.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 16 2 | CMAKE_PROGRESS_2 = 17 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/example.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/example.dir/example.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/example.dir/example.cpp.o" 3 | "example.pdb" 4 | "example" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/example.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/example.dir/example.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/example.cpp 6 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/VarIntG8IU.h 7 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/bitpacking.h 8 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/bitpackingaligned.h 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/bitpackinghelpers.h 10 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/bitpackingunaligned.h 11 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/blockpacking.h 12 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/codecfactory.h 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/codecs.h 14 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/common.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/compositecodec.h 16 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/cpubenchmark.h 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/deltautil.h 18 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/entropy.h 19 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/fastpfor.h 20 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/memutil.h 21 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/newpfor.h 22 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/optpfor.h 23 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/packingvectors.h 24 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/pfor.h 25 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/pfor2008.h 26 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdbinarypacking.h 27 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdbitpacking.h 28 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdfastpfor.h 29 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdnewpfor.h 30 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdoptpfor.h 31 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdpfor.h 32 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simdvariablebyte.h 33 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simple16.h 34 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simple8b.h 35 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simple8b_rle.h 36 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simple9.h 37 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/simple9_rle.h 38 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/snappydelta.h 39 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/streamvariablebyte.h 40 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/usimdbitpacking.h 41 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/util.h 42 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/variablebyte.h 43 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/varintgb.h 44 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/vsencoding.h 45 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers/ztimer.h 46 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/example.dir/example.cpp.o: example.cpp 5 | CMakeFiles/example.dir/example.cpp.o: headers/VarIntG8IU.h 6 | CMakeFiles/example.dir/example.cpp.o: headers/bitpacking.h 7 | CMakeFiles/example.dir/example.cpp.o: headers/bitpackingaligned.h 8 | CMakeFiles/example.dir/example.cpp.o: headers/bitpackinghelpers.h 9 | CMakeFiles/example.dir/example.cpp.o: headers/bitpackingunaligned.h 10 | CMakeFiles/example.dir/example.cpp.o: headers/blockpacking.h 11 | CMakeFiles/example.dir/example.cpp.o: headers/codecfactory.h 12 | CMakeFiles/example.dir/example.cpp.o: headers/codecs.h 13 | CMakeFiles/example.dir/example.cpp.o: headers/common.h 14 | CMakeFiles/example.dir/example.cpp.o: headers/compositecodec.h 15 | CMakeFiles/example.dir/example.cpp.o: headers/cpubenchmark.h 16 | CMakeFiles/example.dir/example.cpp.o: headers/deltautil.h 17 | CMakeFiles/example.dir/example.cpp.o: headers/entropy.h 18 | CMakeFiles/example.dir/example.cpp.o: headers/fastpfor.h 19 | CMakeFiles/example.dir/example.cpp.o: headers/memutil.h 20 | CMakeFiles/example.dir/example.cpp.o: headers/newpfor.h 21 | CMakeFiles/example.dir/example.cpp.o: headers/optpfor.h 22 | CMakeFiles/example.dir/example.cpp.o: headers/packingvectors.h 23 | CMakeFiles/example.dir/example.cpp.o: headers/pfor.h 24 | CMakeFiles/example.dir/example.cpp.o: headers/pfor2008.h 25 | CMakeFiles/example.dir/example.cpp.o: headers/simdbinarypacking.h 26 | CMakeFiles/example.dir/example.cpp.o: headers/simdbitpacking.h 27 | CMakeFiles/example.dir/example.cpp.o: headers/simdfastpfor.h 28 | CMakeFiles/example.dir/example.cpp.o: headers/simdnewpfor.h 29 | CMakeFiles/example.dir/example.cpp.o: headers/simdoptpfor.h 30 | CMakeFiles/example.dir/example.cpp.o: headers/simdpfor.h 31 | CMakeFiles/example.dir/example.cpp.o: headers/simdvariablebyte.h 32 | CMakeFiles/example.dir/example.cpp.o: headers/simple16.h 33 | CMakeFiles/example.dir/example.cpp.o: headers/simple8b.h 34 | CMakeFiles/example.dir/example.cpp.o: headers/simple8b_rle.h 35 | CMakeFiles/example.dir/example.cpp.o: headers/simple9.h 36 | CMakeFiles/example.dir/example.cpp.o: headers/simple9_rle.h 37 | CMakeFiles/example.dir/example.cpp.o: headers/snappydelta.h 38 | CMakeFiles/example.dir/example.cpp.o: headers/streamvariablebyte.h 39 | CMakeFiles/example.dir/example.cpp.o: headers/usimdbitpacking.h 40 | CMakeFiles/example.dir/example.cpp.o: headers/util.h 41 | CMakeFiles/example.dir/example.cpp.o: headers/variablebyte.h 42 | CMakeFiles/example.dir/example.cpp.o: headers/varintgb.h 43 | CMakeFiles/example.dir/example.cpp.o: headers/vsencoding.h 44 | CMakeFiles/example.dir/example.cpp.o: headers/ztimer.h 45 | 46 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/example.dir/example.cpp.o -o example -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/example.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 18 2 | CMAKE_PROGRESS_2 = 19 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/gapstats.cpp 10 | vector 11 | - 12 | maropuparser.h 13 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/maropuparser.h 14 | util.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/util.h 16 | 17 | headers/common.h 18 | errno.h 19 | - 20 | fcntl.h 21 | - 22 | immintrin.h 23 | - 24 | stdio.h 25 | - 26 | stdlib.h 27 | - 28 | string.h 29 | - 30 | sys/mman.h 31 | - 32 | sys/resource.h 33 | - 34 | sys/stat.h 35 | - 36 | sys/time.h 37 | - 38 | sys/types.h 39 | - 40 | time.h 41 | - 42 | algorithm 43 | - 44 | cassert 45 | - 46 | chrono 47 | - 48 | cmath 49 | - 50 | cstdint 51 | - 52 | fstream 53 | - 54 | iomanip 55 | - 56 | iostream 57 | - 58 | map 59 | - 60 | memory 61 | - 62 | numeric 63 | - 64 | queue 65 | - 66 | set 67 | - 68 | sstream 69 | - 70 | stdexcept 71 | - 72 | string 73 | - 74 | unordered_map 75 | - 76 | unordered_set 77 | - 78 | iso646.h 79 | - 80 | stdint.h 81 | - 82 | intrin.h 83 | - 84 | 85 | headers/maropuparser.h 86 | common.h 87 | headers/common.h 88 | 89 | headers/util.h 90 | common.h 91 | headers/common.h 92 | 93 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/gapstats.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/gapstats.dir/src/gapstats.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | ) 19 | 20 | # Fortran module output directory. 21 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 22 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/gapstats.dir/src/gapstats.cpp.o" 3 | "gapstats.pdb" 4 | "gapstats" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/gapstats.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/gapstats.dir/src/gapstats.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/gapstats.cpp 6 | headers/common.h 7 | headers/maropuparser.h 8 | headers/util.h 9 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/gapstats.dir/src/gapstats.cpp.o: src/gapstats.cpp 5 | CMakeFiles/gapstats.dir/src/gapstats.cpp.o: headers/common.h 6 | CMakeFiles/gapstats.dir/src/gapstats.cpp.o: headers/maropuparser.h 7 | CMakeFiles/gapstats.dir/src/gapstats.cpp.o: headers/util.h 8 | 9 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/gapstats.dir/src/gapstats.cpp.o -o gapstats -rdynamic 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/gapstats.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 20 2 | CMAKE_PROGRESS_2 = 21 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/inmemorybenchmark.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o" 3 | "inmemorybenchmark.pdb" 4 | "inmemorybenchmark" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/inmemorybenchmark.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/inmemorybenchmark.cpp 6 | headers/VarIntG8IU.h 7 | headers/bitpacking.h 8 | headers/bitpackingaligned.h 9 | headers/bitpackinghelpers.h 10 | headers/bitpackingunaligned.h 11 | headers/blockpacking.h 12 | headers/codecfactory.h 13 | headers/codecs.h 14 | headers/common.h 15 | headers/compositecodec.h 16 | headers/cpubenchmark.h 17 | headers/deltautil.h 18 | headers/entropy.h 19 | headers/fastpfor.h 20 | headers/maropuparser.h 21 | headers/memutil.h 22 | headers/newpfor.h 23 | headers/optpfor.h 24 | headers/packingvectors.h 25 | headers/pfor.h 26 | headers/pfor2008.h 27 | headers/simdbinarypacking.h 28 | headers/simdbitpacking.h 29 | headers/simdfastpfor.h 30 | headers/simdnewpfor.h 31 | headers/simdoptpfor.h 32 | headers/simdpfor.h 33 | headers/simdvariablebyte.h 34 | headers/simple16.h 35 | headers/simple8b.h 36 | headers/simple8b_rle.h 37 | headers/simple9.h 38 | headers/simple9_rle.h 39 | headers/snappydelta.h 40 | headers/streamvariablebyte.h 41 | headers/stringutil.h 42 | headers/usimdbitpacking.h 43 | headers/util.h 44 | headers/variablebyte.h 45 | headers/varintgb.h 46 | headers/vsencoding.h 47 | headers/ztimer.h 48 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: src/inmemorybenchmark.cpp 5 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/VarIntG8IU.h 6 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/bitpacking.h 7 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/bitpackingaligned.h 8 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/bitpackinghelpers.h 9 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/bitpackingunaligned.h 10 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/blockpacking.h 11 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/codecfactory.h 12 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/codecs.h 13 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/common.h 14 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/compositecodec.h 15 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/cpubenchmark.h 16 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/deltautil.h 17 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/entropy.h 18 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/fastpfor.h 19 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/maropuparser.h 20 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/memutil.h 21 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/newpfor.h 22 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/optpfor.h 23 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/packingvectors.h 24 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/pfor.h 25 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/pfor2008.h 26 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdbinarypacking.h 27 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdbitpacking.h 28 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdfastpfor.h 29 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdnewpfor.h 30 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdoptpfor.h 31 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdpfor.h 32 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simdvariablebyte.h 33 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simple16.h 34 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simple8b.h 35 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simple8b_rle.h 36 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simple9.h 37 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/simple9_rle.h 38 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/snappydelta.h 39 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/streamvariablebyte.h 40 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/stringutil.h 41 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/usimdbitpacking.h 42 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/util.h 43 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/variablebyte.h 44 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/varintgb.h 45 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/vsencoding.h 46 | CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o: headers/ztimer.h 47 | 48 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/inmemorybenchmark.dir/src/inmemorybenchmark.cpp.o -o inmemorybenchmark -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/inmemorybenchmark.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 22 2 | CMAKE_PROGRESS_2 = 23 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/partitionbylength.cpp 10 | sstream 11 | - 12 | vector 13 | - 14 | maropuparser.h 15 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/maropuparser.h 16 | util.h 17 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/util.h 18 | 19 | headers/common.h 20 | errno.h 21 | - 22 | fcntl.h 23 | - 24 | immintrin.h 25 | - 26 | stdio.h 27 | - 28 | stdlib.h 29 | - 30 | string.h 31 | - 32 | sys/mman.h 33 | - 34 | sys/resource.h 35 | - 36 | sys/stat.h 37 | - 38 | sys/time.h 39 | - 40 | sys/types.h 41 | - 42 | time.h 43 | - 44 | algorithm 45 | - 46 | cassert 47 | - 48 | chrono 49 | - 50 | cmath 51 | - 52 | cstdint 53 | - 54 | fstream 55 | - 56 | iomanip 57 | - 58 | iostream 59 | - 60 | map 61 | - 62 | memory 63 | - 64 | numeric 65 | - 66 | queue 67 | - 68 | set 69 | - 70 | sstream 71 | - 72 | stdexcept 73 | - 74 | string 75 | - 76 | unordered_map 77 | - 78 | unordered_set 79 | - 80 | iso646.h 81 | - 82 | stdint.h 83 | - 84 | intrin.h 85 | - 86 | 87 | headers/maropuparser.h 88 | common.h 89 | headers/common.h 90 | 91 | headers/util.h 92 | common.h 93 | headers/common.h 94 | 95 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/partitionbylength.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | ) 19 | 20 | # Fortran module output directory. 21 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 22 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o" 3 | "partitionbylength.pdb" 4 | "partitionbylength" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/partitionbylength.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/partitionbylength.cpp 6 | headers/common.h 7 | headers/maropuparser.h 8 | headers/util.h 9 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o: src/partitionbylength.cpp 5 | CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o: headers/common.h 6 | CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o: headers/maropuparser.h 7 | CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o: headers/util.h 8 | 9 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/partitionbylength.dir/src/partitionbylength.cpp.o -o partitionbylength -rdynamic 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/partitionbylength.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 24 2 | CMAKE_PROGRESS_2 = 25 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 27 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/unit.cpp" "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/unit.dir/src/unit.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "headers" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/CMakeFiles/FastPFor.dir/DependInfo.cmake" 19 | ) 20 | 21 | # Fortran module output directory. 22 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/unit.dir/src/unit.cpp.o" 3 | "unit.pdb" 4 | "unit" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/unit.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/unit.dir/src/unit.cpp.o 5 | /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/src/unit.cpp 6 | headers/VarIntG8IU.h 7 | headers/bitpacking.h 8 | headers/bitpackingaligned.h 9 | headers/bitpackinghelpers.h 10 | headers/bitpackingunaligned.h 11 | headers/blockpacking.h 12 | headers/codecfactory.h 13 | headers/codecs.h 14 | headers/common.h 15 | headers/compositecodec.h 16 | headers/cpubenchmark.h 17 | headers/fastpfor.h 18 | headers/memutil.h 19 | headers/mersenne.h 20 | headers/newpfor.h 21 | headers/optpfor.h 22 | headers/packingvectors.h 23 | headers/pfor.h 24 | headers/pfor2008.h 25 | headers/simdbinarypacking.h 26 | headers/simdbitpacking.h 27 | headers/simdfastpfor.h 28 | headers/simdnewpfor.h 29 | headers/simdoptpfor.h 30 | headers/simdpfor.h 31 | headers/simdvariablebyte.h 32 | headers/simple16.h 33 | headers/simple8b.h 34 | headers/simple8b_rle.h 35 | headers/simple9.h 36 | headers/simple9_rle.h 37 | headers/snappydelta.h 38 | headers/streamvariablebyte.h 39 | headers/synthetic.h 40 | headers/usimdbitpacking.h 41 | headers/util.h 42 | headers/variablebyte.h 43 | headers/varintgb.h 44 | headers/vsencoding.h 45 | headers/ztimer.h 46 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | CMakeFiles/unit.dir/src/unit.cpp.o: src/unit.cpp 5 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/VarIntG8IU.h 6 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/bitpacking.h 7 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/bitpackingaligned.h 8 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/bitpackinghelpers.h 9 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/bitpackingunaligned.h 10 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/blockpacking.h 11 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/codecfactory.h 12 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/codecs.h 13 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/common.h 14 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/compositecodec.h 15 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/cpubenchmark.h 16 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/fastpfor.h 17 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/memutil.h 18 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/mersenne.h 19 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/newpfor.h 20 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/optpfor.h 21 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/packingvectors.h 22 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/pfor.h 23 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/pfor2008.h 24 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdbinarypacking.h 25 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdbitpacking.h 26 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdfastpfor.h 27 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdnewpfor.h 28 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdoptpfor.h 29 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdpfor.h 30 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simdvariablebyte.h 31 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simple16.h 32 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simple8b.h 33 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simple8b_rle.h 34 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simple9.h 35 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/simple9_rle.h 36 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/snappydelta.h 37 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/streamvariablebyte.h 38 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/synthetic.h 39 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/usimdbitpacking.h 40 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/util.h 41 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/variablebyte.h 42 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/varintgb.h 43 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/vsencoding.h 44 | CMakeFiles/unit.dir/src/unit.cpp.o: headers/ztimer.h 45 | 46 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.5 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/headers 10 | 11 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -Wall -Wcast-align -Ofast -lm -DNDEBUG -std=c++11 -DHAVE_CXX0X -march=native CMakeFiles/unit.dir/src/unit.cpp.o -o unit -rdynamic libFastPFor.a 2 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/CMakeFiles/unit.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 26 2 | CMAKE_PROGRESS_2 = 27 3 | 4 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/TODO.md: -------------------------------------------------------------------------------- 1 | 2 | - Currently, users have to make educated guesses regarding compression buffer sizes. This information should be provided automatically by the library. 3 | - Add support for 64-bit integers -------------------------------------------------------------------------------- /Switch/ext/FastPFor/benchbitpacking: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/benchbitpacking -------------------------------------------------------------------------------- /Switch/ext/FastPFor/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /db/storage/Development/Projects/Trinity/Switch/ext/FastPFor 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/db/storage/Development/Projects/Trinity/Switch/ext/FastPFor/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/cmake_modules/AppendCompilerFlags.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCSourceCompiles) 2 | include(CheckCXXSourceCompiles) 3 | 4 | macro(append_c_compiler_flags _flags _name _result) 5 | set(SAFE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) 6 | string(REGEX REPLACE "[-+/ ]" "_" cname "${_name}") 7 | string(TOUPPER "${cname}" cname) 8 | foreach(flag ${_flags}) 9 | string(REGEX REPLACE "^[-+/ ]+(.*)[-+/ ]*$" "\\1" flagname "${flag}") 10 | string(REGEX REPLACE "[-+/ ]" "_" flagname "${flagname}") 11 | string(TOUPPER "${flagname}" flagname) 12 | set(have_flag "HAVE_${cname}_${flagname}") 13 | set(CMAKE_REQUIRED_FLAGS "${flag}") 14 | check_c_source_compiles("int main() { return 0; }" ${have_flag}) 15 | if(${have_flag}) 16 | set(${_result} "${${_result}} ${flag}") 17 | endif(${have_flag}) 18 | endforeach(flag) 19 | set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS}) 20 | endmacro(append_c_compiler_flags) 21 | 22 | macro(append_cxx_compiler_flags _flags _name _result) 23 | set(SAFE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) 24 | string(REGEX REPLACE "[-+/ ]" "_" cname "${_name}") 25 | string(TOUPPER "${cname}" cname) 26 | foreach(flag ${_flags}) 27 | string(REGEX REPLACE "^[-+/ ]+(.*)[-+/ ]*$" "\\1" flagname "${flag}") 28 | string(REGEX REPLACE "[-+/ ]" "_" flagname "${flagname}") 29 | string(TOUPPER "${flagname}" flagname) 30 | set(have_flag "HAVE_${cname}_${flagname}") 31 | set(CMAKE_REQUIRED_FLAGS "${flag}") 32 | check_cxx_source_compiles("int main() { return 0; }" ${have_flag}) 33 | if(${have_flag}) 34 | set(${_result} "${${_result}} ${flag}") 35 | endif(${have_flag}) 36 | endforeach(flag) 37 | set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS}) 38 | endmacro(append_cxx_compiler_flags) 39 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/cmake_modules/DetectCPUFeatures.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCXXSourceCompiles) 2 | 3 | message(STATUS "TEST TEST") 4 | set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) 5 | 6 | set(SSE4PROG " 7 | 8 | #include 9 | int main(){ 10 | __m128 x=_mm_set1_ps(0.5); 11 | x=_mm_dp_ps(x,x,0x77); 12 | return _mm_movemask_ps(x); 13 | }") 14 | 15 | set(AVXPROG " 16 | 17 | #include 18 | int main(){ 19 | __m128 x=_mm_set1_ps(0.5); 20 | x=_mm_permute_ps(x,1); 21 | return _mm_movemask_ps(x); 22 | }") 23 | 24 | set(AVX2PROG " 25 | 26 | #include 27 | int main(){ 28 | __m256i x=_mm256_set1_epi32(5); 29 | x=_mm256_add_epi32(x,x); 30 | return _mm256_movemask_epi8(x); 31 | }") 32 | 33 | if(MSVC) 34 | message(STATUS "TEST 2") 35 | set(CMAKE_REQUIRED_FLAGS "/EHsc /arch:SSE2") 36 | check_cxx_source_compiles("${SSE4PROG}" SUPPORT_SSE42) 37 | message(STATUS "SUPPORT_SSE42 ${SUPPORT_SSE42}") 38 | set(CMAKE_REQUIRED_FLAGS "/EHsc /arch:AVX") 39 | check_cxx_source_compiles("${AVXPROG}" SUPPORT_AVX) 40 | message(STATUS "SUPPORT_AVX ${SUPPORT_AVX}") 41 | set(CMAKE_REQUIRED_FLAGS "/EHsc /arch:AVX2") 42 | check_cxx_source_compiles("${AVX2PROG}" SUPPORT_AVX2) 43 | message(STATUS "SUPPORT_AVX2 ${SUPPORT_AVX2}") 44 | else() 45 | set(CMAKE_REQUIRED_FLAGS "-march=native -msse4.2") 46 | check_cxx_source_compiles("${SSE4PROG}" SUPPORT_SSE42) 47 | set(CMAKE_REQUIRED_FLAGS "-march=native -mavx") 48 | check_cxx_source_compiles("${AVXPROG}" SUPPORT_AVX) 49 | set(CMAKE_REQUIRED_FLAGS "-march=native -mavx2") 50 | check_cxx_source_compiles("${AVX2PROG}" SUPPORT_AVX2) 51 | endif() 52 | 53 | set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) 54 | 55 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/cmake_modules/Findsnappy.cmake: -------------------------------------------------------------------------------- 1 | # This code is released under the 2 | # Apache License Version 2.0 http://www.apache.org/licenses/. 3 | # 4 | # Copyright (c) 2012 Louis Dionne 5 | # 6 | # Find snappy compression library and includes. This module defines: 7 | # snappy_INCLUDE_DIRS - The directories containing snappy's headers. 8 | # snappy_LIBRARIES - A list of snappy's libraries. 9 | # snappy_FOUND - Whether snappy was found. 10 | # 11 | # This module can be controlled by setting the following variables: 12 | # snappy_ROOT - The root directory where to find snappy. If this is not 13 | # set, the default paths are searched. 14 | 15 | if(NOT snappy_ROOT) 16 | find_path(snappy_INCLUDE_DIRS snappy.h) 17 | find_library(snappy_LIBRARIES NAMES snappy) 18 | else() 19 | find_path(snappy_INCLUDE_DIRS snappy.h NO_DEFAULT_PATH PATHS ${snappy_ROOT}) 20 | find_library(snappy_LIBRARIES NAMES snappy NO_DEFAULT_PATH PATHS ${snappy_ROOT}) 21 | endif() 22 | 23 | if(snappy_INCLUDE_DIRS AND snappy_LIBRARIES) 24 | set(snappy_FOUND TRUE) 25 | else() 26 | set(snappy_FOUND FALSE) 27 | set(snappy_INCLUDE_DIR) 28 | set(snappy_LIBRARIES) 29 | endif() 30 | 31 | mark_as_advanced(snappy_LIBRARIES snappy_INCLUDE_DIRS) 32 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/codecs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/codecs -------------------------------------------------------------------------------- /Switch/ext/FastPFor/csv2maropu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/csv2maropu -------------------------------------------------------------------------------- /Switch/ext/FastPFor/data/ClueWeb09LogSizeFreqs.1: -------------------------------------------------------------------------------- 1 | 1 2.82724e-08 2 | 2 8.19898e-07 3 | 3 1.10262e-06 4 | 4 2.71415e-06 5 | 5 9.27333e-06 6 | 6 7.31123e-05 7 | 7 0.000603756 8 | 8 0.00627974 9 | 9 0.0131751 10 | 10 0.0140863 11 | 11 0.0148443 12 | 12 0.017259 13 | 13 0.0219071 14 | 14 0.0242301 15 | 15 0.030346 16 | 16 0.0389263 17 | 17 0.0527359 18 | 18 0.0684633 19 | 19 0.0830985 20 | 20 0.120965 21 | 21 0.131029 22 | 22 0.126197 23 | 23 0.13557 24 | 24 0.0699598 25 | 25 0.0294745 26 | 26 0.000762534 27 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/data/README: -------------------------------------------------------------------------------- 1 | The file ClueWeb09LogSizeFreqs.1 corresponds to the AOL log weight vector 2 | computed for the research paper "Decoding billions of integers per second through vectorization". 3 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/entropy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/entropy -------------------------------------------------------------------------------- /Switch/ext/FastPFor/example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/example -------------------------------------------------------------------------------- /Switch/ext/FastPFor/example.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // A simple example to get you started with the library. 3 | // You can compile and run this example like so: 4 | // 5 | // make example 6 | // ./example 7 | // 8 | // Warning: If your compiler does not fully support C++11, some of 9 | // this example may require changes. 10 | // 11 | 12 | #include "headers/codecfactory.h" 13 | #include "headers/deltautil.h" 14 | 15 | int main() { 16 | using namespace FastPForLib; 17 | 18 | // We pick a CODEC 19 | IntegerCODEC &codec = *CODECFactory::getFromName("simdfastpfor256"); 20 | // could use others, e.g., "simdbinarypacking", "varintg8iu" 21 | //////////// 22 | // 23 | // create a container with some integers in it 24 | // 25 | // for this example, we will not assume that the 26 | // integers are in sorted order 27 | // 28 | // (Note: You don't need to use a vector.) 29 | // 30 | size_t N = 10 * 1000; 31 | std::vector mydata(N); 32 | for (uint32_t i = 0; i < N; i += 150) 33 | mydata[i] = i; 34 | // 35 | // the vector mydata could contain anything, really 36 | // 37 | /////////// 38 | // 39 | // You need some "output" container. You are responsible 40 | // for allocating enough memory. 41 | // 42 | std::vector compressed_output(N + 1024); 43 | // N+1024 should be plenty 44 | // 45 | // 46 | size_t compressedsize = compressed_output.size(); 47 | codec.encodeArray(mydata.data(), mydata.size(), compressed_output.data(), 48 | compressedsize); 49 | // 50 | // if desired, shrink back the array: 51 | compressed_output.resize(compressedsize); 52 | compressed_output.shrink_to_fit(); 53 | // display compression rate: 54 | std::cout << std::setprecision(3); 55 | std::cout << "You are using " 56 | << 32.0 * static_cast(compressed_output.size()) / 57 | static_cast(mydata.size()) 58 | << " bits per integer. " << std::endl; 59 | // 60 | // You are done!... with the compression... 61 | // 62 | /// 63 | // decompressing is also easy: 64 | // 65 | std::vector mydataback(N); 66 | size_t recoveredsize = mydataback.size(); 67 | // 68 | codec.decodeArray(compressed_output.data(), compressed_output.size(), 69 | mydataback.data(), recoveredsize); 70 | mydataback.resize(recoveredsize); 71 | // 72 | // That's it! 73 | // 74 | if (mydataback != mydata) 75 | throw std::runtime_error("bug!"); 76 | 77 | // If you need to use differential coding, you can use 78 | // calls like these to get the deltas and recover the original 79 | // data from the deltas: 80 | Delta::deltaSIMD(mydata.data(), mydata.size()); 81 | Delta::inverseDeltaSIMD(mydata.data(), mydata.size()); 82 | // be mindful of CPU caching issues 83 | 84 | // If you do use differential coding a lot, you might want 85 | // to check out these other libraries... 86 | // https://github.com/lemire/FastDifferentialCoding 87 | // and 88 | // https://github.com/lemire/SIMDCompressionAndIntersection 89 | } 90 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/gapstats: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/gapstats -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/bitpackingaligned.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | #ifndef BITPACKINGALIGNED 8 | #define BITPACKINGALIGNED 9 | 10 | #include "common.h" 11 | 12 | namespace FastPForLib { 13 | 14 | const uint32_t *fastunpack_8(const uint32_t *__restrict__ in, 15 | uint32_t *__restrict__ out, const uint32_t bit); 16 | uint32_t *fastpackwithoutmask_8(const uint32_t *__restrict__ in, 17 | uint32_t *__restrict__ out, const uint32_t bit); 18 | 19 | const uint32_t *fastunpack_16(const uint32_t *__restrict__ in, 20 | uint32_t *__restrict__ out, const uint32_t bit); 21 | uint32_t *fastpackwithoutmask_16(const uint32_t *__restrict__ in, 22 | uint32_t *__restrict__ out, 23 | const uint32_t bit); 24 | 25 | const uint32_t *fastunpack_24(const uint32_t *__restrict__ in, 26 | uint32_t *__restrict__ out, const uint32_t bit); 27 | uint32_t *fastpackwithoutmask_24(const uint32_t *__restrict__ in, 28 | uint32_t *__restrict__ out, 29 | const uint32_t bit); 30 | 31 | const uint32_t *fastunpack_32(const uint32_t *__restrict__ in, 32 | uint32_t *__restrict__ out, const uint32_t bit); 33 | 34 | uint32_t *fastpackwithoutmask_32(const uint32_t *__restrict__ in, 35 | uint32_t *__restrict__ out, 36 | const uint32_t bit); 37 | 38 | } // namespace FastPFor 39 | 40 | #endif // BITPACKINGALIGNED 41 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/bitpackingunaligned.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | #ifndef BITPACKINGUNALIGNED 8 | #define BITPACKINGUNALIGNED 9 | #include "common.h" 10 | 11 | namespace FastPForLib { 12 | 13 | typedef uint8_t byte; 14 | 15 | const byte *fastunalignedunpack_8(const byte *__restrict__ in, 16 | uint32_t *__restrict__ out, 17 | const uint32_t bit); 18 | byte *fastunalignedpackwithoutmask_8(const uint32_t *__restrict__ in, 19 | byte *__restrict__ out, 20 | const uint32_t bit); 21 | const byte *fastunalignedbyteunpack_8(const byte *__restrict__ in, 22 | byte *__restrict__ out, 23 | const uint32_t bit); 24 | byte *fastunalignedbytepackwithoutmask_8(const byte *__restrict__ in, 25 | byte *__restrict__ out, 26 | const uint32_t bit); 27 | const byte *fastunalignedunpack_16(const byte *__restrict__ in, 28 | uint32_t *__restrict__ out, 29 | const uint32_t bit); 30 | byte *fastunalignedpackwithoutmask_16(const uint32_t *__restrict__ in, 31 | byte *__restrict__ out, 32 | const uint32_t bit); 33 | const byte *fastunalignedbyteunpack_16(const byte *__restrict__ in, 34 | byte *__restrict__ out, 35 | const uint32_t bit); 36 | byte *fastunalignedbytepackwithoutmask_16(const byte *__restrict__ in, 37 | byte *__restrict__ out, 38 | const uint32_t bit); 39 | 40 | } // namespace FastPFor 41 | 42 | #endif // BITPACKINGUNALIGNED 43 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/common.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | #ifndef COMMON_H_ 8 | #define COMMON_H_ 9 | 10 | // C headers (sorted) 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #ifndef _WIN32 18 | #include 19 | #include 20 | #endif 21 | #include 22 | #ifndef _WIN32 23 | #include 24 | #endif 25 | #include 26 | #include 27 | 28 | // C++ headers (sorted) 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #ifdef _MSC_VER 49 | #include 50 | #include 51 | #include 52 | 53 | #define __attribute__(n) 54 | #define __restrict__ 55 | #define constexpr inline 56 | 57 | #endif 58 | 59 | #endif /* COMMON_H_ */ 60 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/compositecodec.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | #ifndef COMPOSITECODEC_H_ 8 | #define COMPOSITECODEC_H_ 9 | 10 | #include "common.h" 11 | #include "util.h" 12 | #include "codecs.h" 13 | 14 | namespace FastPForLib { 15 | 16 | /** 17 | * This is a useful class for CODEC that only compress 18 | * data having length a multiple of some unit length. 19 | */ 20 | template 21 | class CompositeCodec : public IntegerCODEC { 22 | public: 23 | CompositeCodec() : codec1(), codec2() {} 24 | Codec1 codec1; 25 | Codec2 codec2; 26 | void encodeArray(const uint32_t *in, const size_t length, uint32_t *out, 27 | size_t &nvalue) { 28 | const size_t roundedlength = length / Codec1::BlockSize * Codec1::BlockSize; 29 | size_t nvalue1 = nvalue; 30 | codec1.encodeArray(in, roundedlength, out, nvalue1); 31 | 32 | if (roundedlength < length) { 33 | ASSERT(nvalue >= nvalue1, nvalue << " " << nvalue1); 34 | size_t nvalue2 = nvalue - nvalue1; 35 | codec2.encodeArray(in + roundedlength, length - roundedlength, 36 | out + nvalue1, nvalue2); 37 | nvalue = nvalue1 + nvalue2; 38 | } else { 39 | nvalue = nvalue1; 40 | } 41 | } 42 | const uint32_t *decodeArray(const uint32_t *in, const size_t length, 43 | uint32_t *out, size_t &nvalue) { 44 | #ifndef NDEBUG 45 | const uint32_t *const initin(in); 46 | #endif 47 | size_t mynvalue1 = nvalue; 48 | const uint32_t *in2 = codec1.decodeArray(in, length, out, mynvalue1); 49 | if (length + in > in2) { 50 | assert(nvalue > mynvalue1); 51 | size_t nvalue2 = nvalue - mynvalue1; 52 | const uint32_t *in3 = codec2.decodeArray(in2, length - (in2 - in), 53 | out + mynvalue1, nvalue2); 54 | nvalue = mynvalue1 + nvalue2; 55 | assert(initin + length >= in3); 56 | return in3; 57 | } 58 | nvalue = mynvalue1; 59 | assert(initin + length >= in2); 60 | return in2; 61 | } 62 | std::string name() const { 63 | std::ostringstream convert; 64 | convert << codec1.name() << "+" << codec2.name(); 65 | return convert.str(); 66 | } 67 | }; 68 | 69 | } // namespace FastPFor 70 | 71 | #endif /* COMPOSITECODEC_H_ */ 72 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/cpubenchmark.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef CPUBENCHMARK_H_ 9 | #define CPUBENCHMARK_H_ 10 | 11 | #include "common.h" 12 | 13 | namespace FastPForLib { 14 | 15 | #if defined(__corei7__) // __amd64__ is untested 16 | // start and stop are as recommended by 17 | // Gabriele Paoloni, How to Benchmark Code Execution Times on Intel� IA-32 and 18 | // IA-64 Instruction Set Architectures 19 | // September 2010 20 | // http://edc.intel.com/Link.aspx?id=3954 21 | 22 | static __inline__ unsigned long long startRDTSC(void) { 23 | unsigned cycles_low, cycles_high; 24 | asm volatile("CPUID\n\t" 25 | "RDTSC\n\t" 26 | "mov %%edx, %0\n\t" 27 | "mov %%eax, %1\n\t" 28 | : "=r"(cycles_high), "=r"(cycles_low)::"%rax", "%rbx", "%rcx", 29 | "%rdx"); 30 | return (static_cast(cycles_high) << 32) | cycles_low; 31 | } 32 | 33 | static __inline__ unsigned long long stopRDTSCP(void) { 34 | unsigned cycles_low, cycles_high; 35 | /// This should work fine on most machines, if the RDTSCP thing 36 | /// fails for you, use the rdtsc() call instead. 37 | asm volatile("RDTSCP\n\t" 38 | "mov %%edx, %0\n\t" 39 | "mov %%eax, %1\n\t" 40 | "CPUID\n\t" 41 | : "=r"(cycles_high), "=r"(cycles_low)::"%rax", "%rbx", "%rcx", 42 | "%rdx"); 43 | return (static_cast(cycles_high) << 32) | cycles_low; 44 | } 45 | #elif defined(_MSC_VER) 46 | 47 | static inline unsigned long long startRDTSC(void) { return __rdtsc(); } 48 | 49 | static inline unsigned long long stopRDTSCP(void) { return __rdtsc(); } 50 | 51 | #elif defined(__i386__) || defined(__x86_64__) 52 | 53 | // Taken from stackoverflow (see 54 | // http://stackoverflow.com/questions/3830883/cpu-cycle-count-based-profiling-in-c-c-linux-x86-64) 55 | // Can give nonsensical results on multi-core AMD processors. 56 | inline unsigned long long rdtsc() { 57 | unsigned int lo, hi; 58 | asm volatile("cpuid \n" /* serializing */ 59 | "rdtsc" 60 | : "=a"(lo), "=d"(hi) /* outputs */ 61 | : "a"(0) /* inputs */ 62 | : "%ebx", "%ecx"); /* clobbers*/ 63 | return (static_cast(lo)) | 64 | ((static_cast(hi)) << 32); 65 | } 66 | static __inline__ unsigned long long startRDTSC(void) { return rdtsc(); } 67 | 68 | static __inline__ unsigned long long stopRDTSCP(void) { return rdtsc(); } 69 | 70 | #elif(defined(__arm__) || defined(__ppc__) || defined(__ppc64__)) 71 | 72 | // for PPC we should be able to use tbl, but I could not find 73 | // an equivalent to rdtsc for ARM. 74 | 75 | inline uint64 rdtsc() { return 0; } 76 | static __inline__ ticks startRDTSC(void) { return 0; } 77 | static __inline__ ticks stopRDTSCP(void) { return 0; } 78 | #else 79 | #error Unknown architecture 80 | #endif 81 | 82 | class CPUBenchmark { 83 | public: 84 | CPUBenchmark() : ticktime(0) { start(); } 85 | 86 | unsigned long long ticktime; 87 | 88 | void start() { ticktime = startRDTSC(); } 89 | 90 | unsigned long long stop() { return stopRDTSCP() - ticktime; } 91 | }; 92 | 93 | } // namespace FastPFor 94 | 95 | #endif /* CPUBENCHMARK_H_ */ 96 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/entropy.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef ENTROPY_H_ 9 | #define ENTROPY_H_ 10 | 11 | #include "common.h" 12 | #include "util.h" 13 | 14 | namespace FastPForLib { 15 | 16 | class EntropyRecorder { 17 | public: 18 | EntropyRecorder() : counter(), totallength(0) {} 19 | 20 | void clear() { 21 | counter.clear(); 22 | totallength = 0; 23 | } 24 | void eat(const uint32_t *in, const size_t length) { 25 | if (length == 0) 26 | return; 27 | totallength += length; 28 | for (uint32_t k = 0; k < length; ++k, ++in) { 29 | maptype::iterator i = counter.find(*in); 30 | if (i != counter.end()) 31 | i->second += 1; 32 | else 33 | counter[*in] = 1; 34 | } 35 | } 36 | 37 | double computeShannon() { 38 | double total = 0; 39 | for (maptype::iterator i = counter.begin(); i != counter.end(); ++i) { 40 | const double x = static_cast(i->second); 41 | total += x / static_cast(totallength) * 42 | log(static_cast(totallength) / x) / log(2.0); 43 | } 44 | return total; 45 | } 46 | 47 | __attribute__((pure)) double computeDataBits() { 48 | double total = 0; 49 | for (maptype::const_iterator i = counter.begin(); i != counter.end(); ++i) { 50 | total += static_cast(i->second) / 51 | static_cast(totallength) * 52 | static_cast(gccbits(i->first)); 53 | } 54 | return total; 55 | } 56 | typedef std::unordered_map maptype; 57 | maptype counter; 58 | size_t totallength; 59 | }; 60 | 61 | /** 62 | * An entropic measure, 63 | * Index compression using 64-bit words by Vo Ngoc Anh and Alistair Moffat 64 | */ 65 | __attribute__((pure)) double databits(const uint32_t *in, const size_t length) { 66 | double sum = 0.0; 67 | for (size_t k = 0; k < length; ++k) { 68 | sum += static_cast(gccbits(in[k])) / static_cast(length); 69 | } 70 | return sum; 71 | } 72 | 73 | double entropy(const uint32_t *in, const size_t length) { 74 | if (length == 0) 75 | return 0; 76 | std::map counter; 77 | for (size_t k = 0; k < length; ++k, ++in) { 78 | std::map::iterator i = counter.find(*in); 79 | if (i != counter.end()) 80 | i->second += 1; 81 | else 82 | counter[*in] = 1; 83 | } 84 | double total = 0; 85 | for (std::map::iterator i = counter.begin(); 86 | i != counter.end(); ++i) { 87 | double x = i->second; 88 | total += x / static_cast(length) * 89 | log(static_cast(length) / x) / log(2.0); 90 | } 91 | return total; 92 | } 93 | 94 | } // namespace FastPFor 95 | 96 | #endif /* ENTROPY_H_ */ 97 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/horizontalbitpacking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire 6 | */ 7 | 8 | /** 9 | * This is purely for technical comparisons. 10 | * 11 | * Implementation of 12 | * 13 | * Willhalm T, Popovici N, Boshmaf Y, Plattner H, Zeier A, Schaffner J. 14 | * SIMD-scan: ultra fast in-memory table scan using on-chip vector processing 15 | * units. 16 | * Proceedings of the VLDB Endowment Aug 2009; 2(1):385-394. 17 | * 18 | * Optimized for a recent Intel core i7 processor by D. Lemire on Oct. 2012. 19 | */ 20 | 21 | #ifndef HORIZONTALBITPACKING_H_ 22 | #define HORIZONTALBITPACKING_H_ 23 | 24 | #ifndef __SSE4_1__ 25 | 26 | #ifndef _MSC_VER 27 | #pragma message "No SSSE4.1 support? try adding -msse4.1" 28 | #endif 29 | #endif 30 | #include "common.h" 31 | 32 | namespace FastPForLib { 33 | 34 | void simdhunpack(const uint8_t *__restrict__ in, uint32_t *__restrict__ out, 35 | uint32_t bit); 36 | } 37 | 38 | #endif /* HORIZONTALBITPACKING_H_ */ 39 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/maropuparser.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef MAROPUPARSER_H_ 9 | #define MAROPUPARSER_H_ 10 | 11 | #include "common.h" 12 | 13 | namespace FastPForLib { 14 | 15 | /** 16 | * This is just a bit of code to parse the binary files provided by the 17 | * Maropu-Open-Coders library at 18 | * http://integerencoding.isti.cnr.it/?page_id=8 19 | */ 20 | class MaropuGapReader { 21 | public: 22 | MaropuGapReader(const std::string &filename) 23 | : mFilename(filename), fd(NULL) {} 24 | MaropuGapReader(const MaropuGapReader &mgr) 25 | : mFilename(mgr.mFilename), fd(NULL) {} 26 | MaropuGapReader &operator=(const MaropuGapReader &mgr) { 27 | close(); 28 | mFilename = mgr.mFilename; 29 | return *this; 30 | } 31 | 32 | std::string mFilename; 33 | FILE *fd; 34 | 35 | ~MaropuGapReader() { close(); } 36 | 37 | // return false if no more data can be loaded 38 | template bool loadIntegers(container &buffer) { 39 | if (fd == NULL) { 40 | std::cerr << "You forgot to open the file." << std::endl; 41 | return false; 42 | } 43 | uint32_t number; 44 | size_t result = fread(&number, sizeof(number), 1, fd); 45 | if (result != 1) { 46 | return false; 47 | } 48 | buffer.resize(number); 49 | result = fread(&(buffer[0]), sizeof(uint32_t), buffer.size(), fd); 50 | if (result != buffer.size()) { 51 | std::cerr << "IO status: " << strerror(errno) << std::endl; 52 | std::cerr << "Error reading from file " << std::endl; 53 | throw std::runtime_error("bad read"); 54 | } 55 | return true; 56 | } 57 | 58 | void open() { 59 | close(); 60 | fd = ::fopen(mFilename.c_str(), "rb"); 61 | if (fd == NULL) { 62 | std::cerr << "IO status: " << strerror(errno) << std::endl; 63 | std::cerr << "Can't open " << mFilename << std::endl; 64 | throw std::runtime_error("could not open temp file"); 65 | } 66 | setvbuf(fd, NULL, _IOFBF, 1024 * 4); // large buffer 67 | } 68 | 69 | void close() { 70 | if (fd != NULL) { 71 | ::fclose(fd); 72 | fd = NULL; 73 | } 74 | } 75 | }; 76 | 77 | } // namespace FastPFor 78 | 79 | #endif /* MAROPUPARSER_H_ */ 80 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/memutil.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef MEMUTIL_H_ 9 | #define MEMUTIL_H_ 10 | 11 | #include "common.h" 12 | 13 | namespace FastPForLib { 14 | 15 | template T *moveToBoundary(T *inbyte) { 16 | return reinterpret_cast( 17 | (reinterpret_cast(inbyte) + (alignment - 1)) & 18 | ~(alignment - 1)); 19 | } 20 | 21 | // use this when calling STL object if you want 22 | // their memory to be aligned on cache lines 23 | template class AlignedSTLAllocator { 24 | public: 25 | // type definitions 26 | typedef T value_type; 27 | typedef T *pointer; 28 | typedef const T *const_pointer; 29 | typedef T &reference; 30 | typedef const T &const_reference; 31 | typedef std::size_t size_type; 32 | typedef std::ptrdiff_t difference_type; 33 | 34 | // rebind allocator to type U 35 | template struct rebind { 36 | typedef AlignedSTLAllocator other; 37 | }; 38 | 39 | pointer address(reference value) const { return &value; } 40 | const_pointer address(const_reference value) const { return &value; } 41 | 42 | /* constructors and destructor 43 | * - nothing to do because the allocator has no state 44 | */ 45 | AlignedSTLAllocator() {} 46 | AlignedSTLAllocator(const AlignedSTLAllocator &) {} 47 | template 48 | AlignedSTLAllocator(const AlignedSTLAllocator &) {} 49 | ~AlignedSTLAllocator() {} 50 | 51 | // return maximum number of elements that can be allocated 52 | size_type max_size() const throw() { 53 | return (std::numeric_limits::max)() / sizeof(T); 54 | } 55 | 56 | /* 57 | * allocate but don't initialize num elements of type T 58 | * 59 | * This implementation is potentially unsafe on some compilers. 60 | */ 61 | pointer allocate(size_type num, const void * = 0) { 62 | /** 63 | * The nasty trick here is to make the position of the actual pointer 64 | * within the newly allocated memory. The alternative is to use 65 | * some kind of data structure like a hash table, which might be slow. 66 | */ 67 | size_t *buffer = reinterpret_cast( 68 | ::operator new(sizeof(uintptr_t) + (num + alignment) * sizeof(T))); 69 | size_t *answer = moveToBoundary(buffer + 1); 70 | *(answer - 1) = reinterpret_cast(answer) - 71 | reinterpret_cast(buffer); 72 | return reinterpret_cast(answer); 73 | } 74 | 75 | void construct(pointer p, const T &value) { 76 | // initialize memory with placement new 77 | new (p) T(value); 78 | } 79 | 80 | // destroy elements of initialized storage p 81 | void destroy(pointer p) { p->~T(); } 82 | 83 | // deallocate storage p of deleted elements 84 | void deallocate(pointer p, size_type /*num*/) { 85 | const size_t *assize_t = reinterpret_cast(p); 86 | const size_t offset = assize_t[-1]; 87 | ::operator delete( 88 | reinterpret_cast(reinterpret_cast(p) - offset)); 89 | } 90 | }; 91 | 92 | // for our purposes, we don't want to distinguish between allocators. 93 | template 94 | bool operator==(const AlignedSTLAllocator &, const T2 &) throw() { 95 | return true; 96 | } 97 | 98 | template 99 | bool operator!=(const AlignedSTLAllocator &, const T2 &) throw() { 100 | return false; 101 | } 102 | // typical cache line 103 | typedef AlignedSTLAllocator cacheallocator; 104 | 105 | } // namespace FastPFor 106 | 107 | #endif /* MEMUTIL_H_ */ 108 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/mersenne.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | */ 5 | 6 | #ifndef MERSENNE_H_ 7 | #define MERSENNE_H_ 8 | 9 | #include "common.h" 10 | #include "util.h" 11 | 12 | namespace FastPForLib { 13 | 14 | /** 15 | * Mersenne twister - random number generator. 16 | * Generate uniform distribution of 32 bit integers with the MT19937 algorithm. 17 | * source: http://bannister.us/weblog/?s=Mersenne 18 | */ 19 | class ZRandom { 20 | 21 | private: 22 | enum { N = 624, M = 397 }; 23 | unsigned int MT[N + 1]; 24 | unsigned int *map[N]; 25 | int nValues; 26 | 27 | public: 28 | ZRandom(unsigned int iSeed = 20070102); 29 | void seed(unsigned iSeed); 30 | unsigned int getValue(); 31 | unsigned int getValue(const uint32_t MaxValue); 32 | double getDouble(); 33 | bool test(const double p); 34 | }; 35 | 36 | ZRandom::ZRandom(unsigned iSeed) : nValues(0) { seed(iSeed); } 37 | 38 | void ZRandom::seed(unsigned iSeed) { 39 | nValues = 0; 40 | // Seed the array used in random number generation. 41 | MT[0] = iSeed; 42 | for (int i = 1; i < N; ++i) { 43 | MT[i] = 1 + (69069 * MT[i - 1]); 44 | } 45 | // Compute map once to avoid % in inner loop. 46 | for (int i = 0; i < N; ++i) { 47 | map[i] = MT + ((i + M) % N); 48 | } 49 | } 50 | 51 | inline bool ZRandom::test(const double p) { return getDouble() <= p; } 52 | inline double ZRandom::getDouble() { 53 | return double(getValue()) * (1.0 / 4294967296.0); 54 | } 55 | 56 | unsigned int ZRandom::getValue(const uint32_t MaxValue) { 57 | unsigned int used = MaxValue; 58 | used |= used >> 1; 59 | used |= used >> 2; 60 | used |= used >> 4; 61 | used |= used >> 8; 62 | used |= used >> 16; 63 | 64 | // Draw numbers until one is found in [0,n] 65 | unsigned int i; 66 | do 67 | i = getValue() & used; // toss unused bits to shorten search 68 | while (i > MaxValue); 69 | return i; 70 | } 71 | 72 | unsigned int ZRandom::getValue() { 73 | if (0 == nValues) { 74 | MT[N] = MT[0]; 75 | for (int i = 0; i < N; ++i) { 76 | unsigned y = (0x80000000 & MT[i]) | (0x7FFFFFFF & MT[i + 1]); 77 | unsigned v = *(map[i]) ^ (y >> 1); 78 | if (1 & y) 79 | v ^= 2567483615; 80 | MT[i] = v; 81 | } 82 | nValues = N; 83 | } 84 | unsigned y = MT[N - nValues--]; 85 | y ^= y >> 11; 86 | y ^= (y << 7) & 2636928640U; 87 | y ^= (y << 15) & 4022730752U; 88 | y ^= y >> 18; 89 | return y; 90 | } 91 | 92 | } // namespace FastPFor 93 | 94 | #endif /* MERSENNE_H_ */ 95 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/packingvectors.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef PACKINGVECTORS_H_ 9 | #define PACKINGVECTORS_H_ 10 | 11 | #include "common.h" 12 | #include "bitpacking.h" 13 | 14 | namespace FastPForLib { 15 | 16 | template class packingvector { 17 | public: 18 | template 19 | static const uint32_t *unpackme(const uint32_t *in, STLContainer &out, 20 | const uint32_t bit) { 21 | const uint32_t size = *in; 22 | ++in; 23 | out.resize((size + PACKSIZE - 1) / PACKSIZE * PACKSIZE); 24 | for (uint32_t j = 0; j != out.size(); j += PACKSIZE) { 25 | fastunpack(in, &out[j], bit); 26 | in += bit; 27 | } 28 | out.resize(size); 29 | return in; 30 | } 31 | 32 | template 33 | static const uint32_t *unpackmetight(const uint32_t *in, STLContainer &out, 34 | const uint32_t bit) { 35 | const uint32_t size = *in; 36 | ++in; 37 | out.resize((size + PACKSIZE - 1) / PACKSIZE * PACKSIZE); 38 | uint32_t j = 0; 39 | for (; j + PACKSIZE - 1 < size; j += PACKSIZE) { 40 | fastunpack(in, &out[j], bit); 41 | in += bit; 42 | } 43 | uint32_t buffer[PACKSIZE]; 44 | uint32_t remaining = size - j; 45 | memcpy(buffer, in, (remaining * bit + 31) / 32 * sizeof(uint32_t)); 46 | uint32_t *bpointer = buffer; 47 | in += (out.size() - j) / PACKSIZE * bit; 48 | for (; j != out.size(); j += PACKSIZE) { 49 | fastunpack(bpointer, &out[j], bit); 50 | bpointer += bit; 51 | } 52 | out.resize(size); 53 | in -= (j - size) * bit / 32; 54 | return in; 55 | } 56 | 57 | template 58 | static uint32_t *packmeup(STLContainer &source, uint32_t *out, 59 | const uint32_t bit) { 60 | const size_t size = source.size(); 61 | *out = static_cast(size); 62 | out++; 63 | if (source.size() == 0) 64 | return out; 65 | source.resize((source.size() + PACKSIZE - 1) / PACKSIZE * PACKSIZE); 66 | for (uint32_t j = 0; j != source.size(); j += PACKSIZE) { 67 | fastpack(&source[j], out, bit); 68 | out += bit; 69 | } 70 | source.resize(size); 71 | return out; 72 | } 73 | 74 | template 75 | static uint32_t *packmeupwithoutmask(STLContainer &source, uint32_t *out, 76 | const uint32_t bit) { 77 | const size_t size = source.size(); 78 | *out = static_cast(size); 79 | out++; 80 | if (source.size() == 0) 81 | return out; 82 | source.resize((source.size() + PACKSIZE - 1) / PACKSIZE * PACKSIZE); 83 | for (uint32_t j = 0; j != source.size(); j += PACKSIZE) { 84 | fastpackwithoutmask(&source[j], out, bit); 85 | out += bit; 86 | } 87 | source.resize(size); 88 | return out; 89 | } 90 | 91 | template 92 | static uint32_t *packmeuptightwithoutmask(STLContainer &source, uint32_t *out, 93 | const uint32_t bit) { 94 | const size_t size = source.size(); 95 | *out = static_cast(size); 96 | out++; 97 | if (source.size() == 0) 98 | return out; 99 | source.resize((source.size() + PACKSIZE - 1) / PACKSIZE * PACKSIZE); 100 | uint32_t j = 0; 101 | for (; j != source.size(); j += PACKSIZE) { 102 | fastpackwithoutmask(&source[j], out, bit); 103 | out += bit; 104 | } 105 | out -= (j - size) * bit / 32; 106 | source.resize(size); 107 | return out; 108 | } 109 | }; 110 | 111 | } // namespace FastPFor 112 | 113 | #endif /* PACKINGVECTORS_H_ */ 114 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/simdbitpacking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire 6 | */ 7 | #ifndef SIMDBITPACKING_H_ 8 | #define SIMDBITPACKING_H_ 9 | 10 | #include "common.h" 11 | 12 | namespace FastPForLib { 13 | 14 | void simdpack(const uint32_t *__restrict__ in, __m128i *__restrict__ out, 15 | uint32_t bit); 16 | void simdpackwithoutmask(const uint32_t *__restrict__ in, 17 | __m128i *__restrict__ out, uint32_t bit); 18 | void simdunpack(const __m128i *__restrict__ in, uint32_t *__restrict__ out, 19 | uint32_t bit); 20 | 21 | void SIMD_fastunpack_32(const __m128i *__restrict__ in, 22 | uint32_t *__restrict__ out, const uint32_t bit); 23 | void SIMD_fastpackwithoutmask_32(const uint32_t *__restrict__ in, 24 | __m128i *__restrict__ out, const uint32_t bit); 25 | void SIMD_fastpack_32(const uint32_t *__restrict__ in, 26 | __m128i *__restrict__ out, const uint32_t bit); 27 | 28 | } // namespace FastPFor 29 | 30 | #endif /* SIMDBITPACKING_H_ */ 31 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/simdvariablebyte.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Part of the copyright is to Indeed.com 3 | * Licensed under the Apache License Version 2.0 4 | */ 5 | /* 6 | * Based on an initial design by Jeff Plaisance and 7 | * improved by Nathan Kurz. 8 | */ 9 | 10 | #ifndef SIMDVARIABLEBYTE_H_ 11 | #define SIMDVARIABLEBYTE_H_ 12 | 13 | #if ! defined(_MSC_VER) // code relies on compound literals which Visual Studio fails to support. TODO: code a workaround 14 | 15 | 16 | #include "common.h" 17 | #include "codecs.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | size_t masked_vbyte_read_loop_fromcompressedsize(const uint8_t *in, 23 | uint32_t *out, 24 | size_t inputsize); 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | /** 30 | * SIMD-accelerated version of VariableByteAlt. 31 | */ 32 | class MaskedVByte : public FastPForLib::IntegerCODEC { 33 | public: 34 | MaskedVByte() {} 35 | 36 | void encodeArray(const uint32_t *in, const size_t length, uint32_t *out, 37 | size_t &nvalue) { 38 | const uint8_t *const initbout = reinterpret_cast(out); 39 | uint8_t *bout = reinterpret_cast(out); 40 | for (size_t k = 0; k < length; ++k) { 41 | const uint32_t val(in[k]); 42 | /** 43 | * Code below could be shorter. Whether it could be faster 44 | * depends on your compiler and machine. 45 | */ 46 | if (val < (1U << 7)) { 47 | *bout = val & 0x7F; 48 | ++bout; 49 | } else if (val < (1U << 14)) { 50 | *bout = static_cast((val & 0x7F) | (1U << 7)); 51 | ++bout; 52 | *bout = static_cast(val >> 7); 53 | ++bout; 54 | } else if (val < (1U << 21)) { 55 | *bout = static_cast((val & 0x7F) | (1U << 7)); 56 | ++bout; 57 | *bout = static_cast(((val >> 7) & 0x7F) | (1U << 7)); 58 | ++bout; 59 | *bout = static_cast(val >> 14); 60 | ++bout; 61 | } else if (val < (1U << 28)) { 62 | *bout = static_cast((val & 0x7F) | (1U << 7)); 63 | ++bout; 64 | *bout = static_cast(((val >> 7) & 0x7F) | (1U << 7)); 65 | ++bout; 66 | *bout = static_cast(((val >> 14) & 0x7F) | (1U << 7)); 67 | ++bout; 68 | *bout = static_cast(val >> 21); 69 | ++bout; 70 | } else { 71 | *bout = static_cast((val & 0x7F) | (1U << 7)); 72 | ++bout; 73 | *bout = static_cast(((val >> 7) & 0x7F) | (1U << 7)); 74 | ++bout; 75 | *bout = static_cast(((val >> 14) & 0x7F) | (1U << 7)); 76 | ++bout; 77 | *bout = static_cast(((val >> 21) & 0x7F) | (1U << 7)); 78 | ++bout; 79 | *bout = static_cast(val >> 28); 80 | ++bout; 81 | } 82 | } 83 | while (FastPForLib::needPaddingTo32Bits(bout)) { 84 | *bout++ = 0xFFU; 85 | } 86 | const size_t storageinbytes = bout - initbout; 87 | nvalue = storageinbytes / 4; 88 | } 89 | 90 | const uint32_t *decodeArray(const uint32_t *in, const size_t length, 91 | uint32_t *out, size_t &nvalue) { 92 | const uint8_t *inbyte = reinterpret_cast(in); 93 | nvalue = masked_vbyte_read_loop_fromcompressedsize(inbyte, out, length * 4); 94 | return reinterpret_cast(inbyte); 95 | return in + length; 96 | } 97 | 98 | std::string name() const { return "MaskedVByte"; } 99 | }; 100 | #endif 101 | #endif /* SIMDVARIABLEBYTE_H_ */ 102 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/snappydelta.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | */ 5 | /** 6 | * Goal here is to use Google Snappy to compress deltas. 7 | * This is purely for comparison sake, not necessarily 8 | * because this is a good idea a priori. 9 | */ 10 | #ifdef USESNAPPY 11 | 12 | #ifndef SNAPPYDELTA_H_ 13 | #define SNAPPYDELTA_H_ 14 | 15 | #include 16 | #include "common.h" 17 | #include "codecs.h" 18 | 19 | namespace FastPFor { 20 | 21 | class JustSnappy : public IntegerCODEC { 22 | public: 23 | void encodeArray(const uint32_t *in, const size_t length, uint32_t *out, 24 | size_t &nvalue) { 25 | size_t howmuchroom = nvalue * 4; 26 | snappy::RawCompress(reinterpret_cast(in), length * 4, 27 | reinterpret_cast(out), &howmuchroom); 28 | nvalue = (howmuchroom + 3) / 4; 29 | } 30 | 31 | const uint32_t *decodeArray(const uint32_t *in, const size_t length, 32 | uint32_t *out, size_t &nvalue) { 33 | size_t nvalueinbytes; 34 | bool ok = snappy::GetUncompressedLength(reinterpret_cast(in), 35 | length * 4, &nvalueinbytes); 36 | assert(nvalueinbytes % 4 == 0); 37 | nvalue = nvalueinbytes / 4; 38 | if (!ok) 39 | throw logic_error("got some bug retrieving length"); 40 | snappy::RawUncompress(reinterpret_cast(in), length * 4, 41 | reinterpret_cast(out)); 42 | return in + length; 43 | } 44 | string name() const { return "Snappy"; } 45 | }; 46 | 47 | } // namespace FastPFor 48 | 49 | #endif /* SNAPPYDELTA_H_ */ 50 | 51 | #endif // USESNAPPY 52 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/streamvariablebyte.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | 9 | 10 | #ifndef _STREAMVARIABLEBYTE_ 11 | #define _STREAMVARIABLEBYTE_ 12 | #if !(defined(_MSC_VER)) // todo : need to be ported to Visual Studio 13 | #include "common.h" 14 | #include "codecs.h" 15 | 16 | namespace FastPForLib { 17 | 18 | /** 19 | * StreamVByte is an integer CODEC invented by Nathan Kurz. 20 | */ 21 | 22 | extern "C" { 23 | uint64_t svb_encode(uint8_t *out, const uint32_t *in, uint32_t count, int delta, 24 | int type); 25 | uint8_t *svb_decode_avx_simple(uint32_t *out, uint8_t *keyPtr, uint8_t *dataPtr, 26 | uint64_t count); 27 | uint8_t *svb_decode_avx_d1_simple(uint32_t *out, uint8_t *keyPtr, 28 | uint8_t *dataPtr, uint64_t count); 29 | uint8_t *svb_decode_scalar_d1_init(uint32_t *outPtr, const uint8_t *keyPtr, 30 | uint8_t *dataPtr, uint32_t count, 31 | uint32_t prev); 32 | uint32_t svb_select_avx_d1_init(uint8_t *keyPtr, uint8_t *dataPtr, 33 | uint64_t count, uint32_t prev, int slot); 34 | int svb_find_avx_d1_init(uint8_t *keyPtr, uint8_t *dataPtr, uint64_t count, 35 | uint32_t prev, uint32_t key, uint32_t *presult); 36 | uint8_t *svb_insert_scalar_d1_init(uint8_t *keyPtr, uint8_t *dataPtr, 37 | size_t dataSize, uint32_t count, 38 | uint32_t prev, uint32_t new_key, 39 | uint32_t *position); 40 | uint8_t *svb_append_scalar_d1(uint8_t *keyPtr, uint8_t *dataPtr, 41 | size_t sizebytes, size_t count, uint32_t delta); 42 | } 43 | 44 | /** 45 | * Regular StreamVByte (no differential coding) 46 | */ 47 | class StreamVByte : public IntegerCODEC { 48 | public: 49 | void encodeArray(const uint32_t *in, const size_t count, uint32_t *out, 50 | size_t &nvalue) { 51 | uint64_t bytesWritten = svb_encode( 52 | (uint8_t *)out, in, static_cast(std::min( 53 | count, std::numeric_limits::max())), 54 | 0, 1); 55 | nvalue = static_cast(bytesWritten + 3) / 4; 56 | } 57 | 58 | const uint32_t *decodeArray(const uint32_t *in, const size_t /* count */, 59 | uint32_t *out, size_t &nvalue) { 60 | uint32_t count = *(uint32_t *)in; // first 4 bytes is number of ints 61 | nvalue = count; 62 | if (count == 0) 63 | return 0; 64 | 65 | uint8_t *keyPtr = (uint8_t *)in + 4; // full list of keys is next 66 | uint32_t keyLen = ((count + 3) / 4); // 2-bits per key (rounded up) 67 | uint8_t *dataPtr = keyPtr + keyLen; // data starts at end of keys 68 | nvalue = count; 69 | return reinterpret_cast( 70 | (reinterpret_cast( 71 | svb_decode_avx_simple(out, keyPtr, dataPtr, count)) + 72 | 3) & 73 | ~3); 74 | } 75 | 76 | std::string name() const { return "streamvbyte"; } 77 | }; 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/stringutil.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #ifndef STRINGUTIL_H_ 9 | #define STRINGUTIL_H_ 10 | 11 | #include "common.h" 12 | #include "util.h" 13 | 14 | namespace FastPForLib { 15 | 16 | using namespace std; 17 | 18 | std::vector split(const std::string &str, const std::string &del) { 19 | std::vector tokens; 20 | size_t lastPos = str.find_first_not_of(del, 0); 21 | size_t pos = str.find_first_of(del, lastPos); 22 | while (std::string::npos != pos || std::string::npos != lastPos) { 23 | tokens.push_back(str.substr(lastPos, pos - lastPos)); 24 | lastPos = str.find_first_not_of(del, pos); 25 | pos = str.find_first_of(del, lastPos); 26 | } 27 | return tokens; 28 | } 29 | 30 | } // namespace FastPFor 31 | 32 | #endif /* STRINGUTIL_H_ */ 33 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/usimdbitpacking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire 6 | */ 7 | #ifndef USIMDBITPACKING_H_ 8 | #define USIMDBITPACKING_H_ 9 | 10 | #include "common.h" 11 | 12 | namespace FastPForLib { 13 | 14 | void usimdpack(const uint32_t *__restrict__ in, __m128i *__restrict__ out, 15 | uint32_t bit); 16 | void usimdpackwithoutmask(const uint32_t *__restrict__ in, 17 | __m128i *__restrict__ out, uint32_t bit); 18 | void usimdunpack(const __m128i *__restrict__ in, uint32_t *__restrict__ out, 19 | uint32_t bit); 20 | 21 | } // namespace FastPFor 22 | 23 | #endif /* SIMDBITPACKING_H_ */ 24 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/headers/ztimer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | */ 5 | 6 | #ifndef ZTIMER 7 | #define ZTIMER 8 | 9 | #include "common.h" 10 | 11 | namespace FastPForLib { 12 | 13 | // 14 | // VS2012 bug: high_precision_clock is defined as system_clock and precision is 15 | // about 15 MS!! 16 | // See: https://connect.microsoft.com/VisualStudio/feedback/details/719443 17 | // 18 | // Implementation has been taken from a post on stackoverflow and adapted here 19 | // http://stackoverflow.com/questions/13263277/difference-between-stdsystem-clock-and-stdsteady-clock 20 | // 21 | #ifdef _WIN32 22 | #define NOMINMAX 23 | #define WINDOWS_LEAN_AND_MEAN 24 | #include 25 | 26 | struct qpc_clock { 27 | typedef std::chrono::nanoseconds duration; 28 | typedef duration::rep rep; 29 | typedef duration::period period; 30 | typedef std::chrono::time_point time_point; 31 | static time_point now() { 32 | static bool isInited = false; 33 | static LARGE_INTEGER frequency = {0, 0}; 34 | if (!isInited) { 35 | if (QueryPerformanceFrequency(&frequency) == 0) { 36 | throw std::logic_error("QueryPerformanceCounter not supported: " + 37 | std::to_string(GetLastError())); 38 | } 39 | isInited = true; 40 | } 41 | LARGE_INTEGER counter; 42 | QueryPerformanceCounter(&counter); 43 | return time_point(duration(static_cast((double)counter.QuadPart / 44 | frequency.QuadPart * 45 | period::den / period::num))); 46 | } 47 | }; 48 | 49 | #endif 50 | 51 | /** 52 | * author: Preston Bannister 53 | */ 54 | class WallClockTimer { 55 | public: 56 | #ifdef _WIN32 57 | typedef qpc_clock clock; 58 | #else 59 | typedef std::chrono::high_resolution_clock clock; 60 | #endif 61 | 62 | std::chrono::time_point t1, t2; 63 | WallClockTimer() : t1(), t2() { 64 | t1 = clock::now(); 65 | t2 = t1; 66 | } 67 | void reset() { 68 | t1 = clock::now(); 69 | t2 = t1; 70 | } 71 | uint64_t elapsed() { 72 | std::chrono::microseconds delta = 73 | std::chrono::duration_cast(t2 - t1); 74 | return delta.count(); 75 | } 76 | uint64_t split() { 77 | t2 = clock::now(); 78 | return elapsed(); 79 | } 80 | }; 81 | 82 | #ifndef _WIN32 83 | 84 | class CPUTimer { 85 | public: 86 | // clock_t t1, t2; 87 | struct rusage t1, t2; 88 | 89 | CPUTimer() : t1(), t2() { 90 | getrusage(RUSAGE_SELF, &t1); 91 | // t1 = clock(); 92 | t2 = t1; 93 | } 94 | void reset() { 95 | getrusage(RUSAGE_SELF, &t1); 96 | t2 = t1; 97 | } 98 | // proxy for userelapsed 99 | uint64_t elapsed() { return totalelapsed(); } 100 | 101 | uint64_t totalelapsed() { return userelapsed() + systemelapsed(); } 102 | // returns the *user* CPU time in micro seconds (mu s) 103 | uint64_t userelapsed() { 104 | return ((t2.ru_utime.tv_sec - t1.ru_utime.tv_sec) * 1000ULL * 1000ULL) + 105 | ((t2.ru_utime.tv_usec - t1.ru_utime.tv_usec)); 106 | } 107 | 108 | // returns the *system* CPU time in micro seconds (mu s) 109 | uint64_t systemelapsed() { 110 | return ((t2.ru_stime.tv_sec - t1.ru_stime.tv_sec) * 1000ULL * 1000ULL) + 111 | ((t2.ru_stime.tv_usec - t1.ru_stime.tv_usec)); 112 | } 113 | 114 | uint64_t split() { 115 | getrusage(RUSAGE_SELF, &t2); 116 | return elapsed(); 117 | } 118 | }; 119 | 120 | #endif 121 | 122 | } // namespace FastPFor 123 | 124 | #endif 125 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/inmemorybenchmark: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/inmemorybenchmark -------------------------------------------------------------------------------- /Switch/ext/FastPFor/msvc/FastPFor.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {42D8ABA4-FC4E-426C-A833-D64D06081F92} 15 | FastPFor 16 | 8.1 17 | 18 | 19 | 20 | StaticLibrary 21 | true 22 | v140 23 | MultiByte 24 | 25 | 26 | StaticLibrary 27 | false 28 | v140 29 | true 30 | MultiByte 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Level3 48 | Disabled 49 | true 50 | ../headers 51 | 52 | 53 | true 54 | 55 | 56 | 57 | 58 | Level3 59 | MaxSpeed 60 | true 61 | true 62 | true 63 | ../headers 64 | 65 | 66 | true 67 | true 68 | true 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/msvc/getopt.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {D0D480B3-816E-4A04-8AE4-75210F8701E0} 15 | getopt 16 | 8.1 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | v140 23 | MultiByte 24 | 25 | 26 | DynamicLibrary 27 | false 28 | v140 29 | true 30 | MultiByte 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Level3 48 | Disabled 49 | true 50 | $(IntDir)$(ProjectName).pdb 51 | 52 | 53 | 54 | Debug 55 | 56 | 57 | 58 | 59 | Level3 60 | MaxSpeed 61 | true 62 | true 63 | true 64 | $(IntDir)$(ProjectName).pdb 65 | 66 | 67 | true 68 | true 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/msvc/unit.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {8B2ED3AF-F2E8-480B-BE7D-7B6E44DC4BFE} 15 | unit 16 | 17 | 18 | 19 | Application 20 | true 21 | v140 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v140 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Level3 47 | Disabled 48 | true 49 | ../headers 50 | $(IntDir)$(ProjectName).pdb 51 | 52 | 53 | Console 54 | Debug 55 | 56 | 57 | 58 | 59 | Level3 60 | MaxSpeed 61 | true 62 | true 63 | true 64 | ../headers 65 | $(IntDir)$(ProjectName).pdb 66 | 67 | 68 | true 69 | true 70 | Console 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | {42d8aba4-fc4e-426c-a833-d64d06081f92} 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/partitionbylength: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/partitionbylength -------------------------------------------------------------------------------- /Switch/ext/FastPFor/src/csv2maropu.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #include 9 | #include 10 | #include "csv.h" 11 | #include "externalvector.h" 12 | #include "util.h" 13 | 14 | using namespace std; 15 | using namespace FastPForLib; 16 | 17 | void print(externalvector &ev) { 18 | for (size_t i = 0; i < ev.size(); ++i) { 19 | vector x = ev.get(i); 20 | for (size_t k = 0; k < x.size(); ++k) 21 | cout << x[k] << " "; 22 | cout << endl; 23 | } 24 | } 25 | 26 | int main(int argc, char **argv) { 27 | if (argc < 3) { 28 | cerr << " This will map a table (stored in a CSV file) to a row " 29 | " oriented flat file of frequency attributed 32-bit integers " 30 | << endl; 31 | cerr << " usage : cvs2maropu mycvsfile.cvs mymaropufile.bin " << endl; 32 | return -1; 33 | } 34 | string ifilename(argv[1]); 35 | string ofilename(argv[2]); 36 | CSVFlatFile cvs(ifilename.c_str(), CSVFlatFile::FREQNORMALISATION); 37 | const size_t c = cvs.getNumberOfColumns(); 38 | const size_t N = cvs.getNumberOfRows(); 39 | size_t integers = static_cast(c * N); 40 | vector container(c); 41 | FILE *fd = ::fopen(ofilename.c_str(), "w+b"); 42 | if (fd == NULL) { 43 | cout << " could not open " << ofilename << " for writing..." << endl; 44 | cvs.close(); 45 | return -1; 46 | } 47 | uint32_t MAXSIZE = static_cast(c * (1U << 20)); 48 | for (size_t block = 0; block * MAXSIZE >= integers; integers -= MAXSIZE) { 49 | if (fwrite(&MAXSIZE, sizeof(MAXSIZE), 1, fd) != 1) { 50 | cerr << "aborting" << endl; 51 | ::fclose(fd); 52 | cvs.close(); 53 | return -1; 54 | } 55 | uint32_t counter = 0; 56 | while (cvs.nextRow(container)) { 57 | if (fwrite(&container[0], c * sizeof(uint32_t), 1, fd) != 1) { 58 | cerr << "aborting" << endl; 59 | ::fclose(fd); 60 | cvs.close(); 61 | return -1; 62 | } 63 | counter += static_cast(c); 64 | if (counter == block) 65 | break; 66 | assert(counter < block); 67 | } 68 | } 69 | if (integers > 0) { 70 | uint32_t tsize = static_cast(integers); 71 | if (fwrite(&tsize, sizeof(tsize), 1, fd) != 1) { 72 | cerr << "aborting" << endl; 73 | ::fclose(fd); 74 | cvs.close(); 75 | return -1; 76 | } 77 | while (cvs.nextRow(container)) { 78 | if (fwrite(&container[0], c * sizeof(uint32_t), 1, fd) != 1) { 79 | cerr << "aborting" << endl; 80 | ::fclose(fd); 81 | cvs.close(); 82 | return -1; 83 | } 84 | } 85 | } 86 | ::fclose(fd); 87 | cvs.close(); 88 | cout << "#file " << ofilename << " contains your data." << endl; 89 | } 90 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/src/entropy.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | #include "common.h" 9 | #include "maropuparser.h" 10 | #include "util.h" 11 | #include "entropy.h" 12 | #include "deltautil.h" 13 | 14 | using namespace std; 15 | using namespace FastPForLib; 16 | 17 | void message(const char *prog) { 18 | cerr << " usage : " << prog << " maropubinaryfile " << endl; 19 | cerr << "By default, is assumes that the original data is made of " 20 | "sorted integers." 21 | << endl; 22 | cerr << "The -nodelta flag disables delta coding." << endl; 23 | cerr << "The -minlength ignores all arrays smaller than a threshold." << endl; 24 | } 25 | 26 | int main(int argc, char **argv) { 27 | uint32_t MAXCOUNTER = 1U << 31; 28 | if (argc < 2) { 29 | message(argv[0]); 30 | return -1; 31 | } 32 | enum { DELTA, NODELTA }; 33 | int mode = DELTA; 34 | uint32_t MINLENGTH = 2; 35 | int argindex = 1; 36 | while (true) { 37 | if (strcmp(argv[argindex], "-minlength") == 0) { 38 | ++argindex; 39 | MINLENGTH = atoi(argv[argindex++]); 40 | } else if (strcmp(argv[argindex], "-nodelta") == 0) { 41 | mode = NODELTA; 42 | ++argindex; 43 | } else 44 | break; 45 | } 46 | cout << "# computing entropy" << endl; 47 | string filename = argv[argindex++]; 48 | if (argindex < argc) 49 | MAXCOUNTER = atoi(argv[argindex++]); 50 | cout << "# parsing " << filename << endl; 51 | MaropuGapReader reader(filename); 52 | vector rawdata; 53 | reader.open(); 54 | size_t counter = 0; 55 | size_t integers = 0; 56 | EntropyRecorder er; 57 | while (reader.loadIntegers(rawdata)) { 58 | if (rawdata.size() < MINLENGTH) 59 | continue; 60 | if (mode == DELTA) 61 | Delta::delta(&rawdata[0], rawdata.size()); 62 | er.eat(&rawdata[0], rawdata.size()); 63 | ++counter; 64 | integers += rawdata.size(); 65 | if (counter >= MAXCOUNTER) { 66 | cout << "#breaking early" << endl; 67 | break; 68 | } 69 | } 70 | reader.close(); 71 | cout << "# integers = " << integers << endl; 72 | cout << "# arrays = " << counter << endl; 73 | cout << "# next line is shannon entropy and data bits" << endl; 74 | cout << er.computeShannon() << "\t" << er.computeDataBits() << endl; 75 | } 76 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/src/gapstats.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | #include 8 | #include "maropuparser.h" 9 | #include "util.h" 10 | 11 | using namespace std; 12 | using namespace FastPForLib; 13 | 14 | int main(int argc, char **argv) { 15 | BitWidthHistoGram histo; 16 | BitWidthHistoGram histolength; 17 | if (argc < 2) { 18 | cerr << "please provide a file name" << endl; 19 | return -1; 20 | } 21 | size_t MINLENGTH = 2; 22 | size_t MAXCOUNT = 200000; 23 | int argindex = 1; 24 | while (true) { 25 | if (strcmp(argv[argindex], "-minlength") == 0) { 26 | ++argindex; 27 | MINLENGTH = atoi(argv[argindex++]); 28 | } else if (strcmp(argv[argindex], "-maxcount") == 0) { 29 | ++argindex; 30 | MAXCOUNT = atoi(argv[argindex++]); 31 | } else 32 | break; 33 | } 34 | string filename = argv[argindex++]; 35 | cout << "# parsing " << filename << endl; 36 | MaropuGapReader reader(filename); 37 | vector rawdata; 38 | reader.open(); 39 | uint32_t counter = 0; 40 | while (reader.loadIntegers(rawdata)) { 41 | if (rawdata.size() < MINLENGTH) 42 | continue; 43 | ++counter; 44 | histo.eatDGaps(rawdata); 45 | histolength.histo[gccbits(static_cast(rawdata.size()))] += 1; 46 | if (counter + 1 > MAXCOUNT) { 47 | cout << "# bailing out early " << (counter) << endl; 48 | break; 49 | } 50 | } 51 | cout << "#bit width" << endl; 52 | histo.display(); 53 | cout << "#lengths:" << endl; 54 | histolength.display("#"); 55 | reader.close(); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/src/horizontalbitpacking.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/src/horizontalbitpacking.cpp -------------------------------------------------------------------------------- /Switch/ext/FastPFor/src/partitionbylength.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | /** 8 | * The ideas is to partition a database of arrays 9 | * according to their length. We partition by the 10 | * integer logarithm of the length so that arrays 11 | * having length from 2^L to 2^L-1 will be stored 12 | * together. 13 | */ 14 | 15 | #include 16 | #include 17 | #include "maropuparser.h" 18 | #include "util.h" 19 | 20 | using namespace std; 21 | using namespace FastPForLib; 22 | 23 | int main(int argc, char **argv) { 24 | if (argc < 2) { 25 | cerr << "please provide an input file name" << endl; 26 | return -1; 27 | } 28 | int argindex = 1; 29 | 30 | string filename = argv[argindex++]; 31 | cout << "# parsing " << filename << endl; 32 | MaropuGapReader reader(filename); 33 | vector rawdata; 34 | reader.open(); 35 | map output; 36 | map counter; 37 | map name; 38 | while (reader.loadIntegers(rawdata)) { 39 | uint32_t lengthinbits = gccbits(static_cast(rawdata.size())); 40 | if (output.find(lengthinbits) == output.end()) { 41 | ostringstream o; 42 | o << filename << "." << lengthinbits; 43 | cout << "creating output file " << o.str() << endl; 44 | FILE *fd = ::fopen(o.str().c_str(), "w+b"); 45 | if (fd == NULL) { 46 | cerr << strerror(errno) << endl; 47 | cerr << "can't open " << o.str().c_str() << endl; 48 | break; 49 | } 50 | setvbuf(fd, NULL, _IOFBF, 1024 * 4); // large buffer 51 | output[lengthinbits] = fd; 52 | counter[lengthinbits] = 0; 53 | name[lengthinbits] = o.str(); 54 | } 55 | uint32_t thislength = static_cast(rawdata.size()); 56 | if (fwrite(&thislength, sizeof(thislength), 1, output[lengthinbits]) != 1) { 57 | cerr << "problem writing" << endl; 58 | break; 59 | } 60 | if (fwrite(&rawdata[0], sizeof(uint32_t), thislength, 61 | output[lengthinbits]) != thislength) { 62 | cerr << "problem writing" << endl; 63 | break; 64 | } 65 | counter[lengthinbits]++; 66 | } 67 | auto i = output.begin(); 68 | auto j = counter.begin(); 69 | auto k = name.begin(); 70 | for (; i != output.end(); ++i, ++j, ++k) { 71 | cout << "file " << k->second << " contains " << j->second << " arrays" 72 | << endl; 73 | ::fclose(i->second); 74 | } 75 | reader.close(); 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/tools/clang-format.sh: -------------------------------------------------------------------------------- 1 | STYLE=$(which clang-format) 2 | if [ $? -ne 0 ]; then 3 | echo "clang-format not installed. Unable to check source file format policy." >&2 4 | exit 1 5 | fi 6 | RE=0 7 | BASE=$(git rev-parse --show-toplevel) 8 | if [ $? -ne 0 ]; then 9 | ALLFILES=$(find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.hh') 10 | else 11 | ALLFILES=$(git ls-tree --full-tree --name-only -r HEAD | grep -e ".*\.\(c\|h\|cc\|cpp\|hh\)\$") 12 | fi 13 | for FILE in $ALLFILES; do 14 | $STYLE $BASE/$FILE | cmp -s $BASE/$FILE - 15 | if [ $? -ne 0 ]; then 16 | echo "$BASE/$FILE does not respect the coding style. Formatting. " >&2 17 | $STYLE -i $BASE/$FILE 18 | RE=1 19 | fi 20 | done 21 | 22 | exit $RE 23 | -------------------------------------------------------------------------------- /Switch/ext/FastPFor/unit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaistos-networks/KMS/98ed18422e4c113c7a9fcd18cf05f10ea44ef6e1/Switch/ext/FastPFor/unit -------------------------------------------------------------------------------- /Switch/ext_snappy/Makefile: -------------------------------------------------------------------------------- 1 | all: libsnappy.a 2 | 3 | libsnappy.a: snappy.o snappy-sinksource.o snappy-stubs-internal.o 4 | ar rc libsnappy.a snappy.o snappy-sinksource.o snappy-stubs-internal.o 5 | 6 | 7 | .o : .cpp 8 | 9 | clean: 10 | rm -f *.o 11 | 12 | .PHONY: clean 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Switch/ext_snappy/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* Define to 1 if the compiler supports __builtin_ctz and friends. */ 8 | #define HAVE_BUILTIN_CTZ 1 9 | 10 | /* Define to 1 if the compiler supports __builtin_expect. */ 11 | #define HAVE_BUILTIN_EXPECT 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_DLFCN_H 1 15 | 16 | /* Use the gflags package for command-line parsing. */ 17 | /* #undef HAVE_GFLAGS */ 18 | 19 | /* Defined when Google Test is available. */ 20 | /* #undef HAVE_GTEST */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_INTTYPES_H 1 24 | 25 | /* Define to 1 if you have the `fastlz' library (-lfastlz). */ 26 | /* #undef HAVE_LIBFASTLZ */ 27 | 28 | /* Define to 1 if you have the `lzf' library (-llzf). */ 29 | /* #undef HAVE_LIBLZF */ 30 | 31 | /* Define to 1 if you have the `lzo2' library (-llzo2). */ 32 | #define HAVE_LIBLZO2 1 33 | 34 | /* Define to 1 if you have the `quicklz' library (-lquicklz). */ 35 | /* #undef HAVE_LIBQUICKLZ */ 36 | 37 | /* Define to 1 if you have the `z' library (-lz). */ 38 | #define HAVE_LIBZ 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_MEMORY_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_STDDEF_H 1 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #define HAVE_STDINT_H 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_STDLIB_H 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_STRINGS_H 1 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #define HAVE_STRING_H 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_SYS_STAT_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_SYS_TYPES_H 1 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #define HAVE_UNISTD_H 1 66 | 67 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 68 | */ 69 | #define LT_OBJDIR ".libs/" 70 | 71 | /* Name of package */ 72 | #define PACKAGE "snappy" 73 | 74 | /* Define to the address where bug reports for this package should be sent. */ 75 | #define PACKAGE_BUGREPORT "" 76 | 77 | /* Define to the full name of this package. */ 78 | #define PACKAGE_NAME "snappy" 79 | 80 | /* Define to the full name and version of this package. */ 81 | #define PACKAGE_STRING "snappy 1.0.0" 82 | 83 | /* Define to the one symbol short name of this package. */ 84 | #define PACKAGE_TARNAME "snappy" 85 | 86 | /* Define to the home page for this package. */ 87 | #define PACKAGE_URL "" 88 | 89 | /* Define to the version of this package. */ 90 | #define PACKAGE_VERSION "1.0.0" 91 | 92 | /* Define to 1 if you have the ANSI C header files. */ 93 | #define STDC_HEADERS 1 94 | 95 | /* Version number of package */ 96 | #define VERSION "1.0.0" 97 | 98 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 99 | significant byte first (like Motorola and SPARC, unlike Intel). */ 100 | #if defined AC_APPLE_UNIVERSAL_BUILD 101 | # if defined __BIG_ENDIAN__ 102 | # define WORDS_BIGENDIAN 1 103 | # endif 104 | #else 105 | # ifndef WORDS_BIGENDIAN 106 | /* # undef WORDS_BIGENDIAN */ 107 | # endif 108 | #endif 109 | -------------------------------------------------------------------------------- /Switch/ext_snappy/snappy-sinksource.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All Rights Reserved. 2 | 3 | 4 | #include "snappy-sinksource.h" 5 | #include 6 | 7 | namespace snappy { 8 | 9 | Source::~Source() { } 10 | 11 | Sink::~Sink() { } 12 | 13 | char* Sink::GetAppendBuffer(size_t length, char* scratch) { 14 | return scratch; 15 | } 16 | 17 | ByteArraySource::~ByteArraySource() { } 18 | 19 | size_t ByteArraySource::Available() const { return left_; } 20 | 21 | const char* ByteArraySource::Peek(size_t* len) { 22 | *len = left_; 23 | return ptr_; 24 | } 25 | 26 | void ByteArraySource::Skip(size_t n) { 27 | left_ -= n; 28 | ptr_ += n; 29 | } 30 | 31 | UncheckedByteArraySink::~UncheckedByteArraySink() { } 32 | 33 | void UncheckedByteArraySink::Append(const char* data, size_t n) { 34 | // Do no copying if the caller filled in the result of GetAppendBuffer() 35 | if (data != dest_) { 36 | memcpy(dest_, data, n); 37 | } 38 | dest_ += n; 39 | } 40 | 41 | char* UncheckedByteArraySink::GetAppendBuffer(size_t len, char* scratch) { 42 | return dest_; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Switch/ext_snappy/snappy-sinksource.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All Rights Reserved. 2 | 3 | #ifndef UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ 4 | #define UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ 5 | 6 | #include 7 | 8 | 9 | namespace snappy { 10 | 11 | // A Sink is an interface that consumes a sequence of bytes. 12 | class Sink { 13 | public: 14 | Sink() { } 15 | virtual ~Sink(); 16 | 17 | // Append "bytes[0,n-1]" to this. 18 | virtual void Append(const char* bytes, size_t n) = 0; 19 | 20 | // Returns a writable buffer of the specified length for appending. 21 | // May return a pointer to the caller-owned scratch buffer which 22 | // must have at least the indicated length. The returned buffer is 23 | // only valid until the next operation on this Sink. 24 | // 25 | // After writing at most "length" bytes, call Append() with the 26 | // pointer returned from this function and the number of bytes 27 | // written. Many Append() implementations will avoid copying 28 | // bytes if this function returned an internal buffer. 29 | // 30 | // If a non-scratch buffer is returned, the caller may only pass a 31 | // prefix of it to Append(). That is, it is not correct to pass an 32 | // interior pointer of the returned array to Append(). 33 | // 34 | // The default implementation always returns the scratch buffer. 35 | virtual char* GetAppendBuffer(size_t length, char* scratch); 36 | 37 | private: 38 | // No copying 39 | Sink(const Sink&); 40 | void operator=(const Sink&); 41 | }; 42 | 43 | // A Source is an interface that yields a sequence of bytes 44 | class Source { 45 | public: 46 | Source() { } 47 | virtual ~Source(); 48 | 49 | // Return the number of bytes left to read from the source 50 | virtual size_t Available() const = 0; 51 | 52 | // Peek at the next flat region of the source. Does not reposition 53 | // the source. The returned region is empty iff Available()==0. 54 | // 55 | // Returns a pointer to the beginning of the region and store its 56 | // length in *len. 57 | // 58 | // The returned region is valid until the next call to Skip() or 59 | // until this object is destroyed, whichever occurs first. 60 | // 61 | // The returned region may be larger than Available() (for example 62 | // if this ByteSource is a view on a substring of a larger source). 63 | // The caller is responsible for ensuring that it only reads the 64 | // Available() bytes. 65 | virtual const char* Peek(size_t* len) = 0; 66 | 67 | // Skip the next n bytes. Invalidates any buffer returned by 68 | // a previous call to Peek(). 69 | // REQUIRES: Available() >= n 70 | virtual void Skip(size_t n) = 0; 71 | 72 | private: 73 | // No copying 74 | Source(const Source&); 75 | void operator=(const Source&); 76 | }; 77 | 78 | // A Source implementation that yields the contents of a flat array 79 | class ByteArraySource : public Source { 80 | public: 81 | ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) { } 82 | virtual ~ByteArraySource(); 83 | virtual size_t Available() const; 84 | virtual const char* Peek(size_t* len); 85 | virtual void Skip(size_t n); 86 | private: 87 | const char* ptr_; 88 | size_t left_; 89 | }; 90 | 91 | // A Sink implementation that writes to a flat array without any bound checks. 92 | class UncheckedByteArraySink : public Sink { 93 | public: 94 | explicit UncheckedByteArraySink(char* dest) : dest_(dest) { } 95 | virtual ~UncheckedByteArraySink(); 96 | virtual void Append(const char* data, size_t n); 97 | virtual char* GetAppendBuffer(size_t len, char* scratch); 98 | 99 | // Return the current output pointer so that a caller can see how 100 | // many bytes were produced. 101 | // Note: this is not a Sink method. 102 | char* CurrentDestination() const { return dest_; } 103 | private: 104 | char* dest_; 105 | }; 106 | 107 | 108 | } 109 | 110 | #endif // UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ 111 | -------------------------------------------------------------------------------- /Switch/ext_snappy/snappy-stubs-internal.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include "snappy-stubs-internal.h" 19 | 20 | namespace snappy { 21 | 22 | void Varint::Append32(string* s, uint32 value) { 23 | char buf[Varint::kMax32]; 24 | const char* p = Varint::Encode32(buf, value); 25 | s->append(buf, p - buf); 26 | } 27 | 28 | } // namespace snappy 29 | -------------------------------------------------------------------------------- /Switch/ext_snappy/snappy-stubs-public.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All Rights Reserved. 2 | // Author: sesse@google.com (Steinar H. Gunderson) 3 | // 4 | // Various type stubs for the open-source version of Snappy. 5 | // 6 | // This file cannot include config.h, as it is included from snappy.h, 7 | // which is a public header. Instead, snappy-stubs-public.h is generated by 8 | // from snappy-stubs-public.h.in at configure time. 9 | 10 | #ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ 11 | #define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ 12 | 13 | #if 1 14 | #include 15 | #endif 16 | 17 | #if 1 18 | #include 19 | #endif 20 | 21 | #define SNAPPY_MAJOR 1 22 | #define SNAPPY_MINOR 0 23 | #define SNAPPY_PATCHLEVEL 0 24 | #define SNAPPY_VERSION \ 25 | ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) 26 | 27 | #ifdef SWITCH_EXT_SNAPPY_USE_STRING 28 | #include 29 | #endif 30 | 31 | namespace snappy { 32 | 33 | #if 1 34 | typedef int8_t int8; 35 | typedef uint8_t uint8; 36 | typedef int16_t int16; 37 | typedef uint16_t uint16; 38 | typedef int32_t int32; 39 | typedef uint32_t uint32; 40 | typedef int64_t int64; 41 | typedef uint64_t uint64; 42 | #else 43 | typedef signed char int8; 44 | typedef unsigned char uint8; 45 | typedef short int16; 46 | typedef unsigned short uint16; 47 | typedef int int32; 48 | typedef unsigned int uint32; 49 | typedef long long int64; 50 | typedef unsigned long long uint64; 51 | #endif 52 | 53 | #ifdef SWITCH_EXT_SNAPPY_USE_STRING 54 | typedef std::string string; 55 | #endif 56 | 57 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 58 | TypeName(const TypeName&); \ 59 | void operator=(const TypeName&) 60 | 61 | } // namespace snappy 62 | 63 | #endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ 64 | -------------------------------------------------------------------------------- /Switch/fs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "switch.h" 3 | #include 4 | 5 | class DirectoryEntries 6 | { 7 | private: 8 | DIR *const dh; 9 | 10 | public: 11 | struct iterator 12 | { 13 | DIR *const dh; 14 | struct dirent64 *de, storage; 15 | 16 | iterator(DIR *const h, struct dirent64 *const d) 17 | : dh(h), de(d) 18 | { 19 | } 20 | 21 | inline bool operator!=(const struct iterator &o) const 22 | { 23 | return de != o.de; 24 | } 25 | 26 | inline strwlen8_t operator*() const 27 | { 28 | return strwlen8_t(de->d_name, strlen(de->d_name)); 29 | } 30 | 31 | inline iterator &operator++() 32 | { 33 | if (unlikely(readdir64_r(dh, &storage, &de))) 34 | de = nullptr; 35 | return *this; 36 | } 37 | }; 38 | 39 | public: 40 | DirectoryEntries(const char *const path) 41 | : dh(opendir(path)) 42 | { 43 | if (unlikely(!dh)) 44 | throw Switch::exception("Failed to access directory ", path,":", strerror(errno)); 45 | } 46 | 47 | ~DirectoryEntries() 48 | { 49 | if (dh) 50 | closedir(dh); 51 | } 52 | 53 | struct iterator begin() const 54 | { 55 | return iterator(dh, dh ? readdir64(dh) : nullptr); 56 | } 57 | 58 | struct iterator end() const 59 | { 60 | return iterator(dh, nullptr); 61 | } 62 | 63 | operator bool() const 64 | { 65 | return dh; 66 | } 67 | }; 68 | -------------------------------------------------------------------------------- /Switch/portability.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #ifdef __linux__ 5 | #define SWITCH_HAVE_MALLOC_USABLE_SIZE 1 6 | #else 7 | #define off64_t off_t 8 | #define pread64 pread 9 | #define pwrite64 pwrite 10 | #define dirent64 dirent 11 | #define readdir64_r readdir_r 12 | #define readdir64 readdir 13 | #endif 14 | -------------------------------------------------------------------------------- /Switch/switch_algorithms.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace SwitchAlgorithms 5 | { 6 | static inline uint64_t Uniform(const uint64_t low, const uint64_t high) 7 | { 8 | return low + (rand()%(high - low)); 9 | } 10 | 11 | inline uint32_t ComputeExponentialBackoffWithDeccorelatedJitter(const uint64_t cap, const uint64_t base, const uint64_t prevSleep) 12 | { 13 | return std::min(cap, Uniform(base, prevSleep * 3)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Switch/switch_atomicops.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct MemoryModel 5 | { 6 | enum 7 | { 8 | // No barriers or synchronization. 9 | RELAXED = __ATOMIC_RELAXED, 10 | // Data dependency only for both barrier and synchronization with another thread. 11 | CONSUME = __ATOMIC_CONSUME, 12 | // Barrier to hoisting of code and synchronizes with release (or stronger) semantic stores from another thread. 13 | ACQUIRE = __ATOMIC_ACQUIRE, 14 | // Barrier to sinking of code and synchronizes with acquire (or stronger) semantic loads from another thread. 15 | RELEASE = __ATOMIC_RELEASE, 16 | // Full barrier in both directions and synchronizes with acquire loads and release stores in another thread. 17 | ACQ_REL = __ATOMIC_ACQ_REL, 18 | // Full barrier in both directions and synchronizes with acquire loads and release stores in all threads. 19 | SEQ_CST = __ATOMIC_SEQ_CST, 20 | 21 | // moved out of Barriers NS 22 | order_relaxed, 23 | order_acquire, 24 | order_release, 25 | order_acq_rel, 26 | order_seq_cst, 27 | 28 | // memory_order_sync: Forces a full sync: 29 | // #LoadLoad, #LoadStore, #StoreStore, and most significantly, #StoreLoad 30 | order_sync = order_seq_cst 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /Switch/switch_dictionary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Switch 5 | { 6 | template 7 | class unordered_map 8 | : public std::unordered_map 9 | { 10 | public: 11 | struct kv 12 | { 13 | T v; 14 | 15 | const T &value() const 16 | { 17 | return v; 18 | } 19 | }; 20 | 21 | public: 22 | bool Add(const Key &k, const T &v) 23 | { 24 | return this->insert({k, v}).second; 25 | } 26 | 27 | bool Remove(const Key &k) 28 | { 29 | return this->erase(k); 30 | } 31 | 32 | kv detach(const Key &k) 33 | { 34 | auto it = this->find(k); 35 | 36 | if (it != this->end()) 37 | { 38 | auto v = std::move(it->second); 39 | const auto n = this->size(); 40 | 41 | this->erase(it); 42 | require(n == this->size() + 1); 43 | return {v}; 44 | } 45 | else 46 | return {}; 47 | } 48 | }; 49 | } 50 | 51 | namespace std 52 | { 53 | template<> 54 | struct hash 55 | { 56 | using argument_type = void*; 57 | using result_type = std::size_t; 58 | 59 | std::size_t operator()(const void *const ptr) const 60 | { 61 | return std::hash{}(uintptr_t(ptr)); 62 | } 63 | }; 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /Switch/switch_exceptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "switch_print.h" 3 | 4 | namespace Switch 5 | { 6 | struct exception 7 | : public std::exception 8 | { 9 | Buffer b; 10 | 11 | [[gnu::noinline]] explicit exception(const strwithlen32_t &s) 12 | { 13 | b.Append(s.p, s.len); 14 | } 15 | 16 | template 17 | [[gnu::noinline]] exception(const T &... args) 18 | { 19 | PrintImpl(b, args...); 20 | } 21 | 22 | exception(const exception &o) 23 | : b(o.b) 24 | { 25 | } 26 | 27 | exception(exception &&o) 28 | : b(std::move(o.b)) 29 | { 30 | 31 | } 32 | 33 | exception() = delete; 34 | 35 | const char *what() const noexcept override 36 | { 37 | return b.data(); 38 | } 39 | }; 40 | 41 | struct recoverable_error 42 | : public std::exception 43 | { 44 | Buffer b; 45 | 46 | [[gnu::noinline]] explicit recoverable_error(const strwithlen32_t &s) 47 | { 48 | b.Append(s.p, s.len); 49 | } 50 | 51 | template 52 | [[gnu::noinline]] recoverable_error(const T &... args) 53 | { 54 | PrintImpl(b, args...); 55 | } 56 | 57 | recoverable_error(const recoverable_error &o) 58 | : b(o.b) 59 | { 60 | 61 | } 62 | 63 | recoverable_error(recoverable_error &&o) 64 | : b(std::move(o.b)) 65 | { 66 | 67 | } 68 | 69 | recoverable_error() = delete; 70 | 71 | const char *what() const noexcept override 72 | { 73 | return b.data(); 74 | } 75 | }; 76 | 77 | using runtime_error = recoverable_error; 78 | using range_error = recoverable_error; 79 | using overflow_error = recoverable_error; 80 | using underflow_error = recoverable_error; 81 | using system_error = recoverable_error; 82 | using invalid_argument = recoverable_error; 83 | using length_error = recoverable_error; 84 | using out_of_range = recoverable_error; 85 | using data_error = recoverable_error; 86 | } 87 | 88 | #define SLog(...) ::Print(srcline_repr(), __VA_ARGS__) 89 | -------------------------------------------------------------------------------- /Switch/switch_hash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef __clang__ 4 | extern "C" { 5 | #endif 6 | unsigned long long XXH64(const void *input, unsigned int len, unsigned long long seed); 7 | #ifndef __clang__ 8 | } 9 | #endif 10 | 11 | static inline uint64_t FNVHash64(const uint8_t *const p, const uint32_t len) 12 | { 13 | uint64_t h{14695981039346656037ULL}; 14 | 15 | for (uint32_t i = 0; i != len; ++i) 16 | h = (h * 1099511628211ULL) ^ p[i]; 17 | 18 | return h; 19 | } 20 | 21 | static inline constexpr uint64_t BeginFNVHash64(void) 22 | { 23 | return 14695981039346656037ULL; 24 | } 25 | 26 | static inline uint64_t FNVHash64(uint64_t h, const uint8_t *const p, const uint32_t len) 27 | { 28 | for (uint32_t i = 0; i != len; ++i) 29 | h = (h * 1099511628211ULL) ^ p[i]; 30 | return h; 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /Switch/switch_numops.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | template 5 | [[gnu::always_inline]] inline T Clamp(const T v, const T min, const T max) 6 | { 7 | static_assert(std::is_scalar::value, "Expected scalar"); 8 | return std::min(std::max(v, min), max); 9 | } 10 | 11 | inline static int RoundToMultiple(const int v, const int alignment) 12 | { 13 | const int mask = alignment - 1; 14 | 15 | return (v + mask) & ~mask; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Switch/switch_vector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Switch 5 | { 6 | template 7 | class vector 8 | : public std::vector 9 | { 10 | public: 11 | void RemoveByValue(const T v) 12 | { 13 | const auto e = this->end(); 14 | auto it = std::find(this->begin(), e, v); 15 | 16 | if (it != e) 17 | { 18 | const auto n = this->size(); 19 | 20 | this->erase(it); 21 | require(this->size() + 1 == n); 22 | } 23 | } 24 | 25 | T Pop() 26 | { 27 | auto last{this->back()}; 28 | 29 | this->pop_back(); 30 | return last; 31 | } 32 | 33 | auto values() noexcept 34 | { 35 | return this->data(); 36 | } 37 | 38 | void pop_front() 39 | { 40 | auto it = this->begin(); 41 | 42 | this->erase(it); 43 | } 44 | 45 | void Append(T *const list, const size_t n) 46 | { 47 | this->reserve(n); 48 | for (size_t i{0}; i != n; ++i) 49 | this->push_back(list[i]); 50 | } 51 | 52 | void PopByIndex(const size_t idx) 53 | { 54 | this->erase(this->begin() + idx); 55 | } 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /Switch/text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "switch.h" 3 | 4 | struct size_repr 5 | { 6 | const uint64_t v; 7 | 8 | size_repr(const uint64_t value) 9 | : v{value} 10 | { 11 | } 12 | 13 | strwlen8_t Get(char *const p) const 14 | { 15 | static const std::pair bases[] = 16 | { 17 | {1024ULL * 1024ULL * 1024ULL * 1024ULL, "tb"}, 18 | {1024UL * 1024UL * 1024UL, "gb"}, 19 | {1024 * 1024, "mb"}, 20 | {1024, "kb"}, 21 | }; 22 | 23 | for (const auto &it : bases) 24 | { 25 | const auto r = double(v) / it.first; 26 | 27 | if (r >= 1) 28 | { 29 | const auto repr = it.second; 30 | uint8_t len = sprintf(p, "%.2lf", r); 31 | 32 | while (len && p[len - 1] == '0') 33 | --len; 34 | if (len && p[len - 1] == '.') 35 | --len; 36 | 37 | p[len] = *repr; 38 | p[len + 1] = repr[1]; 39 | return strwlen8_t(p, len + 2); 40 | } 41 | } 42 | 43 | return strwlen8_t(p, sprintf(p, "%ub", uint32_t(v))); 44 | } 45 | }; 46 | 47 | static inline void PrintImpl(Buffer &out, const size_repr &s) 48 | { 49 | out.reserve(32); 50 | 51 | out.advance_size(s.Get(out.end()).len); 52 | } 53 | 54 | struct dotnotation_repr 55 | { 56 | const uint64_t value; 57 | const char sep; 58 | 59 | dotnotation_repr(const uint64_t v, const char separator = ',') 60 | : value{v}, sep{separator} 61 | { 62 | } 63 | 64 | strwlen8_t Get(char *const out) const 65 | { 66 | uint16_t t[8]; 67 | uint8_t n{0}; 68 | auto r = value; 69 | char *o; 70 | 71 | do 72 | { 73 | 74 | t[n++] = r % 1000; 75 | r /= 1000; 76 | } while (r); 77 | 78 | for (o = out + sprintf(out, "%u", t[--n]); n;) 79 | { 80 | *o++ = sep; 81 | o += sprintf(o, "%03u", t[--n]); 82 | } 83 | 84 | return {out, uint8_t(o - out)}; 85 | } 86 | }; 87 | 88 | namespace Text 89 | { 90 | uint8_t ToBase(uint64_t input, const uint32_t toBase, char *out); 91 | uint64_t FromBase(const char *const input, const uint32_t len, const uint8_t base); 92 | } 93 | 94 | static inline void PrintImpl(Buffer &out, const dotnotation_repr &r) 95 | { 96 | out.reserve(32); 97 | out.advance_size(r.Get(out.end()).len); 98 | } 99 | -------------------------------------------------------------------------------- /Switch/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Switch 5 | { 6 | using mutex = std::mutex; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /sss/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{c,h}] 2 | indent_style = tab 3 | indent_size = 8 4 | 5 | [Makefile] 6 | indent_style = tab 7 | indent_size = 8 8 | 9 | [*.yml] 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /sss/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Daan Sprenkels 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /sss/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -g -O2 -m64 -std=c99 -pedantic \ 2 | -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wformat -Wformat-security \ 3 | -Werror=format-security -Wstrict-prototypes -Wmissing-prototypes \ 4 | -D_FORTIFY_SOURCE=2 -fPIC -fno-strict-overflow 5 | SRCS = hazmat.c randombytes.c sss.c tweetnacl.c 6 | OBJS := ${SRCS:.c=.o} 7 | 8 | all: libsss.a 9 | 10 | libsss.a: randombytes/librandombytes.a $(OBJS) 11 | $(AR) -rcs libsss.a $^ 12 | 13 | randombytes/librandombytes.a: 14 | $(MAKE) -C randombytes librandombytes.a 15 | 16 | # Force unrolling loops on hazmat.c 17 | hazmat.o: CFLAGS += -funroll-loops 18 | 19 | %.out: %.o randombytes/librandombytes.a 20 | $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) 21 | $(MEMCHECK) ./$@ 22 | 23 | test_hazmat.out: $(OBJS) 24 | test_sss.out: $(OBJS) 25 | 26 | .PHONY: check 27 | check: test_hazmat.out test_sss.out 28 | 29 | .PHONY: clean 30 | clean: 31 | $(MAKE) -C randombytes $@ 32 | $(RM) *.o *.gch *.a *.out 33 | -------------------------------------------------------------------------------- /sss/hazmat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Low level API for Daan Sprenkels' Shamir secret sharing library 3 | * Copyright (c) 2017 Daan Sprenkels 4 | * 5 | * Usage of this API is hazardous and is only reserved for beings with a 6 | * good understanding of the Shamir secret sharing scheme and who know how 7 | * crypto code is implemented. If you are unsure about this, use the 8 | * intermediate level API. You have been warned! 9 | */ 10 | 11 | 12 | #ifndef sss_HAZMAT_H_ 13 | #define sss_HAZMAT_H_ 14 | 15 | #include 16 | 17 | 18 | #define sss_KEYSHARE_LEN 33 /* 1 + 32 */ 19 | 20 | 21 | /* 22 | * One share of a cryptographic key which is shared using Shamir's 23 | * the `sss_create_keyshares` function. 24 | */ 25 | typedef uint8_t sss_Keyshare[sss_KEYSHARE_LEN]; 26 | 27 | 28 | /* 29 | * Share the secret given in `key` into `n` shares with a treshold value given 30 | * in `k`. The resulting shares are written to `out`. 31 | * 32 | * The share generation that is done in this function is only secure if the key 33 | * that is given is indeed a cryptographic key. This means that it should be 34 | * randomly and uniformly generated string of 32 bytes. 35 | * 36 | * Also, for performance reasons, this function assumes that both `n` and `k` 37 | * are *public* values. 38 | * 39 | * If you are looking for a function that *just* creates shares of arbitrary 40 | * data, you should use the `sss_create_shares` function in `sss.h`. 41 | */ 42 | void sss_create_keyshares(sss_Keyshare *out, 43 | const uint8_t key[32], 44 | uint8_t n, 45 | uint8_t k); 46 | 47 | 48 | /* 49 | * Combine the `k` shares provided in `shares` and write the resulting key to 50 | * `key`. The amount of shares used to restore a secret may be larger than the 51 | * threshold needed to restore them. 52 | * 53 | * This function does *not* do *any* checking for integrity. If any of the 54 | * shares not original, this will result in an invalid resored value. 55 | * All values written to `key` should be treated as secret. Even if some of the 56 | * shares that were provided as input were incorrect, the resulting key *still* 57 | * allows an attacker to gain information about the real key. 58 | * 59 | * This function treats `shares` and `key` as secret values. `k` is treated as 60 | * a public value (for performance reasons). 61 | * 62 | * If you are looking for a function that combines shares of arbitrary 63 | * data, you should use the `sss_combine_shares` function in `sss.h`. 64 | */ 65 | void sss_combine_keyshares(uint8_t key[32], 66 | const sss_Keyshare *shares, 67 | uint8_t k); 68 | 69 | 70 | #endif /* sss_HAZMAT_H_ */ 71 | -------------------------------------------------------------------------------- /sss/randombytes.c: -------------------------------------------------------------------------------- 1 | randombytes/randombytes.c -------------------------------------------------------------------------------- /sss/randombytes.h: -------------------------------------------------------------------------------- 1 | randombytes/randombytes.h -------------------------------------------------------------------------------- /sss/randombytes/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{c,h}] 2 | indent_style = tab 3 | indent_size = 8 4 | 5 | [Makefile] 6 | indent_style = tab 7 | indent_size = 8 8 | -------------------------------------------------------------------------------- /sss/randombytes/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | script: make 3 | os: 4 | - linux 5 | - osx 6 | compiler: 7 | - clang 8 | - gcc 9 | script: 10 | - make && make check 11 | -------------------------------------------------------------------------------- /sss/randombytes/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Daan Sprenkels 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /sss/randombytes/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -g -O2 -m64 -std=c99 -pedantic \ 2 | -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wformat -Wformat-security \ 3 | -Werror=format-security -Wstrict-prototypes -Wmissing-prototypes \ 4 | -D_FORTIFY_SOURCE=2 -fPIC -fno-strict-overflow 5 | 6 | all: librandombytes.a 7 | 8 | librandombytes.a: randombytes.o 9 | $(AR) -rcs librandombytes.a randombytes.o 10 | 11 | test: randombytes.o 12 | 13 | .PHONY: check 14 | check: test 15 | ./test 16 | 17 | .PHONY: clean 18 | clean: 19 | $(RM) librandombytes.a randombytes.o test test.o 20 | -------------------------------------------------------------------------------- /sss/randombytes/README.md: -------------------------------------------------------------------------------- 1 | # Pluggable randombytes function 2 | 3 | [![Travis-CI](https://travis-ci.org/dsprenkels/sss.svg?branch=master)](https://travis-ci.org/dsprenkels/randombytes) 4 | [![Appveyor](https://ci.appveyor.com/api/projects/status/github/dsprenkels/randombytes?branch=master&svg=true)](https://ci.appveyor.com/project/dsprenkels/randombytes) 5 | 6 | `randombytes` is a library that exposes a single function for retrieving 7 | _crypto-secure_ random bytes. It is loosely based on [Libsodium's random bytes 8 | API][libsodium_randombytes]. If you can, you should use that one. Otherwise, you 9 | can use this library. 10 | 11 | ## Usage 12 | 13 | `randombytes` takes two arguments: 14 | 1. A pointer to the buffer 15 | 2. The length of the buffer in bytes 16 | 17 | The function will always return an `int` which will be `0` on success. The 18 | caller _must_ check this. If some kind of error occured, `errno` MAY contain a 19 | hint to what the error was, and a subsequent call to the `randombytes` function 20 | MAY succeed. An example of when the function may fail is when `/dev/urandom` 21 | could not be opened, because there were no file descriptors left to use for the 22 | process. 23 | 24 | On sensible systems (like the ones with `arc4random`) the latency is very low. 25 | However, this is totally not guaranteed. Do not expect this function to be very 26 | fast. Benchmark for your specific setup, and use a fast CSPRNG if you need. 27 | 28 | Example code: 29 | 30 | ```c 31 | #include "randombytes.h" 32 | #include 33 | #include 34 | 35 | int main() 36 | { 37 | // Generate some random bytes and print them in hex 38 | int ret; 39 | uint8_t buf[20]; 40 | size_t i; 41 | 42 | ret = randombytes(&buf[0], sizeof(buf)); 43 | if (ret != 0) { 44 | printf("Error in `randombytes`"); 45 | return 1; 46 | } 47 | for (i = 0; i < sizeof(buf); ++i) { 48 | printf("%02hhx", buf[i]); 49 | } 50 | printf("\n"); 51 | return 0; 52 | } 53 | ``` 54 | 55 | ## How secure is it really? 56 | 57 | While building this I keep one rule of thumb which is: **Trust the OS**. 58 | Most OS'es implement a secure random generator, which is seeded by a good 59 | entropy source. We will always use this random source. This essentially means 60 | that the implementation is highly platform-dependent. For example we use 61 | `getrandom` on Linux and `arc4random` on BSD systems. 62 | 63 | ### What if the OS's random generator is bad? 64 | 65 | If you are dealing with an OS that has a compromised random generator you are 66 | out of luck. The reason why you cannot generate high quality random data from 67 | userspace is that userspace is made so that everything is too deterministic. 68 | A secure random generator needs a good source of entropy, such as 2.4 GHz noise 69 | or the user's mouse movements. Collecting these kinds of events only works well 70 | when working on the lowest level. 71 | 72 | ## Questions 73 | 74 | ### It does not compile on my platform! 75 | 76 | [Please open an issue.](https://github.com/dsprenkels/randombytes/issues/new) 77 | If possible I will try to make a `randombytes` implementation for your platform. 78 | 79 | ### Other 80 | 81 | Feel free to send me an email on my Github associated e-mail address. 82 | 83 | 84 | [libsodium_randombytes]: https://github.com/jedisct1/libsodium/blob/master/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c 85 | -------------------------------------------------------------------------------- /sss/randombytes/appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2015 2 | build_script: 3 | - cmd: clang -c randombytes.c 4 | -------------------------------------------------------------------------------- /sss/randombytes/randombytes.h: -------------------------------------------------------------------------------- 1 | #ifndef sss_RANDOMBYTES_H 2 | #define sss_RANDOMBYTES_H 3 | 4 | #ifdef _WIN32 5 | /* Load size_t on windows */ 6 | #include 7 | #else 8 | #include 9 | #include 10 | #endif /* _WIN32 */ 11 | 12 | 13 | /* 14 | * Write `n` bytes of high quality random bytes to `buf` 15 | */ 16 | int randombytes(void *buf, size_t n); 17 | 18 | 19 | #endif /* sss_RANDOMBYTES_H */ 20 | -------------------------------------------------------------------------------- /sss/randombytes/test.c: -------------------------------------------------------------------------------- 1 | #include "randombytes.h" 2 | #include 3 | #include 4 | #include 5 | 6 | int main(void) 7 | { 8 | // Generate some random bytes and print them in hex 9 | int ret; 10 | uint8_t buf[20]; 11 | size_t i; 12 | 13 | ret = randombytes(buf, sizeof(buf)); 14 | if (ret != 0) { 15 | printf("Error in `randombytes`: %d\n", errno); 16 | return 1; 17 | } 18 | for (i = 0; i < sizeof(buf); ++i) { 19 | printf("%02hhx", buf[i]); 20 | } 21 | printf("\n"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /sss/sss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Intermediate level API for Daan Sprenkels' Shamir secret sharing library 3 | * Copyright (c) 2017 Daan Sprenkels 4 | */ 5 | 6 | 7 | #ifndef sss_SSS_H_ 8 | #define sss_SSS_H_ 9 | 10 | #include "hazmat.h" 11 | #include "tweetnacl.h" 12 | #include 13 | 14 | 15 | #ifndef sss_MLEN 16 | /* 17 | Length of the message (must be known at compile-time) 18 | */ 19 | #define sss_MLEN sizeof(uint8_t[64]) 20 | #endif 21 | 22 | 23 | /* 24 | * Length of the ciphertext, including the message authentication code 25 | */ 26 | #define sss_CLEN (sss_MLEN + 16) 27 | 28 | 29 | /* 30 | * Length of a SSS share 31 | */ 32 | #define sss_SHARE_LEN (sss_CLEN + sss_KEYSHARE_LEN) 33 | 34 | 35 | /* 36 | * One share of a secret which is shared using Shamir's 37 | * the `sss_create_shares` function. 38 | */ 39 | typedef uint8_t sss_Share[sss_SHARE_LEN]; 40 | 41 | 42 | /* 43 | * Create `n` shares of the secret data `data`. Share such that `k` or more 44 | * shares will be able to restore the secret. 45 | * 46 | * This function will put the resulting shares in the array pointed to by 47 | * `out`. The caller has to guarantee that this array will fit at least `n` 48 | * instances of `sss_Share`. 49 | */ 50 | #if defined(__cplusplus) 51 | extern "C" 52 | #endif 53 | void sss_create_shares(sss_Share *out, 54 | const uint8_t *data, 55 | uint8_t n, 56 | uint8_t k); 57 | 58 | 59 | /* 60 | * Combine the `k` shares pointed to by `shares` and put the resulting secret 61 | * data in `data`. The caller has to ensure that the `data` array will fit 62 | * at least `sss_MLEN` (default: 64) bytes. 63 | * 64 | * On success, this function will return 0. If combining the secret fails, 65 | * this function will return a nonzero return code. On failure, the value 66 | * in `data` may have been altered, but must still be considered secret. 67 | */ 68 | #if defined(__cplusplus) 69 | extern "C" 70 | #endif 71 | int sss_combine_shares(uint8_t *data, 72 | const sss_Share *shares, 73 | uint8_t k); 74 | 75 | 76 | #endif /* sss_SSS_H_ */ 77 | -------------------------------------------------------------------------------- /sss/test_hazmat.c: -------------------------------------------------------------------------------- 1 | #include "hazmat.h" 2 | #include 3 | #include 4 | 5 | 6 | static void test_key_shares(void) 7 | { 8 | uint8_t key[32], restored[32]; 9 | sss_Keyshare key_shares[256]; 10 | size_t idx; 11 | 12 | for (idx = 0; idx < 32; idx++) { 13 | key[idx] = idx; 14 | } 15 | 16 | sss_create_keyshares(key_shares, key, 1, 1); 17 | sss_combine_keyshares(restored, (const sss_Keyshare*) key_shares, 1); 18 | assert(memcmp(key, restored, 32) == 0); 19 | 20 | sss_create_keyshares(key_shares, key, 3, 2); 21 | sss_combine_keyshares(restored, (const sss_Keyshare*) key_shares[1], 2); 22 | assert(memcmp(key, restored, 32) == 0); 23 | 24 | sss_create_keyshares(key_shares, key, 255, 127); 25 | sss_combine_keyshares(restored, (const sss_Keyshare*) key_shares[128], 127); 26 | assert(memcmp(key, restored, 32) == 0); 27 | 28 | sss_create_keyshares(key_shares, key, 255, 255); 29 | sss_combine_keyshares(restored, (const sss_Keyshare*) key_shares, 255); 30 | assert(memcmp(key, restored, 32) == 0); 31 | } 32 | 33 | 34 | int main(void) 35 | { 36 | test_key_shares(); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /sss/test_sss.c: -------------------------------------------------------------------------------- 1 | #include "sss.h" 2 | #include 3 | #include 4 | 5 | int main(void) 6 | { 7 | unsigned char data[sss_MLEN] = { 42 }, restored[sss_MLEN]; 8 | sss_Share shares[256]; 9 | int tmp; 10 | 11 | /* Normal operation */ 12 | sss_create_shares(shares, data, 1, 1); 13 | tmp = sss_combine_shares(restored, (const sss_Share*) shares, 1); 14 | assert(tmp == 0); 15 | assert(memcmp(restored, data, sss_MLEN) == 0); 16 | 17 | /* A lot of shares */ 18 | sss_create_shares(shares, data, 255, 255); 19 | tmp = sss_combine_shares(restored, (const sss_Share*) shares, 255); 20 | assert(tmp == 0); 21 | assert(memcmp(restored, data, sss_MLEN) == 0); 22 | 23 | /* Not enough shares to restore secret */ 24 | sss_create_shares(shares, data, 100, 100); 25 | tmp = sss_combine_shares(restored, (const sss_Share*) shares, 99); 26 | assert(tmp == -1); 27 | 28 | /* Too many secrets should also restore the secret */ 29 | sss_create_shares(shares, data, 200, 100); 30 | tmp = sss_combine_shares(restored, (const sss_Share*) shares, 200); 31 | assert(tmp == 0); 32 | assert(memcmp(restored, data, sss_MLEN) == 0); 33 | 34 | return 0; 35 | } 36 | --------------------------------------------------------------------------------