forked from ROCm/rocThrust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
114 lines (106 loc) · 3.16 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
# ########################################################################
# Copyright 2019 Advanced Micro Devices, Inc.
# ########################################################################
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
- echo -e "machine projects.streamhpc.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
build:rocm:
stage: build
tags:
- rocm
variables:
SUDO_CMD: "sudo -E"
script:
- mkdir build
- cd build
- CXX=hipcc cmake -DBUILD_TEST=ON ../.
- make -j $(nproc)
- make package
artifacts:
paths:
- build/thrust/
- build/test/test_*
- build/test/CTestTestfile.cmake
- build/testing/test_thrust_*
- build/testing/CTestTestfile.cmake
- build/gtest/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/rocthrust*.deb
- build/rocthrust*.zip
expire_in: 2 weeks
.test:
stage: test
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1
include: '.gitlab-ci-gputest.yml'
test:rocm_package:
stage: test
tags:
- rocm
variables:
SUDO_CMD: "sudo -E"
dependencies:
- build:rocm
script:
# Install rocPRIM package
- echo ${ROCPRIM_GIT_URL}
- echo $ROCPRIM_GIT_URL
- git clone -b develop_stream https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCPRIM_GIT_URL}
- cd rocPRIM
- mkdir build
- cd build
- CXX=hipcc cmake -DBUILD_TEST=OFF ../.
- make package
- $SUDO_CMD dpkg -i rocprim-*.deb
- cd ../..
# rocThrust
- cd build
- $SUDO_CMD dpkg -i rocthrust-*.deb
- mkdir ../package_test && cd ../package_test
- CXX=hipcc cmake ../extra/. -Drocprim_DIR="/opt/rocm/rocprim"
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1
- $SUDO_CMD dpkg -r rocthrust
- $SUDO_CMD dpkg -r rocprim
test:rocm_install:
stage: test
tags:
- rocm
variables:
SUDO_CMD: "sudo -E"
dependencies: []
script:
- mkdir build_only_install
- cd build_only_install
- CXX=hipcc cmake -DBUILD_TEST=OFF ../.
- $SUDO_CMD make install
- mkdir ../install_test && cd ../install_test
- CXX=hipcc cmake ../extra/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1