File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ import numpy as np
2
+ import os
3
+
4
+ results_folder = "results"
5
+ baseline_file = "baseline_dp_O3"
6
+
7
+ def read_result (file_path ):
8
+ with open (file_path , 'r' ) as file :
9
+ data = file .read ()
10
+ matrix = np .array ([list (map (int , row .split (',' ))) for row in data .strip ().split ('\n ' )])
11
+ return matrix
12
+
13
+ baseline_matrix = read_result (os .path .join (results_folder , baseline_file ))
14
+ print (f"Baseline file is { baseline_file } " )
15
+
16
+ # Loop through all files in the results folder (excluding the baseline file)
17
+ for filename in sorted (os .listdir (results_folder )):
18
+
19
+ # Construct the full path of the current result file
20
+ file_path = os .path .join (results_folder , filename )
21
+
22
+ # Read the current result file into a NumPy array
23
+ result_matrix = read_result (file_path )
24
+
25
+ # Compare the result matrix with the baseline matrix
26
+ if np .array_equal (result_matrix , baseline_matrix ):
27
+ print (f"File { filename } matches the baseline." )
28
+ #else:
29
+ # print(f"File {filename} does NOT match the baseline.")
30
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ for file in ../build/bin/* ; do
4
+ # extract filename from path
5
+ filename=$( basename $file )
6
+
7
+ echo -e " \tRunning $filename "
8
+ $file " results/$filename "
9
+ done
You can’t perform that action at this time.
0 commit comments