forked from torch/distro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·63 lines (55 loc) · 2.03 KB
/
test.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
set -e
LUA=$(which luajit lua | head -n 1)
if [ ! -x "$LUA" ]
then
echo "Neither luajit nor lua found in path"
exit 1
fi
echo "Using Lua at:"
echo "$LUA"
#smoke tests
$LUA -lpaths -e "print('paths loaded succesfully')"
$LUA -ltorch -e "print('torch loaded succesfully')"
$LUA -lenv -e "print('env loaded succesfully')"
$LUA -ltrepl -e "print('trepl loaded succesfully')"
$LUA -ldok -e "print('dok loaded succesfully')"
$LUA -limage -e "print('image loaded succesfully')"
$LUA -lcwrap -e "print('cwrap loaded succesfully')"
$LUA -lgnuplot -e "print('gnuplot loaded succesfully')"
$LUA -loptim -e "print('optim loaded succesfully')"
$LUA -lsys -e "print('sys loaded succesfully')"
$LUA -lxlua -e "print('x$(basename $LUA) loaded succesfully')"
$LUA -largcheck -e "print('argcheck loaded succesfully')"
$LUA -lgraph -e "print('graph loaded succesfully')"
$LUA -lnn -e "print('nn loaded succesfully')"
$LUA -lnngraph -e "print('nngraph loaded succesfully')"
$LUA -lnnx -e "print('nnx loaded succesfully')"
$LUA -lthreads -e "print('threads loaded succesfully')"
th -ltorch -e "torch.test()"
th -lnn -e "nn.test()"
if [ $(basename $LUA) = "luajit" ]
then
$LUA -lsundown -e "print('sundown loaded succesfully')"
$LUA -lsignal -e "print('signal loaded succesfully')"
$LUA -lgraphicsmagick -e "print('graphicsmagick loaded succesfully')"
$LUA -lfftw3 -e "print('fftw3 loaded succesfully')"
$LUA -laudio -e "print('audio loaded succesfully')"
fi
# CUDA tests
set +e
path_to_nvcc=$(which nvcc)
path_to_nvidiasmi=$(which nvidia-smi)
set -e
if [ -x "$path_to_nvcc" ] || [ -x "$path_to_nvidiasmi" ]
then
$LUA -lcutorch -e "print('cutorch loaded succesfully')"
$LUA -lcunn -e "print('cunn loaded succesfully')"
if [ $(basename $LUA) = "luajit" ];
then
$LUA -lcudnn -e "print('cudnn loaded succesfully')"
fi
th -lcutorch -e "cutorch.test()"
th -lcunn -e "nn.testcuda()"
else
echo "CUDA not found"
fi