-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_iluvatar.sh
More file actions
46 lines (39 loc) · 1.72 KB
/
Copy pathtest_iluvatar.sh
File metadata and controls
46 lines (39 loc) · 1.72 KB
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
#!/bin/bash
# ================================================================
# 天数智芯平台一键测试脚本
# 用法:bash test_iluvatar.sh
# ================================================================
set -e
echo "================================================"
echo " 天数智芯 (Iluvatar) 平台测试"
echo "================================================"
echo ""
# 1. 检查环境
echo "=== 1. 环境检查 ==="
which clang++ 2>/dev/null && clang++ --version | head -2 || echo "❌ clang++ 未找到"
echo ""
ls -la /usr/local/corex/include/cuda_runtime.h 2>/dev/null && echo "✅ 天数智芯 CUDA runtime 头文件存在" || echo "❌ 未找到天数智芯头文件"
echo ""
# 2. 编译
echo "=== 2. 编译 (PLATFORM=iluvatar) ==="
cd /workspace/Learning-CUDA 2>/dev/null || cd ~/Learning-CUDA
make clean PLATFORM=iluvatar 2>&1 | tail -2
make PLATFORM=iluvatar VERBOSE=true 2>&1 | tee /tmp/iluvatar_test.txt
echo ""
# 3. 结果汇总
echo "=== 3. 结果汇总 ==="
PASS=$(grep -c "Verification: Passed" /tmp/iluvatar_test.txt || echo 0)
FAIL=$(grep -c "Verification: Failed" /tmp/iluvatar_test.txt || echo 0)
echo "PASS: $PASS / FAIL: $FAIL"
echo ""
if [ "$FAIL" -gt 0 ]; then
echo "=== 4. FAIL 详情 ==="
grep -B6 "Verification: Failed" /tmp/iluvatar_test.txt | grep -E "Test Case|Data Type|Max Diff|Tolerance|Verification"
echo ""
fi
echo "=== 5. 性能数据 ==="
awk '/Attention/{found=1} found && /Test Case/{tc=$0} found && /Data Type/{dt=$3} found && /Avg Time/{printf "%-15s %-6s %s\n", tc, dt, $0}' /tmp/iluvatar_test.txt
echo ""
echo "================================================"
echo " 测试完成!把以上输出贴给助手分析"
echo "================================================"