Skip to content

Commit

Permalink
Rescuture code
Browse files Browse the repository at this point in the history
  • Loading branch information
maawad committed Jan 25, 2024
1 parent 1f57180 commit 45d4a7f
Show file tree
Hide file tree
Showing 12 changed files with 592 additions and 566 deletions.
371 changes: 189 additions & 182 deletions benchmarks/probes_per_technique.cu

Large diffs are not rendered by default.

371 changes: 189 additions & 182 deletions benchmarks/rates_per_technique.cu

Large diffs are not rendered by default.

345 changes: 176 additions & 169 deletions benchmarks/rates_per_technique_fixed_lf.cu

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/cpm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CPMAddPackage(
OPTIONS
"build_tests OFF"
"build_benchmarks OFF"
"build_examples OFF"
)

set(CUDA_ARCHS 70)
Expand Down
30 changes: 15 additions & 15 deletions examples/custom_types_example.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#include <bght/p2bht.hpp>

template <class K, class V>
using iht16_80 = iht16<K, V, 12>;
using iht16_80 = bght::iht16<K, V, 12>;

template <class K, class V>
using iht32_80 = iht32<K, V, 25>;
using iht32_80 = bght::iht32<K, V, 25>;

template <typename T1, typename T2>
void CHECK(T1 t1, T2 t2) {
Expand Down Expand Up @@ -441,22 +441,22 @@ int main() {
test_custom_type();
std::cout << "Testing vec3-like type\n";
test_vec3_like();
std::cout << "Testing bcht8\n";
test_scheme<bcht8>();
std::cout << "Testing bcht16\n";
test_scheme<bcht16>();
std::cout << "Testing bcht32\n";
test_scheme<bcht32>();

std::cout << "Testing iht16_80\n";
std::cout << "Testing bght::bcht8\n";
test_scheme<bght::bcht8>();
std::cout << "Testing bght::bcht16\n";
test_scheme<bght::bcht16>();
std::cout << "Testing bght::bcht32\n";
test_scheme<bght::bcht32>();

std::cout << "Testing bght::iht16_80\n";
test_scheme<iht16_80>();
std::cout << "Testing iht32_80\n";
std::cout << "Testing bght::iht32_80\n";
test_scheme<iht32_80>();

std::cout << "Testing p2bht16\n";
test_scheme<p2bht16>();
std::cout << "Testing p2bht32\n";
test_scheme<p2bht32>();
std::cout << "Testing bght::p2bht16\n";
test_scheme<bght::p2bht16>();
std::cout << "Testing bght::p2bht32\n";
test_scheme<bght::p2bht32>();

std::cout << "Success\n";

Expand Down
12 changes: 6 additions & 6 deletions examples/iht_example.cu
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ int main(int argc, char** argv) {

if (threshold == 0) {
if (bucket_size == 8) {
do_test<iht8, 0>(argc, argv);
do_test<bght::iht8, 0>(argc, argv);
} else if (bucket_size == 16) {
do_test<iht16, 0>(argc, argv);
do_test<bght::iht16, 0>(argc, argv);
} else if (bucket_size == 32) {
do_test<iht32, 0>(argc, argv);
do_test<bght::iht32, 0>(argc, argv);
} else {
std::cout << "Not supported bucket size\n";
}
} else {
if (bucket_size == 8) {
do_test<iht8, 6>(argc, argv);
do_test<bght::iht8, 6>(argc, argv);
} else if (bucket_size == 16) {
do_test<iht16, 12>(argc, argv);
do_test<bght::iht16, 12>(argc, argv);
} else if (bucket_size == 32) {
do_test<iht32, 25>(argc, argv);
do_test<bght::iht32, 25>(argc, argv);
} else {
std::cout << "Not supported bucket size\n";
}
Expand Down
6 changes: 3 additions & 3 deletions include/bght/bcht.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#pragma once
#include <bght/detail/allocator.hpp>
#include <bght/detail/cuda_helpers.cuh>
#include <bght/detail/hash_functions.cuh>
#include <bght/detail/kernels.cuh>
#include <bght/hash_functions.hpp>
#include <bght/pair.cuh>
#include <cuda/atomic>
#include <cuda/std/utility>
Expand Down Expand Up @@ -218,8 +218,6 @@ struct bcht {
std::size_t num_buckets_;
};

} // namespace bght

template <typename Key, typename T>
using bcht8 = typename bght::bcht<Key,
T,
Expand Down Expand Up @@ -247,4 +245,6 @@ using bcht32 = typename bght::bcht<Key,
bght::cuda_allocator<char>,
32>;

} // namespace bght

#include <bght/detail/bcht_impl.cuh>
2 changes: 1 addition & 1 deletion include/bght/cht.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#pragma once
#include <bght/detail/allocator.hpp>
#include <bght/detail/cuda_helpers.cuh>
#include <bght/detail/hash_functions.cuh>
#include <bght/detail/kernels.cuh>
#include <bght/hash_functions.hpp>
#include <bght/pair.cuh>
#include <cuda/atomic>
#include <cuda/std/utility>
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions include/bght/iht.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#pragma once
#include <bght/detail/allocator.hpp>
#include <bght/detail/cuda_helpers.cuh>
#include <bght/detail/hash_functions.cuh>
#include <bght/detail/kernels.cuh>
#include <bght/detail/prime.hpp>
#include <bght/hash_functions.hpp>
#include <bght/pair.cuh>
#include <cuda/atomic>
#include <memory>
Expand Down Expand Up @@ -270,7 +270,6 @@ struct iht {

std::size_t num_buckets_;
};
} // namespace bght

template <typename Key, typename T, int Threshold = 6>
using iht8 = typename bght::iht<Key,
Expand Down Expand Up @@ -301,4 +300,6 @@ using iht32 = typename bght::iht<Key,
32,
Threshold>;

} // namespace bght

#include <bght/detail/iht_impl.cuh>
6 changes: 3 additions & 3 deletions include/bght/p2bht.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#pragma once
#include <bght/detail/allocator.hpp>
#include <bght/detail/cuda_helpers.cuh>
#include <bght/detail/hash_functions.cuh>
#include <bght/detail/kernels.cuh>
#include <bght/hash_functions.hpp>
#include <bght/pair.cuh>
#include <cuda/atomic>
#include <cuda/std/utility>
Expand Down Expand Up @@ -214,8 +214,6 @@ struct p2bht {
std::size_t num_buckets_;
};

} // namespace bght

template <typename Key, typename T>
using p2bht8 = typename bght::p2bht<Key,
T,
Expand Down Expand Up @@ -243,4 +241,6 @@ using p2bht32 = typename bght::p2bht<Key,
bght::cuda_allocator<char>,
32>;

} // namespace bght

#include <bght/detail/p2bht_impl.cuh>
9 changes: 6 additions & 3 deletions test/gtest_map.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
*/

#include <gtest/gtest.h>
#include <bcht.hpp>

#include <bght/cht.hpp>

#include <bght/bcht.hpp>
#include <bght/iht.hpp>
#include <bght/p2bht.hpp>
#include <cstdint>
#include <iht.hpp>
#include <limits>
#include <p2bht.hpp>
#include <type_traits>

// Based on sample6_unittest
Expand Down

0 comments on commit 45d4a7f

Please sign in to comment.