forked from ROCm/rocThrust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
187 lines (174 loc) · 4.48 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# ########################################################################
# Copyright 2019-2022 Advanced Micro Devices, Inc.
# ########################################################################
include:
- project: 'amd/ci-templates'
ref: main
file:
- /defaults.yaml
- /deps-cmake.yaml
- /deps-docs.yaml
- /deps-rocm.yaml
- /gpus-rocm.yaml
- /rules.yaml
stages:
- build # Tests if builds succeed (CMake)
- test # Tests if unit tests are passing (CTest)
variables:
# Helper variables
PACKAGE_DIR: $BUILD_DIR/package
ROCPRIM_GIT_BRANCH: develop_stream
.cmake-latest:
extends:
- .deps:rocm
- .deps:cmake-latest
before_script:
- !reference [".deps:rocm", before_script]
- !reference [".deps:cmake-latest", before_script]
.cmake-minimum:
extends:
- .deps:rocm
- .deps:cmake-minimum
before_script:
- !reference [".deps:rocm", before_script]
- !reference [".deps:cmake-minimum", before_script]
.install-rocprim:
script:
- branch_name="$ROCPRIM_GIT_BRANCH"
- if [ $CI_COMMIT_BRANCH == develop ] || [ $CI_COMMIT_BRANCH == master ]; then branch_name=$CI_COMMIT_BRANCH;
- fi;
- git clone -b $branch_name https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCPRIM_GIT_URL} $CI_PROJECT_DIR/rocPRIM
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=OFF
-D BUILD_EXAMPLE=OFF
-D ROCM_DEP_ROCMCORE=OFF
-S $CI_PROJECT_DIR/rocPRIM
-B $CI_PROJECT_DIR/rocPRIM/build
- cd $CI_PROJECT_DIR/rocPRIM/build
- cpack
-G "DEB"
- $SUDO_CMD dpkg -i rocprim*.deb
.build:common:
stage: build
extends:
- .gpus:rocm-gpus
- .rules:build
tags:
- rocm-build
script:
- !reference [.install-rocprim, script]
# Setup env vars for testing
- rng_seed_count=0; prng_seeds="0";
- if [ $CI_COMMIT_BRANCH == develop_stream ] ; then rng_seed_count=3; prng_seeds="0 1000";
- fi;
# Build rocThrust
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=ON
-D BUILD_EXAMPLES=ON
-D BUILD_BENCHMARKS=ON
-D AMDGPU_TARGETS=$GPU_TARGETS
-D AMDGPU_TEST_TARGETS=$GPU_TARGETS
-D RNG_SEED_COUNT=$rng_seed_count
-D PRNG_SEEDS=$prng_seeds
-S $CI_PROJECT_DIR
-B $CI_PROJECT_DIR/build
- cmake --build $CI_PROJECT_DIR/build
artifacts:
paths:
- $CI_PROJECT_DIR/build/test/*
- $CI_PROJECT_DIR/build/testing/*
- $CI_PROJECT_DIR/build/deps/*
- $CI_PROJECT_DIR/build/CMakeCache.txt
- $CI_PROJECT_DIR/build/CTestTestfile.cmake
- $CI_PROJECT_DIR/build/.ninja_log
exclude:
- $CI_PROJECT_DIR/build/**/*.o
expire_in: 2 weeks
build:cmake-latest:
stage: build
extends:
- .cmake-latest
- .build:common
build:cmake-minimum:
stage: build
extends:
- .cmake-minimum
- .build:common
build:package:
stage: build
extends:
- .cmake-minimum
- .rules:build
tags:
- rocm-build
script:
- !reference [.install-rocprim, script]
- cmake
-S $CI_PROJECT_DIR
-B $PACKAGE_DIR
-G Ninja
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_COMPILER=hipcc
- cd $PACKAGE_DIR
- cpack
-G "DEB;ZIP"
artifacts:
paths:
- $PACKAGE_DIR/rocthrust*.deb
- $PACKAGE_DIR/rocthrust*.zip
expire_in: 2 weeks
test:package:
stage: test
needs:
- build:package
extends:
- .cmake-minimum
- .rules:test
tags:
- rocm-build
script:
- !reference [.install-rocprim, script]
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocthrust*.deb
# Test install
- cmake
-S $CI_PROJECT_DIR/extra
-B $CI_PROJECT_DIR/package_test
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D ROCPRIM_ROOT=/opt/rocm/rocprim
- cmake --build $CI_PROJECT_DIR/package_test
# Remove rocPRIM and rocThrust
- $SUDO_CMD dpkg -r rocthrust-dev
- $SUDO_CMD dpkg -r rocprim-dev
test:doc:
stage: test
extends:
- .build:docs
- .rules:test
test:
stage: test
extends:
- .cmake-minimum
- .rules:test
- .gpus:rocm
needs:
- build:cmake-minimum
script:
- cd $CI_PROJECT_DIR/build
- cmake
-D CMAKE_PREFIX_PATH=/opt/rocm
-P $CI_PROJECT_DIR/cmake/GenerateResourceSpec.cmake
- cat ./resources.json
- ctest
--output-on-failure
--repeat-until-fail 2
--tests-regex $GPU_TARGET
--resource-spec-file ./resources.json
--parallel $PARALLEL_JOBS