-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperf-paper.cpp
120 lines (107 loc) · 5.67 KB
/
perf-paper.cpp
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <cstdint>
#include <functional>
#include <iomanip>
#include <iostream>
#include "cmp_sorters.hpp"
#include "data.hpp"
#include "perf.hpp"
#include "quick_sort.hpp"
#include "radix_sort.hpp"
#include "sort_methods.hpp"
using namespace simd_sort;
int main() {
std::cout << std::fixed;
std::cout << std::setprecision(6);
#ifdef IPP_RADIX_IS_PRESENT_
std::cout << "Initializing IPP..." << std::endl;
ipp_radix::ippInit();
#endif
using AllSorts = PerfTest<
SortMethodQuickSort<quick_sort::PartitionerSequential,
CmpSorterInsertionSort>,
SortMethodQuickSort<quick_sort::PartitionerSIMD, CmpSorterInsertionSort>,
SortMethodQuickSort<quick_sort::PartitionerSIMD,
CmpSorterBramasSmallSort>,
SortMethodRadixSort<radix_sort::BitSorterSIMD<false>,
CmpSorterInsertionSort>,
SortMethodRadixSort<radix_sort::BitSorterSIMD<false>,
CmpSorterBramasSmallSort>,
#ifdef IPP_RADIX_IS_PRESENT_
SortMethodIPPRadix,
#endif
SortMethodSTLSort, SortMethodBramas, SortMethodBlacher>;
std::function<void()> testFunctions[] = {
AllSorts::thresh<InputDistribution::Uniform, float>,
AllSorts::thresh<InputDistribution::Uniform, double>,
AllSorts::thresh<InputDistribution::Uniform, int32_t>,
AllSorts::thresh<InputDistribution::Uniform, int32_t, int32_t>,
AllSorts::thresh<InputDistribution::Uniform, float, int32_t>,
AllSorts::thresh<InputDistribution::Uniform, float, int64_t>,
AllSorts::thresh<InputDistribution::Uniform, double, int32_t>,
AllSorts::thresh<InputDistribution::Uniform, double, int64_t>,
AllSorts::thresh<InputDistribution::Uniform, float, int32_t, int64_t>,
AllSorts::perfTest<InputDistribution::Uniform, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::Gaussian, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::Zero, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::ZeroOne, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::Sorted, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::ReverseSorted, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostSorted, int32_t, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, int32_t,
int32_t>,
AllSorts::perfTest<InputDistribution::Uniform, int32_t>,
AllSorts::perfTest<InputDistribution::Gaussian, int32_t>,
AllSorts::perfTest<InputDistribution::Zero, int32_t>,
AllSorts::perfTest<InputDistribution::ZeroOne, int32_t>,
AllSorts::perfTest<InputDistribution::Sorted, int32_t>,
AllSorts::perfTest<InputDistribution::ReverseSorted, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostSorted, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, int32_t>,
AllSorts::perfTest<InputDistribution::Uniform, float>,
AllSorts::perfTest<InputDistribution::Gaussian, float>,
AllSorts::perfTest<InputDistribution::Zero, float>,
AllSorts::perfTest<InputDistribution::ZeroOne, float>,
AllSorts::perfTest<InputDistribution::Sorted, float>,
AllSorts::perfTest<InputDistribution::ReverseSorted, float>,
AllSorts::perfTest<InputDistribution::AlmostSorted, float>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, float>,
AllSorts::perfTest<InputDistribution::Uniform, double>,
AllSorts::perfTest<InputDistribution::Gaussian, double>,
AllSorts::perfTest<InputDistribution::Zero, double>,
AllSorts::perfTest<InputDistribution::ZeroOne, double>,
AllSorts::perfTest<InputDistribution::Sorted, double>,
AllSorts::perfTest<InputDistribution::ReverseSorted, double>,
AllSorts::perfTest<InputDistribution::AlmostSorted, double>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, double>,
AllSorts::perfTest<InputDistribution::Uniform, float, int32_t>,
AllSorts::perfTest<InputDistribution::Gaussian, float, int32_t>,
AllSorts::perfTest<InputDistribution::Zero, float, int32_t>,
AllSorts::perfTest<InputDistribution::ZeroOne, float, int32_t>,
AllSorts::perfTest<InputDistribution::Sorted, float, int32_t>,
AllSorts::perfTest<InputDistribution::ReverseSorted, float, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostSorted, float, int32_t>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, float,
int32_t>,
AllSorts::perfTest<InputDistribution::Uniform, uint8_t>,
AllSorts::perfTest<InputDistribution::Gaussian, uint8_t>,
AllSorts::perfTest<InputDistribution::Zero, uint8_t>,
AllSorts::perfTest<InputDistribution::ZeroOne, uint8_t>,
AllSorts::perfTest<InputDistribution::Sorted, uint8_t>,
AllSorts::perfTest<InputDistribution::ReverseSorted, uint8_t>,
AllSorts::perfTest<InputDistribution::AlmostSorted, uint8_t>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, uint8_t>,
AllSorts::perfTest<InputDistribution::Uniform, int16_t>,
AllSorts::perfTest<InputDistribution::Gaussian, int16_t>,
AllSorts::perfTest<InputDistribution::Zero, int16_t>,
AllSorts::perfTest<InputDistribution::ZeroOne, int16_t>,
AllSorts::perfTest<InputDistribution::Sorted, int16_t>,
AllSorts::perfTest<InputDistribution::ReverseSorted, int16_t>,
AllSorts::perfTest<InputDistribution::AlmostSorted, int16_t>,
AllSorts::perfTest<InputDistribution::AlmostReverseSorted, int16_t>,
AllSorts::perfTestNum<InputDistribution::Uniform, int32_t>,
AllSorts::perfTestNum<InputDistribution::Zero, int32_t>,
};
for (auto &testFunction : testFunctions) {
testFunction();
}
}