-
Notifications
You must be signed in to change notification settings - Fork 3
/
EbsTest.cpp
97 lines (77 loc) · 2.55 KB
/
EbsTest.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
#include "gtest/gtest.h"
#include "ebs_wrapper.h"
#include "common.h"
#include "WorkloadA.h"
#include "WorkloadB.h"
#include "WorkloadC.h"
#include "WorkloadD.h"
namespace {
TEST(EbsUInt64Test, WorkloadA_80M_Dep)
{
printf("Generating workload WorkloadA 80M ENFORCE dep..\n");
WorkloadUInt64 workload = WorkloadA::GenWorkload80M();
Auto(workload.FreeMemory());
workload.EnforceDependency();
printf("Executing workload..\n");
EbsUInt64::EbsExecuteWorkload<true>(workload);
printf("Validating results..\n");
uint64_t sum = 0;
rep(i, 0, workload.numOperations - 1)
{
ReleaseAssert(workload.results[i] == workload.expectedResults[i]);
sum += (workload.results[i] > 0);
}
printf("Finished %d queries %d positives\n", int(workload.numOperations), int(sum));
}
TEST(EbsUInt64Test, WorkloadB_80M_Dep)
{
printf("Generating workload WorkloadB 80M ENFORCE dep..\n");
WorkloadUInt64 workload = WorkloadB::GenWorkload80M();
Auto(workload.FreeMemory());
workload.EnforceDependency();
printf("Executing workload..\n");
EbsUInt64::EbsExecuteWorkload<true>(workload);
printf("Validating results..\n");
uint64_t sum = 0;
rep(i, 0, workload.numOperations - 1)
{
ReleaseAssert(workload.results[i] == workload.expectedResults[i]);
sum += (workload.results[i] > 0);
}
printf("Finished %d queries %d positives\n", int(workload.numOperations), int(sum));
}
TEST(EbsUInt64Test, WorkloadC_80M_Dep)
{
printf("Generating workload WorkloadC 80M ENFORCE dep..\n");
WorkloadUInt64 workload = WorkloadC::GenWorkload80M();
Auto(workload.FreeMemory());
workload.EnforceDependency();
printf("Executing workload..\n");
EbsUInt64::EbsExecuteWorkload<true>(workload);
printf("Validating results..\n");
uint64_t sum = 0;
rep(i, 0, workload.numOperations - 1)
{
ReleaseAssert(workload.results[i] == workload.expectedResults[i]);
sum += (workload.results[i] > 0);
}
printf("Finished %d queries %d positives\n", int(workload.numOperations), int(sum));
}
TEST(EbsUInt64Test, WorkloadD_80M_Dep)
{
printf("Generating workload WorkloadD 80M ENFORCE dep..\n");
WorkloadUInt64 workload = WorkloadD::GenWorkload80M();
Auto(workload.FreeMemory());
workload.EnforceDependency();
printf("Executing workload..\n");
EbsUInt64::EbsExecuteWorkload<true>(workload);
printf("Validating results..\n");
uint64_t sum = 0;
rep(i, 0, workload.numOperations - 1)
{
ReleaseAssert(workload.results[i] == workload.expectedResults[i]);
sum += (workload.results[i] > 0);
}
printf("Finished %d queries %d positives\n", int(workload.numOperations), int(sum));
}
} // annoymous namespace