forked from alpaka-group/cupla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
159 lines (153 loc) · 6.6 KB
/
.travis.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
language: cpp
sudo: false
cache:
apt: true
directories:
- $HOME/.cache/cuda
- $HOME/.cache/cmake
- $HOME/.cache/boost
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
packages:
- g++-4.9
- clang-3.5
env:
global:
- CUDA_ROOT: $HOME/.cache/cuda
- CMAKE_ROOT: $HOME/.cache/cmake
- BOOST_ROOT: $HOME/.cache/boost
- BOOST_MIN: 106000 # careful: hard coded below
- CUPLA_ROOT: $TRAVIS_BUILD_DIR
- OMP_NUM_THREADS: 4 # ignored in thread layer
matrix:
# Acc Block Thread
- COMPILER=gcc STRATEGY="CPU_B_SEQ_T_OMP2"
- COMPILER=gcc STRATEGY="CPU_B_OMP2_T_SEQ"
- COMPILER=gcc STRATEGY="CPU_B_SEQ_T_SEQ"
- COMPILER=clang STRATEGY="CPU_B_SEQ_T_THREADS"
- COMPILER=clang STRATEGY="CPU_B_SEQ_T_SEQ"
- COMPILER=nvcc STRATEGY="GPU_CUDA"
before_install:
- mkdir -p $HOME/matrixMul
- mkdir -p $HOME/asyncAPI
- mkdir -p $HOME/asyncAPI_tuned
- mkdir -p $HOME/vectorAdd
- export CMAKE_FLAGS="-DALPAKA_ACC_"$STRATEGY"_ENABLE=ON"
- if [ "$COMPILER" == "gcc" ]; then
echo "Using g++-4.9 and sequential OpenMP2 threads ...";
export CXX=g++-4.9;
export CC=gcc-4.9;
unset CUDA_ROOT;
elif [ "$COMPILER" == "clang" ]; then
echo "Using clang++-3.5 & sequential threads ...";
export CXX=clang++-3.5;
export CC=clang-3.5;
unset CUDA_ROOT;
elif [ "$COMPILER" == "nvcc" ]; then
echo "Using CUDA 7.5 ...";
export CXX=g++-4.9;
export CC=gcc-4.9;
export PATH=$CUDA_ROOT/bin:$PATH;
fi
- echo "$CMAKE_FLAGS"
- echo "$CXX $CC"
- $CXX --version
- $CC --version
install:
#############################################################################
# CMAKE #
#############################################################################
- export PATH=$CMAKE_ROOT/bin:$PATH
- CMAKE_39_FOUND=$(cmake --version | grep " 3\.9\." >/dev/null && { echo 0; } || { echo 1; })
- if [ $CMAKE_39_FOUND -ne 0 ]; then
mkdir -p $CMAKE_ROOT &&
cd $CMAKE_ROOT &&
rm -rf $CMAKE_ROOT/* &&
travis_retry wget --no-check-certificate http://cmake.org/files/v3.9/cmake-3.9.4-Linux-x86_64.tar.gz &&
tar -xzf cmake-3.9.4-Linux-x86_64.tar.gz &&
mv cmake-3.9.4-Linux-x86_64/* . &&
rm -rf cmake-3.9.4-Linux-x86_64.tar.gz cmake-3.9.4-Linux-x86_64 &&
cd -;
fi
- cmake --version
#############################################################################
# BOOST #
#############################################################################
- export CMAKE_PREFIX_PATH=$BOOST_ROOT:$CMAKE_PREFIX_PATH
# cmake --find-package -DNAME=Boost -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST
- echo -e "#include <boost/version.hpp>\n#include <iostream>\nint main() { std::cout << BOOST_VERSION << std::endl; return 0; }"
| $CXX -I$BOOST_ROOT/include -x c++ - >/dev/null || { echo 0; }
- ls $BOOST_ROOT
- BOOST_FOUND=$([ $(./a.out) -ge $BOOST_MIN ] && { echo 0; } || { echo 1; })
- if [ $BOOST_FOUND -ne 0 ]; then
mkdir -p $ BOOST_ROOT &&
cd $BOOST_ROOT &&
travis_retry wget --no-check-certificate -O boost.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.bz2/download &&
tar -xjf boost.tar.bz2 &&
cd boost_1_62_0 &&
./bootstrap.sh --with-libraries=atomic,chrono,context,date_time,system,thread --prefix=$BOOST_ROOT &&
./b2 -j2 &&
./b2 install &&
rm -rf boost.tar.bz2 boost_1_62_0 &&
cd $HOME;
fi
#############################################################################
# CUDA #
#############################################################################
- NVCC_FOUND=$(which nvcc >/dev/null && { echo 0; } || { echo 1; })
- if [ $NVCC_FOUND -ne 0 ] && [ $COMPILER == "nvcc" ]; then
mkdir -p $CUDA_ROOT &&
cd $CUDA_ROOT &&
travis_retry wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run &&
chmod u+x *.run &&
./cuda_7.5.18_linux.run --silent --verbose --toolkit --toolkitpath=$CUDA_ROOT &&
rm -rf cuda_7.5.18_linux.run $CUDA_ROOT/{samples,jre,doc,share} &&
cd -;
fi
script:
#############################################################################
# Example: Matrix Multiplication (adapted original) #
#############################################################################
- cd $HOME/matrixMul
- cmake $TRAVIS_BUILD_DIR/example/CUDASamples/matrixMul/ $CMAKE_FLAGS
- make
# can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original
# SDK example
# CPU_B_SEQ_T_OMP2/THREADS: too many threads necessary (256)
# - ./matrixMul -wA=64 -wB=64 -hA=64 -hB=64
#############################################################################
# Example: Async API (adapted original) #
#############################################################################
- cd $HOME/asyncAPI
- cmake $TRAVIS_BUILD_DIR/example/CUDASamples/asyncAPI/ $CMAKE_FLAGS
- make
# can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original
# SDK example
# CPU_B_SEQ_T_OMP2/THREADS: too many threads necessary (512)
# - ./asyncAPI
#############################################################################
# Example: Async API (added elements layer) #
#############################################################################
- cd $HOME/asyncAPI_tuned
- cmake $TRAVIS_BUILD_DIR/example/CUDASamples/asyncAPI_tuned/ $CMAKE_FLAGS
- make
- if [ $STRATEGY == "CPU_B_OMP2_T_SEQ" ] ||
[ $STRATEGY == "CPU_B_SEQ_T_SEQ" ]; then
./asyncAPI_tuned;
fi
#############################################################################
# Example: vectorAdd (added elements layer) #
#############################################################################
- cd $HOME/vectorAdd
- cmake $TRAVIS_BUILD_DIR/example/CUDASamples/vectorAdd/ $CMAKE_FLAGS
- make
- if [ $STRATEGY == "CPU_B_OMP2_T_SEQ" ] ||
[ $STRATEGY == "CPU_B_SEQ_T_SEQ" ]; then
./vectorAdd 100000;
fi
#############################################################################
# Test: (To do: add tests in $TRAVIS_BUILD_DIR/test/ #
#############################################################################