Skip to content

Commit c9c8198

Browse files
committed
fix(linpack): Fix number of runs check
1 parent e284cbe commit c9c8198

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

tests/performance/linpack_double/linpack_double.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ void setup()
5353
Serial.printf("Runs: %d\n", N_RUNS);
5454
Serial.printf("Type: %s\n", data_type.c_str());
5555
Serial.flush();
56+
int i = 0;
5657

5758
floating_point_t minMflops = 1000000000.0, maxMflops = 0.0, avgMflops = 0.0;
58-
for (int i = 0; i < N_RUNS; ++i)
59+
for (i = 0; i < N_RUNS; ++i)
5960
{
6061
Serial.printf("Run %d\n", i);
6162
const auto mflops = benchmark();
@@ -66,6 +67,7 @@ void setup()
6667
}
6768

6869
avgMflops /= N_RUNS;
70+
Serial.println(String("Runs completed: ") + i);
6971
Serial.println(String("Average MFLOPS: ") + avgMflops);
7072
Serial.println(String("Min MFLOPS: ") + minMflops);
7173
Serial.println(String("Max MFLOPS: ") + maxMflops);

tests/performance/linpack_double/test_linpack_double.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ def test_linpack_double(dut, request):
1818
LOGGER.info("Data type: {}".format(data_type))
1919
assert data_type == "double", "Invalid data type"
2020

21-
for i in range(runs):
22-
# Match "Run %d"
23-
res = dut.expect(r"Run (\d+)", timeout=120)
24-
run = int(res.group(0).decode("utf-8").split(" ")[1])
25-
LOGGER.info("Run {}".format(run))
26-
assert run == i, "Invalid run number"
21+
# Match "Runs completed: %d"
22+
res = dut.expect(r"Runs completed: (\d+)", timeout=120)
23+
runs_completed = int(res.group(0).decode("utf-8").split(" ")[2])
24+
LOGGER.info("Runs completed: {}".format(runs_completed))
25+
assert runs_completed == runs, "Invalid number of runs completed"
2726

2827
# Match "Average MFLOPS: %f"
2928
res = dut.expect(r"Average MFLOPS: (\d+\.\d+)", timeout=120)

tests/performance/linpack_float/linpack_float.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ void setup()
5353
Serial.printf("Runs: %d\n", N_RUNS);
5454
Serial.printf("Type: %s\n", data_type.c_str());
5555
Serial.flush();
56+
int i = 0;
5657

5758
floating_point_t minMflops = 1000000000.0, maxMflops = 0.0, avgMflops = 0.0;
58-
for (int i = 0; i < N_RUNS; ++i)
59+
for (i = 0; i < N_RUNS; ++i)
5960
{
6061
Serial.printf("Run %d\n", i);
6162
const auto mflops = benchmark();
@@ -66,6 +67,7 @@ void setup()
6667
}
6768

6869
avgMflops /= N_RUNS;
70+
Serial.println(String("Runs completed: ") + i);
6971
Serial.println(String("Average MFLOPS: ") + avgMflops);
7072
Serial.println(String("Min MFLOPS: ") + minMflops);
7173
Serial.println(String("Max MFLOPS: ") + maxMflops);

tests/performance/linpack_float/test_linpack_float.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ def test_linpack_float(dut, request):
1818
LOGGER.info("Data type: {}".format(data_type))
1919
assert data_type == "float", "Invalid data type"
2020

21-
for i in range(runs):
22-
# Match "Run %d"
23-
res = dut.expect(r"Run (\d+)", timeout=120)
24-
run = int(res.group(0).decode("utf-8").split(" ")[1])
25-
LOGGER.info("Run {}".format(run))
26-
assert run == i, "Invalid run number"
21+
# Match "Runs completed: %d"
22+
res = dut.expect(r"Runs completed: (\d+)", timeout=120)
23+
runs_completed = int(res.group(0).decode("utf-8").split(" ")[2])
24+
LOGGER.info("Runs completed: {}".format(runs_completed))
25+
assert runs_completed == runs, "Invalid number of runs completed"
2726

2827
# Match "Average MFLOPS: %f"
2928
res = dut.expect(r"Average MFLOPS: (\d+\.\d+)", timeout=120)

0 commit comments

Comments
 (0)