From 847254ca1e8877b51ab33c1d3ad2fae3ea790755 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 21 Nov 2024 12:33:57 +0100 Subject: [PATCH] Move include files to not clutter global include namespace --- benchmark/bijections.cpp | 2 +- benchmark/bijections/ShockHash1.h | 2 +- benchmark/bijections/ShockHash1Rotate.h | 2 +- benchmark/golombMemoTuner.cpp | 2 +- benchmark/numHashEvals.cpp | 8 ++++---- include/SIMDShockHash.hpp | 4 ++-- include/ShockHash.h | 6 +++--- include/ShockHash2.h | 6 +++--- include/ShockHash2Flat.h | 6 +++--- include/{ => shockhash}/CuckooUnionFind.h | 0 include/{ => shockhash}/PairingFunction.h | 0 include/{ => shockhash}/RiceBitVector.h | 0 include/{ => shockhash}/ShockHash2-internal.h | 4 ++-- include/{ => shockhash}/ShockHash2-precompiled.h | 0 include/{ => shockhash}/ShockHash2FlatBase.h | 0 include/{ => shockhash}/SimdUtils.h | 0 include/{ => shockhash}/Sorter.hpp | 0 include/{ => shockhash}/TinyBinaryCuckooHashTable.h | 0 include/{ => shockhash}/UnionFind.h | 0 src/ShockHash2-precompiled.cpp | 4 ++-- src/Sorter.cpp | 4 ++-- 21 files changed, 25 insertions(+), 25 deletions(-) rename include/{ => shockhash}/CuckooUnionFind.h (100%) rename include/{ => shockhash}/PairingFunction.h (100%) rename include/{ => shockhash}/RiceBitVector.h (100%) rename include/{ => shockhash}/ShockHash2-internal.h (99%) rename include/{ => shockhash}/ShockHash2-precompiled.h (100%) rename include/{ => shockhash}/ShockHash2FlatBase.h (100%) rename include/{ => shockhash}/SimdUtils.h (100%) rename include/{ => shockhash}/Sorter.hpp (100%) rename include/{ => shockhash}/TinyBinaryCuckooHashTable.h (100%) rename include/{ => shockhash}/UnionFind.h (100%) diff --git a/benchmark/bijections.cpp b/benchmark/bijections.cpp index 5bd2ed3..989dfc9 100644 --- a/benchmark/bijections.cpp +++ b/benchmark/bijections.cpp @@ -7,7 +7,7 @@ #include "bijections/RecSplitRotate.h" #include "bijections/ShockHash1.h" #include "bijections/ShockHash1Rotate.h" -#include "ShockHash2-internal.h" +#include "shockhash/ShockHash2-internal.h" template void testSingle(size_t iterations) { diff --git a/benchmark/bijections/ShockHash1.h b/benchmark/bijections/ShockHash1.h index 70845ed..cda19c1 100644 --- a/benchmark/bijections/ShockHash1.h +++ b/benchmark/bijections/ShockHash1.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include "shockhash/TinyBinaryCuckooHashTable.h" /** * ShockHash base case diff --git a/benchmark/bijections/ShockHash1Rotate.h b/benchmark/bijections/ShockHash1Rotate.h index 8291d8f..fd203ed 100644 --- a/benchmark/bijections/ShockHash1Rotate.h +++ b/benchmark/bijections/ShockHash1Rotate.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include "shockhash/TinyBinaryCuckooHashTable.h" /** * ShockHash base case diff --git a/benchmark/golombMemoTuner.cpp b/benchmark/golombMemoTuner.cpp index c126a24..35f090e 100644 --- a/benchmark/golombMemoTuner.cpp +++ b/benchmark/golombMemoTuner.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "ShockHash2-internal.h" +#include "shockhash/ShockHash2-internal.h" template class T, size_t leafSize> void dispatchLeafSize() { diff --git a/benchmark/numHashEvals.cpp b/benchmark/numHashEvals.cpp index 57ca7bf..f874cd0 100644 --- a/benchmark/numHashEvals.cpp +++ b/benchmark/numHashEvals.cpp @@ -1,14 +1,14 @@ #include #include #include -#include "../include/TinyBinaryCuckooHashTable.h" -#include "../include/UnionFind.h" +#include "shockhash/TinyBinaryCuckooHashTable.h" +#include "shockhash/UnionFind.h" #include #include #include #include -#include -#include +#include "shockhash/ShockHash2-precompiled.h" +#include "shockhash/PairingFunction.h" static constexpr uint64_t rotate(size_t l, uint64_t val, uint32_t x) { return ((val << x) | (val >> (l - x))) & ((1ul << l) - 1); diff --git a/include/SIMDShockHash.hpp b/include/SIMDShockHash.hpp index f5a1446..c53c722 100644 --- a/include/SIMDShockHash.hpp +++ b/include/SIMDShockHash.hpp @@ -5,11 +5,9 @@ * For tiny space usages (~1.6 bit/object), ShockHash is faster than RecSplit. */ -#include #include #include #include -#include "SimdUtils.h" #include #include #include @@ -19,6 +17,8 @@ #include #include #include +#include "ShockHash.h" +#include "shockhash/SimdUtils.h" #ifndef SIMD #error Need to compile SIMDShockHash with -DSIMD diff --git a/include/ShockHash.h b/include/ShockHash.h index 0160216..af421b1 100644 --- a/include/ShockHash.h +++ b/include/ShockHash.h @@ -19,9 +19,9 @@ #include #include #include -#include -#include "TinyBinaryCuckooHashTable.h" -#include "RiceBitVector.h" +#include "shockhash/Sorter.hpp" +#include "shockhash/TinyBinaryCuckooHashTable.h" +#include "shockhash/RiceBitVector.h" namespace shockhash { using namespace sux; diff --git a/include/ShockHash2.h b/include/ShockHash2.h index 4483333..d7c9843 100644 --- a/include/ShockHash2.h +++ b/include/ShockHash2.h @@ -20,10 +20,10 @@ #include #include #include -#include +#include "shockhash/Sorter.hpp" #include "ShockHash.h" -#include "ShockHash2-precompiled.h" -#include "RiceBitVector.h" +#include "shockhash/ShockHash2-precompiled.h" +#include "shockhash/RiceBitVector.h" namespace shockhash { static const int MAX_LEAF_SIZE2 = 128; diff --git a/include/ShockHash2Flat.h b/include/ShockHash2Flat.h index 5870c0b..eba33b9 100644 --- a/include/ShockHash2Flat.h +++ b/include/ShockHash2Flat.h @@ -6,10 +6,10 @@ #include #include #include -#include -#include #include -#include "ShockHash2FlatBase.h" +#include "ShockHash2.h" +#include "shockhash/ShockHash2-internal.h" +#include "shockhash/ShockHash2FlatBase.h" namespace shockhash { diff --git a/include/CuckooUnionFind.h b/include/shockhash/CuckooUnionFind.h similarity index 100% rename from include/CuckooUnionFind.h rename to include/shockhash/CuckooUnionFind.h diff --git a/include/PairingFunction.h b/include/shockhash/PairingFunction.h similarity index 100% rename from include/PairingFunction.h rename to include/shockhash/PairingFunction.h diff --git a/include/RiceBitVector.h b/include/shockhash/RiceBitVector.h similarity index 100% rename from include/RiceBitVector.h rename to include/shockhash/RiceBitVector.h diff --git a/include/ShockHash2-internal.h b/include/shockhash/ShockHash2-internal.h similarity index 99% rename from include/ShockHash2-internal.h rename to include/shockhash/ShockHash2-internal.h index e72761e..3f4d744 100644 --- a/include/ShockHash2-internal.h +++ b/include/shockhash/ShockHash2-internal.h @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include "TinyBinaryCuckooHashTable.h" +#include "UnionFind.h" #include #include "PairingFunction.h" #include "CuckooUnionFind.h" diff --git a/include/ShockHash2-precompiled.h b/include/shockhash/ShockHash2-precompiled.h similarity index 100% rename from include/ShockHash2-precompiled.h rename to include/shockhash/ShockHash2-precompiled.h diff --git a/include/ShockHash2FlatBase.h b/include/shockhash/ShockHash2FlatBase.h similarity index 100% rename from include/ShockHash2FlatBase.h rename to include/shockhash/ShockHash2FlatBase.h diff --git a/include/SimdUtils.h b/include/shockhash/SimdUtils.h similarity index 100% rename from include/SimdUtils.h rename to include/shockhash/SimdUtils.h diff --git a/include/Sorter.hpp b/include/shockhash/Sorter.hpp similarity index 100% rename from include/Sorter.hpp rename to include/shockhash/Sorter.hpp diff --git a/include/TinyBinaryCuckooHashTable.h b/include/shockhash/TinyBinaryCuckooHashTable.h similarity index 100% rename from include/TinyBinaryCuckooHashTable.h rename to include/shockhash/TinyBinaryCuckooHashTable.h diff --git a/include/UnionFind.h b/include/shockhash/UnionFind.h similarity index 100% rename from include/UnionFind.h rename to include/shockhash/UnionFind.h diff --git a/src/ShockHash2-precompiled.cpp b/src/ShockHash2-precompiled.cpp index 5b3744f..b361c07 100644 --- a/src/ShockHash2-precompiled.cpp +++ b/src/ShockHash2-precompiled.cpp @@ -1,5 +1,5 @@ -#include "ShockHash2-precompiled.h" -#include "ShockHash2-internal.h" +#include "shockhash/ShockHash2-precompiled.h" +#include "shockhash/ShockHash2-internal.h" namespace shockhash { diff --git a/src/Sorter.cpp b/src/Sorter.cpp index 5c5a5d5..587cf2b 100644 --- a/src/Sorter.cpp +++ b/src/Sorter.cpp @@ -1,7 +1,7 @@ -#include #include #include -#include "ShockHash2FlatBase.h" +#include "shockhash/Sorter.hpp" +#include "shockhash/ShockHash2FlatBase.h" void shockhash::sort_hash128_t(sux::function::hash128_t *objects, size_t n, size_t threads) { ips2ra::parallel::sort(objects, objects + n, [&](const sux::function::hash128_t &a) { return a.first; }, threads);