This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
77 lines (73 loc) · 2.09 KB
/
Jenkinsfile
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
def rocmtestnode(variant, name, dockerfile, body) {
def image = "miopengemm-${dockerfile}"
def cmake_build = { compiler, flags ->
def cmd = """
rm -rf build
mkdir build
cd build
CXX=${compiler} CXXFLAGS='-Werror' cmake ${flags} ..
CTEST_PARALLEL_LEVEL=4 dumb-init make -j32 check
"""
echo cmd
sh cmd
}
node(name) {
stage("checkout ${variant}") {
checkout scm
}
def docker_path = "docker/${dockerfile}.docker";
stage("image ${variant}") {
try {
docker.build("${image}", ". -f ${docker_path}")
} catch(Exception ex) {
docker.build("${image}", "--no-cache . -f ${docker_path}")
}
}
withDockerContainer(image: image, args: '--device=/dev/kfd --device=/dev/dri --group-add video') {
timeout(time: 1, unit: 'HOURS') {
body(cmake_build)
}
}
}
}
@NonCPS
def rocmtest(m) {
def builders = [:]
for(e in m) {
def label = e.key;
def action = e.value;
builders[label] = {
action(label)
}
}
parallel builders
}
@NonCPS
def rocmnode(name, image, body) {
def node_name = 'rocmtest || rocm'
if(name == 'fiji') {
node_name = 'rocmtest && fiji';
} else if(name == 'vega') {
node_name = 'rocmtest && vega';
} else {
node_name = name
}
return { label ->
rocmtestnode(label, node_name, image, body)
}
}
rocmtest clang: rocmnode('vega', 'ubuntu') { cmake_build ->
stage('Clang Debug') {
cmake_build('clang++-3.8', '-DBUILD_DEV=On -DCMAKE_BUILD_TYPE=debug')
}
stage('Clang Release') {
cmake_build('clang++-3.8', '-DBUILD_DEV=On -DCMAKE_BUILD_TYPE=release')
}
}, gcc: rocmnode('vega', 'ubuntu') { cmake_build ->
stage('GCC Debug') {
cmake_build('g++-5', '-DBUILD_DEV=On -DCMAKE_BUILD_TYPE=debug')
}
stage('GCC Release') {
cmake_build('g++-5', '-DBUILD_DEV=On -DCMAKE_BUILD_TYPE=release')
}
}