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

Add support for modern Clang compilers #4601

Merged
merged 2 commits into from
Oct 28, 2022
Merged
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
11 changes: 8 additions & 3 deletions cmake/FindCUDACompilerClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ target_compile_options(
$<$<STREQUAL:${CMAKE_BUILD_TYPE},RelWithDebInfo>:-O2 -g -DNDEBUG>
$<$<STREQUAL:${CMAKE_BUILD_TYPE},Coverage>:-O3 -g>
$<$<STREQUAL:${CMAKE_BUILD_TYPE},RelWithAssert>:-O3 -g>
$<$<VERSION_LESS:${CMAKE_CUDA_COMPILER_VERSION},12>:--cuda-gpu-arch=sm_52> # GTX-900 series (Maxwell)
$<$<VERSION_GREATER_EQUAL:${CMAKE_CUDA_COMPILER_VERSION},12>:--cuda-gpu-arch=sm_61> # GTX-1000 series (Pascal)
$<$<VERSION_GREATER_EQUAL:${CMAKE_CUDA_COMPILER_VERSION},12>:--cuda-gpu-arch=sm_75> # RTX-2000 series (Turing)
# GTX-900 series (Maxwell)
$<$<VERSION_LESS:${CMAKE_CUDA_COMPILER_VERSION},12>:--cuda-gpu-arch=sm_52>
# GTX-1000 series (Pascal)
$<$<VERSION_GREATER_EQUAL:${CMAKE_CUDA_COMPILER_VERSION},10>:--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
$<$<AND:$<VERSION_GREATER_EQUAL:${CMAKE_CUDA_COMPILER_VERSION},10>,$<OR:$<VERSION_LESS:${CMAKE_CUDA_COMPILER_VERSION},14>,$<VERSION_GREATER_EQUAL:${CUDA_VERSION},11.3.0>>>:--cuda-gpu-arch=sm_75>
)

function(add_gpu_library)
Expand Down
1 change: 0 additions & 1 deletion src/python/espressomd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ target_compile_options(
$<$<CXX_COMPILER_ID:Clang,AppleClang,IntelLLVM>:-Wno-sometimes-uninitialized>
$<$<CXX_COMPILER_ID:Clang,AppleClang,IntelLLVM>:-Wno-\#warnings>
$<$<AND:$<CXX_COMPILER_ID:Clang>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,14.0.0>>:-Wno-c++17-attribute-extensions>
$<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,14.0.0>>:-Wno-c++17-attribute-extensions>
$<$<CXX_COMPILER_ID:IntelLLVM>:-Wno-c++17-attribute-extensions>
-Wno-unused-variable)

Expand Down
5 changes: 2 additions & 3 deletions src/script_interface/analysis/ObservableStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> const views) -> std::vector<Variant> {
auto const get_obs_contribs = [obs_dim,
calc_sp](Utils::Span<double> const views) {
if (obs_dim == 1) {
return std::vector<Variant>(views.begin(), views.end());
}
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/integrator_npt_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down