Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTOR
include_directories(${CMAKE_SOURCE_DIR}/include)
# including gtl as a system dependency prevents warnings when compiling it
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/gtl/include)
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/robin_hood)
find_package(absl REQUIRED)

add_executable(lerw src/main.cpp)

Expand Down Expand Up @@ -54,6 +56,7 @@ target_compile_options(lerw PUBLIC -fcompare-debug-second)

target_link_libraries(lerw PRIVATE
tbb
absl::flat_hash_set
boost_program_options)

# testing
Expand All @@ -66,6 +69,7 @@ add_executable(tests
tests/points.cpp
tests/distributions.cpp
tests/directions.cpp
tests/benchmarks.cpp
)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ install_manual: build_manual interface.py

# manually build for tests, because nix-build does full recompilation
test: build_manual interface.py
cd $(BUILD_DIR) && ctest --output-on-failure
cd $(BUILD_DIR) && ./tests ~[benchmark]
python interface.py

bench: build_manual
cd $(BUILD_DIR) && ./tests [benchmark]

clean:
rm -rf $(BUILD_DIR)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ make build_manual && cp build_manual/compile_commands.json .
- Investigate if there can be some compile-time evaluation of LINF and L1 steps for small r
- Visualize walk
- convert the package to a nix flake (also figure out what that would actually do)

Doing: robin_hood has same performance, abseil does not compile
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gcc14Stdenv.mkDerivation {
doCheck = true;

buildInputs = [
abseil-cpp
tbb
boost
catch2_3
Expand Down
7 changes: 6 additions & 1 deletion include/hash_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

#include <concepts>
#include <gtl/phmap.hpp>
#include <robin_hood.h>
#include "absl/container/flat_hash_set.h"

namespace lerw {

template <class T> using hash_set = gtl::flat_hash_set<T>;
// template <class T> using hash_set = gtl::flat_hash_set<T>;
template <class T> using hash_set = absl::flat_hash_set<T>;
// template <class T> using hash_set = robin_hood::unordered_set<T>;


template <class T>
concept hashable = std::equality_comparable<T> && requires(T t) {
Expand Down
Loading
Loading