-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ixx
104 lines (94 loc) · 2.07 KB
/
main.ixx
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
export module main;
import day01;
import day02;
import day03;
import day04;
import day05;
import day06;
import day07;
import day08;
import day09;
import day10;
import day11;
import day12;
import day13;
import day14;
import day15;
import day16;
import day17;
import day18;
import benchmark;
import utils;
import <iostream>;
import <iomanip>;
using LastDay = Day18;
enum class Mode {
BenchmarkLatest,
BenchmarkAll,
TestLatest,
TestAll
};
//constexpr Mode mode = Mode::BenchmarkLatest;
constexpr Mode mode = Mode::TestLatest;
//constexpr Mode mode = Mode::BenchmarkAll;
//constexpr Mode mode = Mode::TestAll;
export int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
switch (mode) {
case Mode::BenchmarkLatest: {
bench<LastDay>();
break;
}
case Mode::BenchmarkAll: {
U64 total_microseconds = 0;
total_microseconds += bench<Day1>();
total_microseconds += bench<Day2>();
total_microseconds += bench<Day3>();
total_microseconds += bench<Day4>();
total_microseconds += bench<Day5>();
total_microseconds += bench<Day6>();
total_microseconds += bench<Day7>();
total_microseconds += bench<Day8>();
total_microseconds += bench<Day9>();
total_microseconds += bench<Day10>();
total_microseconds += bench<Day11>();
total_microseconds += bench<Day12>();
total_microseconds += bench<Day13>();
total_microseconds += bench<Day14>();
total_microseconds += bench<Day15>();
total_microseconds += bench<Day16>();
total_microseconds += bench<Day17>();
total_microseconds += bench<Day18>();
std::cout << std::format("Total: {} microseconds\n", total_microseconds);
break;
}
case Mode::TestLatest: {
test<LastDay>();
break;
}
case Mode::TestAll: {
test<Day1>();
test<Day2>();
test<Day3>();
test<Day4>();
test<Day5>();
test<Day6>();
test<Day7>();
test<Day8>();
test<Day9>();
test<Day10>();
test<Day11>();
test<Day12>();
test<Day13>();
test<Day14>();
test<Day15>();
test<Day16>();
test<Day17>();
test<Day18>();
break;
}
}
return 0;
}