-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun_soa.cpp
More file actions
99 lines (83 loc) · 3.26 KB
/
run_soa.cpp
File metadata and controls
99 lines (83 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "PMA/CPMA.hpp"
#include "PMA/internal/helpers.hpp"
#include "PMA/internal/leaf.hpp"
#include "StructOfArrays/soa.hpp"
#include <iostream>
#include <limits>
#include <tuple>
#include "PMA/internal/test_map.hpp"
#if !defined(KEY_TYPE)
#define KEY_TYPE uint64_t
#endif
using key_type = KEY_TYPE;
#if !defined(HEADFORM)
#define HEADFORM InPlace
#endif
static constexpr HeadForm head_form = HEADFORM;
static constexpr uint64_t B_size = (head_form == BNary) ? 17 : 0;
#if STORE_DENSITY
static constexpr bool store_density = true;
#else
static constexpr bool store_density = false;
#endif
#if SUPPORT_RANK
static constexpr bool support_rank = true;
#else
static constexpr bool support_rank = false;
#endif
template <typename T, typename U> struct sum_on_duplicate {
constexpr void operator()(T current_value, U new_value) {
add_to_tuple(leftshift_tuple(current_value), leftshift_tuple(new_value));
}
};
int main([[maybe_unused]] int32_t argc, char *argv[]) {
// uint64_t num_elements = 1000000;
// test_tlx_btree_ordered_insert<uint32_t, uint32_t>(num_elements);
// test_tlx_btree_ordered_insert<uint32_t, uint32_t, uint32_t>(num_elements);
// test_tlx_btree_ordered_insert<uint32_t, uint32_t, uint32_t, uint32_t>(
// num_elements);
// test_cpma_ordered_insert<PMA_traits<uncompressed_leaf<uint32_t>, InPlace>>(
// num_elements);
// test_cpma_ordered_insert<
// PMA_traits<uncompressed_leaf<uint32_t, uint32_t>,
// InPlace>>(num_elements);
// test_cpma_ordered_insert<
// PMA_traits<uncompressed_leaf<uint32_t, uint32_t, uint32_t>, InPlace>>(
// num_elements);
// test_cpma_ordered_insert<PMA_traits<
// uncompressed_leaf<uint32_t, uint32_t, uint32_t, uint32_t>, InPlace>>(
// num_elements);
// std::seed_seq seed{0};
// test_tlx_btree_unordered_insert<uint32_t, uint32_t, uint32_t>(num_elements,
// seed, 10);
// std::seed_seq seed2{0};
// test_cpma_unordered_insert<
// PMA_traits<uncompressed_leaf<uint32_t, uint32_t, uint32_t>, InPlace>>(
// num_elements, seed2, 10);
if (std::string("verify") == argv[1]) {
if (verify_cpma_different_sizes<PMA_traits<
uncompressed_leaf<key_type, uint16_t>, head_form, B_size>>(
{{100, false}, {1000, false}, {10000, false}, {20000, true}})) {
return 1;
}
if (verify_cpma_different_sizes<PMA_traits<
uncompressed_leaf<key_type, double, uint32_t>, head_form, B_size>>(
{{100, false}, {1000, false}, {10000, false}, {20000, true}})) {
return 1;
}
if (verify_cpma_different_sizes<
PMA_traits<uncompressed_leaf<key_type, float, double, uint8_t>,
head_form, B_size>>(
{{100, false}, {1000, false}, {10000, false}, {20000, true}})) {
return 1;
}
if (verify_cpma_different_sizes<
PMA_traits<uncompressed_leaf<key_type, uint32_t>, head_form, B_size,
store_density, support_rank, false, 0, true, false,
sum_on_duplicate<std::tuple<key_type &, uint32_t &>,
std::tuple<key_type, uint32_t>>>>(
{{100, false}, {1000, false}, {10000, false}, {20000, true}})) {
return 1;
}
}
}