-
Notifications
You must be signed in to change notification settings - Fork 1
/
testscript.sh
39 lines (31 loc) · 1.05 KB
/
testscript.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Directory containing the benchmarks
BENCHMARK_DIR="$HOME/HeCBench/src"
# Log file
LOG_FILE="$HOME/HeCBench/benchmark.log"
# List of benchmarks to run
BENCHMARKS=(
"remap" "relu"
)
# Function to run a benchmark
run_benchmark() {
local benchmark=$1
echo "Running benchmark: $benchmark-sycl"
echo "------------------------------" >> "$LOG_FILE"
echo "Benchmark: $benchmark-sycl" >> "$LOG_FILE"
echo "Start time: $(date)" >> "$LOG_FILE"
# Change to the benchmark directory and run the make command
if [ -d "$BENCHMARK_DIR/${benchmark}-sycl" ]; then
(cd "$BENCHMARK_DIR/${benchmark}-sycl" && make CC=icpx run) >> "$LOG_FILE" 2>&1
else
echo "Directory not found: $BENCHMARK_DIR/${benchmark}-sycl" >> "$LOG_FILE"
fi
echo "End time: $(date)" >> "$LOG_FILE"
echo "------------------------------" >> "$LOG_FILE"
echo "" >> "$LOG_FILE"
}
# Run each benchmark
for benchmark in "${BENCHMARKS[@]}"; do
run_benchmark "$benchmark"
done
echo "All benchmarks completed. Results are in $LOG_FILE"