Skip to content

Commit

Permalink
Merge pull request #363 from samjwu/ci-threads
Browse files Browse the repository at this point in the history
Set number of compile threads to lesser of nproc or 12
  • Loading branch information
cgmillette authored Mar 22, 2024
2 parents b609920 + b3ec056 commit d53a52c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def runCompileCommand(platform, project, jobName, boolean debug=false)
String compilerLauncher = project.defaults.ccache ? '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache' : ''
String cmakeArgs = "-DCMAKE_C_COMPILER=/opt/rocm/bin/hipcc -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc ${compilerLauncher} ${buildTypeArg} ${amdgpuTargets}"
String hipccCompileFlags = "export HIPCC_COMPILE_FLAGS_APPEND='-O3 -Wno-format-nonliteral -parallel-jobs=1'"
// Set number of compile threads to lesser of nproc or 12
int nproc = Runtime.runtime.availableProcessors()
int numThreads = Math.min(nproc, 12)

def command = """#!/usr/bin/env bash
set -x
Expand All @@ -31,7 +34,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false)
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
${auxiliary.gfxTargetParser()}
${cmake} ${cmakeArgs} -DROCWMMA_BUILD_BENCHMARK_TESTS=OFF ../..
make -j\$(nproc)
make -j ${numThreads}
"""

platform.runCommand(this, command)
Expand Down Expand Up @@ -62,4 +65,3 @@ def runPackageCommand(platform, project)
}

return this

0 comments on commit d53a52c

Please sign in to comment.