-
Notifications
You must be signed in to change notification settings - Fork 2
/
prepare_tests.sh
executable file
·72 lines (57 loc) · 1.4 KB
/
prepare_tests.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
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
if [ ! -d stablehlo ]
then
echo "The stablehlo directory is missing"
echo "To prepare tests, install stablehlo: https://github.com/openxla/stablehlo"
exit
fi
if [ ! -f stablehlo/build/bin/stablehlo-opt ]
then
echo "Missing: stablehlo/build/bin/stablehlo-opt"
exit
fi
shopt="stablehlo/build/bin/stablehlo-opt -mlir-print-op-generic -split-input-file"
interpret_test=stablehlo/stablehlo/tests/interpret
if [ ! -d $interpret_test ]
then
echo "Missing tests: $interpret_test"
exit
fi
for test in `ls $interpret_test/*.mlir`
do
name=interpret_`basename $test`
$shopt $test > Tests/$name
done
test_data=stablehlo/stablehlo/testdata
if [ ! -d $test_data ]
then
echo "Missing tests: $test_data"
exit
fi
for test in `ls $test_data/*.mlir`
do
name=testdata_`basename $test`
$shopt $test > Tests/$name
done
test_data_dynamic=stablehlo/stablehlo/testdata/dynamic
if [ ! -d $test_data_dynamic ]
then
echo "Missing tests: $test_data_dynamic"
exit
fi
for test in `ls $test_data_dynamic/*.mlir`
do
name=testdata__dynamic_`basename $test`
$shopt $test > Tests/$name
done
test_data_quantized=stablehlo/stablehlo/testdata/quantized
if [ ! -d $test_data_quantized ]
then
echo "Missing tests: $test_data_quantized"
exit
fi
for test in `ls $test_data_quantized/*.mlir`
do
name=testdata_quantized_`basename $test`
$shopt $test > Tests/$name
done