File: staticanalysis.groovy

package info (click to toggle)
rocfft 6.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,672 kB
  • sloc: cpp: 55,735; python: 5,774; sh: 428; xml: 204; makefile: 56
file content (92 lines) | stat: -rw-r--r-- 3,228 bytes parent folder | download
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
#!/usr/bin/env groovy
// This shared library is available at https://github.com/ROCmSoftwarePlatform/rocJENKINS/
@Library('rocJenkins@pong') _

// This is file for internal AMD use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.

import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path

def runCompileCommand(platform, project, jobName, boolean debug=false)
{
    project.paths.construct_build_prefix()

    def yapfCommand = """#!/usr/bin/env bash
                         set -x
                         cd ${project.paths.project_build_prefix}
                         yapf --version
                         find . -iname '*.py' \
                         | grep -v 'build/'  \
                         | xargs -n 1 -P 1 -I{} -t sh -c 'yapf --style pep8 {} | diff - {}'
                      """

    platform.runCommand(this, yapfCommand)
}

def runCI =
{
    nodeDetails, jobName->

    def prj  = new rocProject('rocFFT-internal', 'StaticAnalysis')
    prj.libraryDependencies = ['rocRAND','hipRAND']

    // Define test architectures, optional rocm version argument is available
    def nodes = new dockerNodes(nodeDetails, jobName, prj)

    boolean formatCheck = true
    boolean staticAnalysis = true

    def compileCommand =
    {
        platform, project->

        runCompileCommand(platform, project, jobName, false)
    }

    buildProject(prj , formatCheck, nodes.dockerArray, compileCommand, null, null, staticAnalysis)


    def kernelSubsetPrj  = new rocProject('rocFFT-internal', 'BuildKernelSubset')

    def nodesForPrj2 = new dockerNodes(nodeDetails, jobName, kernelSubsetPrj)

    def commonGroovy

    def compileSubsetCommand =
    {
        platform, project->

        commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"

        // build pattern pow2,pow7 no manual small and large, dp only
        commonGroovy.runSubsetBuildCommand(platform, project, jobName, 'pow2,pow7', null, null, true)

        // build large sizes, dp only
        commonGroovy.runSubsetBuildCommand(platform, project, jobName, 'large', null, null, true)

        // build 2D sizes, dp only
        commonGroovy.runSubsetBuildCommand(platform, project, jobName, '2D', null, null, true)

        // put an extra unsupported size(10) in manual large to see if it will be filtered correctly
        commonGroovy.runSubsetBuildCommand(platform, project, jobName, 'none', null, '10,50,100,200,336', true)

        // put an extra unsupported size(23) in manual small to see if it will be filtered correctly
        commonGroovy.runSubsetBuildCommand(platform, project, jobName, 'none', '23,1024', '10,50,100,200,336', true)

        // all the manual sizes are not supported
        //commonGroovy.runSubsetBuildCommand(platform, project, jobName, 'none', '23', '10', true)
    }

    buildProject(kernelSubsetPrj , formatCheck, nodesForPrj2.dockerArray, compileSubsetCommand, null, null)
}

ci: {
    String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

    properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * 6')])]))
    stage(urlJobName) {
        runCI([ubuntu20:['any']], urlJobName)
    }
}