forked from ROCm/rocRAND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
116 lines (110 loc) · 3.24 KB
/
.gitlab-ci.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
image: rocm/rocm-terminal:latest
variables:
SUDO_CMD: "" # Must be "sudo" on images which dont use root user
DEPS_DIR: "$CI_PROJECT_DIR/__dependencies"
CMAKE_URL: "https://cmake.org/files/v3.8/cmake-3.8.1-Linux-x86_64.tar.gz"
# General build flags
CXXFLAGS: ""
CMAKE_OPTIONS: ""
# Local build options
LOCAL_CXXFLAGS: ""
LOCAL_CMAKE_OPTIONS: ""
# TERM
TERM: xterm
before_script:
# We had to add sudo because rocm image does not use root as user
- hipconfig
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq git wget tar xz-utils bzip2 build-essential xterm pkg-config
- $SUDO_CMD apt-get install -y -qq g++ gfortran
# cmake
- mkdir -p $DEPS_DIR/cmake
- wget --no-check-certificate --quiet -O - $CMAKE_URL | tar --strip-components=1 -xz -C $DEPS_DIR/cmake
- export PATH=$DEPS_DIR/cmake/bin:$PATH
# Combine global build options with local options
- export CXXFLAGS=$CXXFLAGS" "$LOCAL_CXXFLAGS
- export CMAKE_OPTIONS=$CXXFLAGS" "$LOCAL_CMAKE_OPTIONS
build:rocm:
stage: build
variables:
SUDO_CMD: "sudo -E"
script:
- mkdir build
- cd build
- cmake -DBUILD_BENCHMARK=ON -DBUILD_FORTRAN_WRAPPER=ON -DBUILD_CRUSH_TEST=ON -DDEPENDENCIES_FORCE_DOWNLOAD=ON ../.
- make -j16
- make package
artifacts:
paths:
- build/library/
- build/test/
- build/benchmark/
- build/gtest/
- build/testu01/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/Makefile
- build/*.deb
- build/*.zip
test:rocm:
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- ctest --output-on-failure
- ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- ./test/crush_test_rocrand --help # Just check if works
test:rocm_python:
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
before_script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq python python-pip python-numpy
- $SUDO_CMD apt-get install -y -qq python3 python3-pip python3-numpy
- pip install Sphinx
script:
- export ROCRAND_PATH=$CI_PROJECT_DIR/build/library/
# rocRAND Wrapper
- cd $CI_PROJECT_DIR/python/rocrand
- python setup.py test
- python3 setup.py test
- pip install .
- python tests/rocrand_test.py
- pip uninstall --yes rocrand
- pip3 install .
- python3 tests/rocrand_test.py
- pip3 uninstall --yes rocrand
- python setup.py build_sphinx
# hipRAND Wrapper
- cd $CI_PROJECT_DIR/python/hiprand
- python setup.py test
- python3 setup.py test
- pip install .
- python tests/hiprand_test.py
- pip uninstall --yes hiprand
- pip3 install .
- python3 tests/hiprand_test.py
- pip3 uninstall --yes hiprand
- python setup.py build_sphinx
test:rocm_deb_package:
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD dpkg -i rocrand-*.deb
- mkdir ../build_package_test && cd ../build_package_test
- cmake ../test/package/.
- make VERBOSE=1
- ctest --output-on-failure
- ldd ./test_hiprand
- $SUDO_CMD dpkg -r rocrand