forked from ROCm/rocPRIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
125 lines (117 loc) · 3.76 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
117
118
119
120
121
122
123
124
125
# MIT License
#
# Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
image: rocm/rocm-terminal:latest
variables:
SUDO_CMD: "" # Must be "sudo" on images which don't use root user
DEPS_DIR: "$CI_PROJECT_DIR/__dependencies"
CMAKE_URL: "https://cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
# General build flags
CXXFLAGS: ""
CMAKE_OPTIONS: ""
# Local build options
LOCAL_CXXFLAGS: ""
LOCAL_CMAKE_OPTIONS: ""
before_script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq libnuma-dev libunwind-dev git wget tar xz-utils bzip2 build-essential pkg-config ca-certificates
- hipconfig
# 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
- CXX=hcc cmake -DBUILD_TEST=ON -DBUILD_EXAMPLE=ON -DBUILD_BENCHMARK=ON ../.
- make -j16
- make package
artifacts:
paths:
- build/library/
- build/test/test_*
- build/test/rocprim/test_*
- build/test/hipcub/test_*
- build/test/CTestTestfile.cmake
- build/test/rocprim/CTestTestfile.cmake
- build/test/hipcub/CTestTestfile.cmake
- build/gtest/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/rocprim*.deb
- build/rocprim*.zip
expire_in: 2 weeks
test:rocm243:
tags:
- tag243
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
test:rocm244:
tags:
- tag244
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
test:rocm_package:
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD dpkg -i rocprim-*.deb
- mkdir ../package_test && cd ../package_test
- CXX=hcc cmake ../test/extra/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
- $SUDO_CMD dpkg -r rocprim
test:rocm_install:
stage: test
variables:
SUDO_CMD: "sudo -E"
script:
- mkdir build_only_install
- cd build_only_install
- CXX=hcc cmake -DONLY_INSTALL=ON ../.
- $SUDO_CMD make install
- mkdir ../install_test && cd ../install_test
- CXX=hcc cmake ../test/extra/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2