Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable clang-tidy checks on CSCS CI clang pipelines #1345

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitlab/docker/Dockerfile.spack_build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ COPY . ${SOURCE_DIR}
RUN spack -e pika_ci spec -lI $spack_spec

# Configure & Build
# Make sure clang-tidy etc. binaries are in PATH when using clang.
ARG COMPILER
RUN spack -e pika_ci config add "config:flags:keep_werror:all" && \
if [[ $COMPILER =~ clang ]]; then \
export PATH="$(spack location --install-dir llvm)/bin:$PATH"; \
fi && \
spack -e pika_ci build-env $spack_spec -- \
bash -c " \
cmake -B${BUILD_DIR} ${SOURCE_DIR} -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_COMMON_FLAGS $CMAKE_FLAGS && \
Expand All @@ -34,7 +39,6 @@ ARG CI_COMMIT_SHA
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_TIMESTAMP
ARG CI_COMMIT_TITLE
ARG COMPILER
ARG CSCS_LOGSTASH_URL
ARG SPACK_COMMIT
ARG SPACK_SPEC
Expand All @@ -43,6 +47,9 @@ RUN CTEST_XML=$PWD/ctest.xml; \
"${SOURCE_DIR}/.gitlab/scripts/collect_ctest_metrics.sh ${CTEST_XML}; \
${SOURCE_DIR}/.gitlab/scripts/collect_file_sizes.sh ${BUILD_DIR}" \
EXIT; \
if [[ $COMPILER =~ clang ]]; then \
export PATH="$(spack location --install-dir llvm)/bin:$PATH"; \
fi && \
spack -e pika_ci build-env $spack_spec -- \
bash -c "ctest \
--output-junit ${CTEST_XML} \
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/includes/clang14_cuda11_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include:
SPACK_SPEC: "pika@main arch=$SPACK_ARCH %${COMPILER} +cuda cuda_arch=${GPU_TARGET} malloc=system
cxxstd=$CXXSTD +valgrind ^[email protected] ^[email protected] +allow-unsupported-compilers ^[email protected] ^valgrind ~mpi"
# PIKA_WITH_CXX_LAMBDA_CAPTURE_DECLTYPE is OFF to test the fallback implementation of PIKA_FORWARD.
CMAKE_FLAGS: "-DPIKA_WITH_CXX_STANDARD=20 -DPIKA_WITH_CUDA=ON -DPIKA_WITH_MALLOC=system \
CMAKE_FLAGS: "-DCMAKE_CXX_CLANG_TIDY=clang-tidy -DPIKA_WITH_CXX_STANDARD=20 -DPIKA_WITH_CUDA=ON -DPIKA_WITH_MALLOC=system \
-DPIKA_WITH_SPINLOCK_DEADLOCK_DETECTION=ON -DCMAKE_CUDA_COMPILER=c++ \
-DCMAKE_CUDA_ARCHITECTURES=${GPU_TARGET} \
-DPIKA_WITH_CXX_LAMBDA_CAPTURE_DECLTYPE=OFF \
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/includes/clang19_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include:
^fmt cxxflags=-stdlib=libc++ cxxflags=-DLIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG \
^spdlog cxxflags=-stdlib=libc++ cxxflags=-DLIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG \
^[email protected]"
CMAKE_FLAGS: "-DPIKA_WITH_CXX_STANDARD=$CXXSTD \
CMAKE_FLAGS: "-DCMAKE_CXX_CLANG_TIDY=clang-tidy -DPIKA_WITH_CXX_STANDARD=$CXXSTD \
-DCMAKE_CXX_FLAGS='-stdlib=libc++ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG' \
-DPIKA_WITH_MALLOC=system -DPIKA_WITH_SPINLOCK_DEADLOCK_DETECTION=ON \
-DPIKA_WITH_STDEXEC=ON"
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/async_cuda/tests/unit/cublas_matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ int pika_main(pika::program_options::variables_map& vm)
sizeMult = (std::min)(sizeMult, std::size_t(100));
sizeMult = (std::max)(sizeMult, std::size_t(1));
//
int block_size = 32;
std::size_t block_size = 32;

sMatrixSize matrix_size;
matrix_size.uiWA = 2 * block_size * sizeMult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace pika::cuda::experimental {
int device;
pika::execution::thread_priority priority;
unsigned int flags;
whip::stream_t stream = 0;
whip::stream_t stream{};

struct priorities
{
Expand Down