forked from z-prize/prize-gpu-fpga-msm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
evaluate.sh
executable file
·61 lines (49 loc) · 1.17 KB
/
evaluate.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
export SUBMISSION_URL=$1
shift
exec 2>evaluate.log
set -ex
function info {
echo -e "
\033[32m===============================\033[0m
[\033[96m INFO \033[0m] $@
\033[32m===============================\033[0m
"
}
# Clone into submission directory
info Cloning the repository
git clone \
--branch master \
--depth 1 \
--single-branch \
--recurse-submodules \
--shallow-submodules \
$SUBMISSION_URL submission
info Setting up HDK
set +e
source aws-fpga/hdk_setup.sh
set -e
# Compile logic
info Compiling CL
export CL_DIR=$(pwd)/submission/cl
vivado -mode batch
pushd $CL_DIR/build/scripts
./aws_build_dcp_from_cl.sh -foreground
popd
# Create AFI
info Creating AFI
source ./build_image.sh -dcp $CL_DIR/build/checkpoints/to_aws/*Developer_CL.tar
AGFI_ID=$(grep agfi image-id.json | cut -d'"' -f 4)
# Load the image (twice, due to weird bugs in aws)
info Loading AFI
sudo fpga-load-local-image -S 0 -I $AGFI_ID
sudo fpga-load-local-image -S 0 -I $AGFI_ID
# Run correctness tests
info Testing correctness
pushd harness
cargo test --release
# Run benchmark
info Benchmarking
cargo bench
popd
# The output should now be in `harness/target/criterion/**`