Skip to content

Commit af553ce

Browse files
committed
checkpoints to track time
1 parent 3f55a98 commit af553ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cp-algo/math/multivar.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ namespace cp_algo::math::fft {
2626
for(auto [i, x]: ranks | std::views::enumerate) {
2727
x = rank(i);
2828
}
29+
checkpoint("multivar init");
2930
}
3031
void read() {
3132
for(auto &it: data) {
3233
std::cin >> it;
3334
}
35+
checkpoint("multivar read");
3436
}
3537
void print() {
3638
for(auto &it: data) {
3739
std::cout << it << " ";
3840
}
3941
std::cout << "\n";
42+
checkpoint("multivar write");
4043
}
4144
void mul(multivar<base> const& b) {
4245
assert(dim == b.dim);
@@ -69,6 +72,7 @@ namespace cp_algo::math::fft {
6972
size_t tj = (i - j + K) % K;
7073
A[j].template dot<false>(B[tj].A, B[tj].B, C.A, C.B, X);
7174
}
75+
checkpoint("dot");
7276
std::vector<base, cp_algo::big_alloc<base>> res((N + flen - 1) / flen * flen);
7377
C.A.ifft();
7478
C.B.ifft();
@@ -79,6 +83,7 @@ namespace cp_algo::math::fft {
7983
data[j] = res[j];
8084
}
8185
}
86+
checkpoint("store");
8287
}
8388
}
8489
};

verify/poly/multivar.test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void solve() {
2222
b.read();
2323
a.mul(b);
2424
a.print();
25+
cp_algo::checkpoint<1>();
2526
}
2627

2728
signed main() {

0 commit comments

Comments
 (0)