-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cc
29 lines (25 loc) · 852 Bytes
/
test.cc
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
#include "sorters/SampleSort.generated.h"
#include "networks/BestNetworks.generated.h"
#include "StructHelpers.generated.h"
#include "Randomisation.h"
#include "Randomisation.Sortable.h"
#include "ArrayHelpers.h"
bool PredicateLess(uint64_t& key, SortableRef& value)
{
return key < value.key;
}
void Test()
{
int arraySize = 1024 * 16;
SortableRef* arr = (SortableRef*) malloc(sizeof(SortableRef) * arraySize);
randomisation::GenerateRandomArray<SortableRef, RandomisationMode::Default>(arr, arraySize);
samplesort::SampleSort3Splitters3OversamplingFactor2BlockSize(arr, arraySize, 16, &networks::sortNbest<SortableRef>, &PredicateLess, &GetKey<SortableRef>);
if (!IsSorted(arr, arraySize))
{
debug::WriteLine("Wrong sort qs copy");
}
else
{
debug::WriteLine("Correct sort qs copy");
}
}