mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
Add cppcheck to CK CI. (#1125)
* add cppcheck to the CK CI
* fix the path to CK source for cppcheck
* fix the path to CK source for cppcheck one more time
* fix the path to CK source for cppcheck third time
* change the path to ck_cppcheck.log
* install latest cppcheck from source
* fix bug in ck.hpp and use 20 threads for cppcheck
* create a switch to turn cppckeck on and off in CI
[ROCm/composable_kernel commit: e6d099c830]
This commit is contained in:
@@ -74,7 +74,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#Install latest version of cmake
|
||||
#Install ninja build tracing tools
|
||||
RUN wget -qO /usr/local/bin/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
|
||||
RUN gunzip /usr/local/bin/ninja.gz
|
||||
RUN chmod a+x /usr/local/bin/ninja
|
||||
@@ -82,6 +82,11 @@ RUN git clone https://github.com/nico/ninjatracing.git
|
||||
# Update the cmake to the latest version
|
||||
RUN pip install --upgrade cmake==3.27.5
|
||||
|
||||
#Install latest cppcheck
|
||||
RUN git clone https://github.com/danmar/cppcheck.git && \
|
||||
cd cppcheck && mkdir build && cd build && cmake .. && cmake --build .
|
||||
WORKDIR /
|
||||
|
||||
# Setup ubsan environment to printstacktrace
|
||||
RUN ln -s /usr/bin/llvm-symbolizer-3.8 /usr/local/bin/llvm-symbolizer
|
||||
ENV UBSAN_OPTIONS=print_stacktrace=1
|
||||
|
||||
34
Jenkinsfile
vendored
34
Jenkinsfile
vendored
@@ -304,7 +304,7 @@ def buildHipClangJob(Map conf=[:]){
|
||||
|
||||
gitStatusWrapper(credentialsId: "${status_wrapper_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCm', repo: 'composable_kernel') {
|
||||
withDockerContainer(image: image, args: dockerOpts + ' -v=/var/jenkins/:/var/jenkins') {
|
||||
timeout(time: 5, unit: 'HOURS')
|
||||
timeout(time: 20, unit: 'HOURS')
|
||||
{
|
||||
cmake_build(conf)
|
||||
}
|
||||
@@ -709,6 +709,10 @@ pipeline {
|
||||
name: "USE_SCCACHE",
|
||||
defaultValue: true,
|
||||
description: "Use the sccache for building CK (default: ON)")
|
||||
booleanParam(
|
||||
name: "RUN_CPPCHECK",
|
||||
defaultValue: false,
|
||||
description: "Run the cppcheck static analysis (default: OFF)")
|
||||
}
|
||||
environment{
|
||||
dbuser = "${dbuser}"
|
||||
@@ -735,7 +739,35 @@ pipeline {
|
||||
}
|
||||
stage("Static checks") {
|
||||
parallel{
|
||||
stage('Clang Format and Cppcheck') {
|
||||
when {
|
||||
beforeAgent true
|
||||
expression { params.RUN_CPPCHECK.toBoolean() }
|
||||
}
|
||||
agent{ label rocmnode("nogpu") }
|
||||
environment{
|
||||
execute_cmd = "find .. -not -path \'*.git*\' -iname \'*.h\' \
|
||||
-o -not -path \'*.git*\' -iname \'*.hpp\' \
|
||||
-o -not -path \'*.git*\' -iname \'*.cpp\' \
|
||||
-o -iname \'*.h.in\' \
|
||||
-o -iname \'*.hpp.in\' \
|
||||
-o -iname \'*.cpp.in\' \
|
||||
-o -iname \'*.cl\' \
|
||||
| grep -v 'build/' \
|
||||
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-12 -style=file {} | diff - {}\' && \
|
||||
/cppcheck/build/bin/cppcheck ../* -v -j \$(nproc) -I ../include -I ../profiler/include -I ../library/include --file-filter=*.cpp --enable=all --output-file=ck_cppcheck.log"
|
||||
}
|
||||
steps{
|
||||
buildHipClangJobAndReboot(setup_cmd: "", build_cmd: "", execute_cmd: execute_cmd, no_reboot:true)
|
||||
archiveArtifacts "build/ck_cppcheck.log"
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
stage('Clang Format') {
|
||||
when {
|
||||
beforeAgent true
|
||||
expression { !params.RUN_CPPCHECK.toBoolean() }
|
||||
}
|
||||
agent{ label rocmnode("nogpu") }
|
||||
environment{
|
||||
execute_cmd = "find .. -not -path \'*.git*\' -iname \'*.h\' \
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
// denorm test fix, required to work around dissue
|
||||
#ifndef CK_WORKAROUND_DENORM_FIX
|
||||
#define CK_WORKAROUND_DENORM_FIX 0
|
||||
#elif
|
||||
#else
|
||||
// enable only on MI200
|
||||
#define CK_WORKAROUND_DENORM_FIX = CK_WORKAROUND_DENORM_FIX && defined(__gfx90a__)
|
||||
#endif // CK_WORKAROUND_DENORM_FIX
|
||||
|
||||
Reference in New Issue
Block a user