print Q(n) and I(n)

This commit is contained in:
Nguyen Quy Anh
2026-04-29 20:14:56 +02:00
parent 6b8d5bc94c
commit e113319083
4 changed files with 41 additions and 5 deletions
+5 -5
View File
@@ -1,12 +1,12 @@
# Build artifacts
*.o
*.out
*.csv
*.mp4
*.gif
*.log
sim
main
positions.csv
test.mp4
test_run_out.mp4
main_test_visualisation
main*
# Editor files
.vscode/
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
sudo cpupower frequency-set -u 2000000
sudo cpupower frequency-set -d 2000000
+15
View File
@@ -209,6 +209,21 @@ int main(int argc, const char *argv[]) {
std::cout << P;
std::cout << " flops/cycle\n";
long long W_per_iter = (long long)(8 + 55 * n_p - 55 + 192 + 4 + 8 + 4 + 10) * n_p;
std::cout << "W(n) per iteration: ";
std::cout << W_per_iter;
std::cout << " flops\n";
long long Q = 104 * n_p + 32 * 4 + 80;
std::cout << "Q(n) per iteration: ";
std::cout << Q;
std::cout << " bytes\n";
long long I = (long long)(8 + 55 * n_p - 55 + 192 + 4 + 8 + 4 + 10) * n_p / Q;
std::cout << "I(n): ";
std::cout << I;
std::cout << " flops/byte\n";
// now we wanna save the data to a csv
if (dump_path) {
std::ofstream out(dump_path);
+18
View File
@@ -0,0 +1,18 @@
#include "pedestrian.hpp"
#include "board.hpp"
#include <iostream>
#include <math.h>
int main() {
std::cout << sizeof(Color);
std::cout << "\n";
std::cout << sizeof(Vector2d);
std::cout << "\n";
std::cout << sizeof(Pedestrian);
std::cout << "\n";
std::cout << sizeof(Obstacle);
std::cout << "\n";
std::cout << sizeof(Board);
std::cout << "\n";
return 0;
}