Skip to content

Commit

Permalink
Try alternative xxhash implementation
Browse files Browse the repository at this point in the history
Hopefully it can compile on non-x86 arch
  • Loading branch information
nsmith- committed Sep 13, 2022
1 parent ba9bc1b commit 8c6de4e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
url = https://github.com/imneme/pcg-cpp.git
[submodule "xxhash"]
path = xxhash
url = https://github.com/RedSpah/xxhash_cpp.git
url = https://github.com/Cyan4973/xxHash.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_include_directories(correctionlib
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cpp-peglib>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/xxhash/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/xxhash>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pcg-cpp/include>
)
target_compile_features(correctionlib PUBLIC cxx_std_17)
Expand Down
5 changes: 3 additions & 2 deletions src/correction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include <cmath>
#include <random>
#include "correction.h"
#include "xxhash.hpp"
#define XXH_INLINE_ALL 1
#include "xxhash.h"
#include "pcg_random.hpp"
#if __has_include(<zlib.h>)
#include <zlib.h>
Expand Down Expand Up @@ -288,7 +289,7 @@ double HashPRNG::evaluate(const std::vector<Variable::Type>& values) const {
}
else { throw std::logic_error("I should not have ever seen a string"); }
}
gen.seed(xxh::xxhash<64>((const void*) seedData, nbytes));
gen.seed(XXH64((const void*) seedData, nbytes, 0ul));
switch (dist_) {
case Distribution::stdflat:
return std::uniform_real_distribution<>()(gen);
Expand Down
2 changes: 1 addition & 1 deletion xxhash
Submodule xxhash updated 81 files
+7 −60 .gitattributes
+0 −38 .github/ISSUE_TEMPLATE/bug_report.md
+439 −0 .github/workflows/ci.yml
+46 −278 .gitignore
+142 −38 .travis.yml
+71 −0 CHANGELOG
+0 −60 CMakeLists.txt
+0 −76 CODE_OF_CONDUCT.md
+58 −0 Doxyfile
+19 −19 LICENSE
+546 −0 Makefile
+205 −90 README.md
+115 −0 appveyor.yml
+339 −0 cli/COPYING
+4 −0 cli/README.md
+153 −0 cli/xsum_arch.h
+436 −0 cli/xsum_bench.c
+51 −0 cli/xsum_bench.h
+214 −0 cli/xsum_config.h
+482 −0 cli/xsum_os_specific.c
+89 −0 cli/xsum_os_specific.h
+65 −0 cli/xsum_output.c
+62 −0 cli/xsum_output.h
+692 −0 cli/xsum_sanity_check.c
+60 −0 cli/xsum_sanity_check.h
+106 −0 cli/xxhsum.1
+148 −0 cli/xxhsum.1.md
+1,138 −0 cli/xxhsum.c
+12 −0 cmake_unofficial/.gitignore
+173 −0 cmake_unofficial/CMakeLists.txt
+36 −0 cmake_unofficial/README.md
+4 −0 cmake_unofficial/xxHashConfig.cmake.in
+9 −0 doc/README.md
+206 −0 doc/xxhash.cry
+351 −0 doc/xxhash_spec.md
+0 −2,082 include/xxhash.hpp
+15 −0 libxxhash.pc.in
+0 −24 test/CMakeLists.txt
+0 −14,075 test/catch.hpp
+0 −627 test/test_main.cpp
+0 −2,115 test/xxh3.h
+0 −1,941 test/xxhash.h
+112 −0 tests/Makefile
+1 −0 tests/bench/.clang_complete
+11 −0 tests/bench/.gitignore
+339 −0 tests/bench/LICENSE
+68 −0 tests/bench/Makefile
+164 −0 tests/bench/benchHash.c
+67 −0 tests/bench/benchHash.h
+252 −0 tests/bench/benchfn.c
+183 −0 tests/bench/benchfn.h
+160 −0 tests/bench/bhDisplay.c
+61 −0 tests/bench/bhDisplay.h
+118 −0 tests/bench/hashes.h
+220 −0 tests/bench/main.c
+168 −0 tests/bench/timefn.c
+89 −0 tests/bench/timefn.h
+2 −0 tests/collisions/.gitignore
+339 −0 tests/collisions/LICENSE
+75 −0 tests/collisions/Makefile
+122 −0 tests/collisions/README.md
+1 −0 tests/collisions/allcodecs/README.md
+38 −0 tests/collisions/allcodecs/dummy.c
+45 −0 tests/collisions/allcodecs/dummy.h
+127 −0 tests/collisions/hashes.h
+1,124 −0 tests/collisions/main.c
+344 −0 tests/collisions/pool.c
+80 −0 tests/collisions/pool.h
+59 −0 tests/collisions/sort.cc
+40 −0 tests/collisions/sort.hh
+82 −0 tests/collisions/threading.c
+124 −0 tests/collisions/threading.h
+154 −0 tests/generate_unicode_test.c
+78 −0 tests/multiInclude.c
+62 −0 tests/ppc_define.c
+43 −0 tests/unicode_lint.sh
+55 −0 xxh3.h
+770 −0 xxh_x86dispatch.c
+86 −0 xxh_x86dispatch.h
+43 −0 xxhash.c
+5,580 −0 xxhash.h

0 comments on commit 8c6de4e

Please sign in to comment.