-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd
59 lines (47 loc) · 1.81 KB
/
cmd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Function to test one OneAPI version
test_oneapi_version() {
VERSION=$1
echo "Testing OneAPI ${VERSION}"
. /opt/intel/oneapi/${VERSION}/oneapi-vars.sh --force
success_count=0
fail_count=0
{
echo "Testing OneAPI ${VERSION}"
echo "======================================"
echo -e "\nBuilding and running without -g"
icpx -O2 -fsycl -fiopenmp -lm -fopenmp-targets=spir64 -o ./build/single.sycloffload.icpx.intelgpu${VERSION} ./src/single.cc ./src/syclgpu.cc
if ./build/single.sycloffload.icpx.intelgpu${VERSION}; then
echo "[SUCCESS] Run without -g completed successfully"
success_count=$((success_count + 1))
else
echo "[FAIL] Run without -g failed"
fail_count=$((fail_count + 1))
fi
echo "======================================"
echo -e "\nBuilding and running with -g"
icpx -g -O2 -fsycl -fiopenmp -lm -fopenmp-targets=spir64 -o ./build/single.sycloffload.icpx.intelgpu${VERSION}-g ./src/single.cc ./src/syclgpu.cc
if ./build/single.sycloffload.icpx.intelgpu${VERSION}-g; then
echo "[SUCCESS] Run with -g completed successfully"
success_count=$((success_count + 1))
else
echo "[FAIL] Run with -g failed"
fail_count=$((fail_count + 1))
fi
echo "======================================"
} >& ./build/logs/log_${VERSION}.txt
RESULTS="${RESULTS}OneAPI ${VERSION} - SUCCESS: ${success_count}, FAIL: ${fail_count}\n"
}
# Check and remove existing build directory
if [ -d "build" ]; then
rm -rf build
fi
mkdir -p build/logs
# Test each version
RESULTS=""
test_oneapi_version "2024.0"
test_oneapi_version "2024.2"
test_oneapi_version "2025.0"
# Print final report
echo -e "\nTest Summary:"
echo -e "${RESULTS}"