Skip to content

Commit ff95d92

Browse files
authored
tuna-script: validate tuning file for the presence of data (#1929)
1 parent b175045 commit ff95d92

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mlir/utils/tuna/tuna-script.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ validate_tuning_file() {
5959
echo "ERROR: $f has duplicate header lines next to each other!"
6060
exit 1
6161
fi
62-
# NOTE: Temporarily disabled the check for data lines after the header.
63-
# Existing checks
64-
#data_line=$(awk 'NR>1 && $0 !~ /^\s*$/ && $0 != header {print; exit}' header="$header" "$f")
65-
#if [ -z "$data_line" ]; then
66-
# echo "ERROR: $f has no data after header!"
67-
# exit 1
68-
#fi
62+
# Check for the presence of data after header
63+
data_line=$(awk 'NR>1 && $0 !~ /^\s*$/ && $0 != header {print; exit}' header="$header" "$f")
64+
if [ -z "$data_line" ]; then
65+
echo "ERROR: $f has no data after header!"
66+
exit 1
67+
fi
6968
}
7069

7170
function tuna_run

0 commit comments

Comments
 (0)