From 262fbfafa522836b0ac4c8ac9569ddf368d9acaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Wed, 26 Oct 2022 23:05:44 +0200 Subject: [PATCH 1/2] Fix issues revealed by recent compilers Fix Clang-tidy 14 diagnostic. Decrease sensitivity of NpT statistical test that fails on KU Leuven HPC. --- src/script_interface/analysis/ObservableStat.cpp | 5 ++--- testsuite/python/integrator_npt_stats.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/script_interface/analysis/ObservableStat.cpp b/src/script_interface/analysis/ObservableStat.cpp index 4d7538a54ec..ea130d3d53d 100644 --- a/src/script_interface/analysis/ObservableStat.cpp +++ b/src/script_interface/analysis/ObservableStat.cpp @@ -44,9 +44,8 @@ namespace Analysis { static auto get_summary(Observable_stat const &obs, bool const calc_sp) { auto const obs_dim = obs.get_chunk_size(); - auto const get_obs_contribs = - [obs_dim, - calc_sp](Utils::Span const views) -> std::vector { + auto const get_obs_contribs = [obs_dim, + calc_sp](Utils::Span const views) { if (obs_dim == 1) { return std::vector(views.begin(), views.end()); } diff --git a/testsuite/python/integrator_npt_stats.py b/testsuite/python/integrator_npt_stats.py index 6a098d1d8b5..58b209f6400 100644 --- a/testsuite/python/integrator_npt_stats.py +++ b/testsuite/python/integrator_npt_stats.py @@ -70,7 +70,7 @@ def test_compressibility(self): compressibility = np.var(Vs) / np.average(Vs) self.assertAlmostEqual(avp, p_ext, delta=0.02) - self.assertAlmostEqual(compressibility, 0.32, delta=0.02) + self.assertAlmostEqual(compressibility, 0.32, delta=0.025) if __name__ == "__main__": From 7ecc44ec2bbfe736a6cccb03eddcdb47ab4a0a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Thu, 27 Oct 2022 20:26:12 +0200 Subject: [PATCH 2/2] CMake: Fix Clang 14 version checks Fine tune Clang compiler support table for common CUDA versions and GPU architectures. Remove unsupported AppleClang compiler flag. --- cmake/FindCUDACompilerClang.cmake | 11 ++++++++--- src/python/espressomd/CMakeLists.txt | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/FindCUDACompilerClang.cmake b/cmake/FindCUDACompilerClang.cmake index e67853375ce..46d26e2931f 100644 --- a/cmake/FindCUDACompilerClang.cmake +++ b/cmake/FindCUDACompilerClang.cmake @@ -93,9 +93,14 @@ target_compile_options( $<$:-O2 -g -DNDEBUG> $<$:-O3 -g> $<$:-O3 -g> - $<$:--cuda-gpu-arch=sm_52> # GTX-900 series (Maxwell) - $<$:--cuda-gpu-arch=sm_61> # GTX-1000 series (Pascal) - $<$:--cuda-gpu-arch=sm_75> # RTX-2000 series (Turing) + # GTX-900 series (Maxwell) + $<$:--cuda-gpu-arch=sm_52> + # GTX-1000 series (Pascal) + $<$:--cuda-gpu-arch=sm_61> + # RTX-2000 series (Turing) + # With Clang 14+, architectures sm_70+ are only supported with Thrust 1.11+ + # from CUDA 11.3+, for details see https://github.com/NVIDIA/cub/pull/170 + $<$,$,$>>:--cuda-gpu-arch=sm_75> ) function(add_gpu_library) diff --git a/src/python/espressomd/CMakeLists.txt b/src/python/espressomd/CMakeLists.txt index 382c4735574..aa72f42ae72 100644 --- a/src/python/espressomd/CMakeLists.txt +++ b/src/python/espressomd/CMakeLists.txt @@ -62,7 +62,6 @@ target_compile_options( $<$:-Wno-sometimes-uninitialized> $<$:-Wno-\#warnings> $<$,$,14.0.0>>:-Wno-c++17-attribute-extensions> - $<$,$,14.0.0>>:-Wno-c++17-attribute-extensions> $<$:-Wno-c++17-attribute-extensions> -Wno-unused-variable)