"test/gtest-1.11.0/googletest/samples/sample7_unittest.cc" did not exist on "db82302ed06af1c100aa7b626845b4f6cbf955b4"
Jenkinsfile 4.51 KB
Newer Older
Paul's avatar
Paul committed
1

2
3
4
5
6
7
8
9
// def rocmtestnode(variant, name, body, args, pre) {
def rocmtestnode(Map conf) {
    def variant = conf.get("variant")
    def name = conf.get("node")
    def body = conf.get("body")
    def docker_args = conf.get("docker_args", "")
    def docker_build_args = conf.get("docker_build_args", "")
    def pre = conf.get("pre", {})
Paul Fultz II's avatar
Paul Fultz II committed
10
    def ccache = "/var/jenkins/.cache/ccache"
Paul's avatar
Paul committed
11
    def image = 'migraphxlib'
Paul Fultz II's avatar
Paul Fultz II committed
12
13
    env.CCACHE_COMPRESSLEVEL = 7
    env.CCACHE_DIR = ccache
Paul's avatar
Paul committed
14
15
    def cmake_build = { compiler, flags ->
        def cmd = """
Paul's avatar
Paul committed
16
            env
Paul's avatar
Paul committed
17
            ulimit -c unlimited
Paul's avatar
Paul committed
18
19
20
            rm -rf build
            mkdir build
            cd build
Paul Fultz II's avatar
Paul Fultz II committed
21
22
            CXX=${compiler} CXXFLAGS='-Werror -Wno-fallback' cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ${flags} .. 
            CTEST_PARALLEL_LEVEL=32 make -j\$(nproc) generate all doc package check VERBOSE=1
Paul's avatar
Paul committed
23
24
25
        """
        echo cmd
        sh cmd
Paul Fultz II's avatar
Paul Fultz II committed
26
        if (compiler != "hcc") {
Paul's avatar
Paul committed
27
28
29
30
            // Only archive from master or develop
            if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME == "master") {
                archiveArtifacts artifacts: "build/*.deb", allowEmptyArchive: true, fingerprint: true
            }
Paul's avatar
Paul committed
31
        }
Paul's avatar
Paul committed
32
33
    }
    node(name) {
Paul's avatar
Paul committed
34
35
36
37
        withEnv(['HSA_ENABLE_SDMA=0', 'MIOPEN_DEBUG_GCN_ASM_KERNELS=0']) {
            stage("checkout ${variant}") {
                checkout scm
            }
38
            gitStatusWrapper(credentialsId: '7126e5fe-eb51-4576-b52b-9aaf1de8f0fd', gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') {
Paul's avatar
Paul committed
39
40
41
42
43
44
                pre()
                stage("image ${variant}") {
                    try {
                        docker.build("${image}", "${docker_build_args} .")
                    } catch(Exception ex) {
                        docker.build("${image}", "${docker_build_args} --no-cache .")
Paul's avatar
Paul committed
45

Paul's avatar
Paul committed
46
                    }
Paul's avatar
Paul committed
47
                }
Paul Fultz II's avatar
Paul Fultz II committed
48
                withDockerContainer(image: image, args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE -v=/var/jenkins/:/var/jenkins ${docker_args}") {
49
                    timeout(time: 2, unit: 'HOURS') {
Paul's avatar
Paul committed
50
51
                        body(cmake_build)
                    }
Paul's avatar
Paul committed
52
                }
Paul's avatar
Paul committed
53
54
55
56
57
58
            }
        }
    }
}
def rocmtest(m) {
    def builders = [:]
Paul Fultz II's avatar
Paul Fultz II committed
59
    m.each { e ->
Paul's avatar
Paul committed
60
61
62
63
64
65
66
67
68
        def label = e.key;
        def action = e.value;
        builders[label] = {
            action(label)
        }
    }
    parallel builders
}

69
def rocmnodename(name) {
Paul's avatar
Paul committed
70
71
72
73
74
75
    def rocmtest_name = "(rocmtest || migraphx)"
    def node_name = "${rocmtest_name}"
    if(name == "fiji") {
        node_name = "${rocmtest_name} && fiji";
    } else if(name == "vega") {
        node_name = "${rocmtest_name} && vega";
Paul's avatar
Paul committed
76
    }
77
    return node_name
Paul's avatar
Paul committed
78
79
}

Paul Fultz II's avatar
Paul Fultz II committed
80
def rocmnode(name, body) {
81
82
83
    return { label ->
        rocmtestnode(variant: label, node: rocmnodename(name), body: body)
    }
Paul Fultz II's avatar
Paul Fultz II committed
84
85
}

Paul Fultz II's avatar
Paul Fultz II committed
86
def rochccmnode(name, body) {
87
    return { label ->
Paul Fultz II's avatar
Paul Fultz II committed
88
        rocmtestnode(variant: label, node: rocmnodename(name), docker_build_args: '-f hcc.docker', body: body)
89
    }
Paul's avatar
Paul committed
90
91
}

Paul Fultz II's avatar
Paul Fultz II committed
92
93
94
95
96
97
rocmtest clang_debug: rocmnode('vega') { cmake_build ->
    stage('Hip Clang Debug') {
        // def sanitizers = "undefined"
        // def debug_flags = "-O2 -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}"
        def debug_flags = "-g -O2"
        cmake_build("/opt/rocm/llvm/bin/clang++", "-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}'")
Paul's avatar
Paul committed
98
    }
Paul's avatar
Paul committed
99
}, clang_release: rocmnode('vega') { cmake_build ->
100
101
    stage('Hip Clang Release') {
        cmake_build("/opt/rocm/llvm/bin/clang++", "-DCMAKE_BUILD_TYPE=release")
Paul Fultz II's avatar
Paul Fultz II committed
102
        stash includes: 'build/*.deb', name: 'migraphx-package'
Paul's avatar
Paul committed
103
    }
Paul Fultz II's avatar
Paul Fultz II committed
104
105
106
107
108
109
}, hcc_debug: rochccmnode('vega') { cmake_build ->
    stage('Hcc Debug') {
        // TODO: Enable integer
        def sanitizers = "undefined"
        def debug_flags = "-O2 -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}"
        cmake_build("/opt/rocm/bin/hcc", "-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}'")
Paul's avatar
Paul committed
110
    }
Paul's avatar
Paul committed
111
}
Paul Fultz II's avatar
Paul Fultz II committed
112

113
114
115
116
117
118
119
120
121
122
def onnxnode(name, body) {
    return { label ->
        rocmtestnode(variant: label, node: rocmnodename(name), docker_args: '-u root', body: body, pre: {
            sh 'rm -rf ./build/*.deb'
            unstash 'migraphx-package' 
        })
    }
}

rocmtest onnx: onnxnode('rocmtest') { cmake_build ->
Paul Fultz II's avatar
Paul Fultz II committed
123
124
125
126
127
128
129
130
    stage("Onnx runtime") {
        sh '''
            ls -lR
            dpkg -i --force-depends ./build/*.deb
            cd /onnxruntime && ./build_and_test_onnxrt.sh
        '''
    }
}