From 0b33fff6b7fe9186b08907a0aba419889e1c31fe Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Mon, 23 Feb 2026 09:56:43 +0100 Subject: [PATCH 01/10] Fixes for newer Clang versions --- include/gridtools/common/hymap.hpp | 15 +++++++-------- .../frontend/cartesian/expressions/expr_pow.hpp | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/gridtools/common/hymap.hpp b/include/gridtools/common/hymap.hpp index 6c93c6f46..8265d84b7 100644 --- a/include/gridtools/common/hymap.hpp +++ b/include/gridtools/common/hymap.hpp @@ -198,7 +198,7 @@ namespace gridtools { template struct values; -#if !defined(__NVCC__) && defined(__clang__) && __clang_major__ <= 17 +#if !defined(__NVCC__) && defined(__clang__) template values(Vs const &...) -> values; #endif @@ -213,16 +213,18 @@ namespace gridtools { template template struct keys::values { +#if !defined(__clang__) || __clang_major__ < 18 static_assert(sizeof...(Vals) == sizeof...(Keys), "invalid hymap"); +#endif tuple m_vals; template ...>, int> = 0> + std::enable_if_t...>, + int> = 0> constexpr GT_FUNCTION values(Args &&...args) noexcept : m_vals{std::forward(args)...} {} - constexpr GT_FUNCTION values(Vals const &...args) noexcept : m_vals(args...) {} - constexpr GT_FUNCTION values(tuple &&args) noexcept : m_vals(std::move(args)) {} constexpr GT_FUNCTION values(tuple const &args) noexcept : m_vals(args) {} @@ -234,10 +236,7 @@ namespace gridtools { template constexpr GT_FUNCTION - std::enable_if_t<((!std::is_same_v> && is_hymap>::value) && - ... && - std::is_assignable_v>>>), + std::enable_if_t> && is_hymap>::value, values &> operator=(Src &&src) { (..., diff --git a/include/gridtools/stencil/frontend/cartesian/expressions/expr_pow.hpp b/include/gridtools/stencil/frontend/cartesian/expressions/expr_pow.hpp index 58365b188..0a5c9520c 100644 --- a/include/gridtools/stencil/frontend/cartesian/expressions/expr_pow.hpp +++ b/include/gridtools/stencil/frontend/cartesian/expressions/expr_pow.hpp @@ -21,7 +21,7 @@ namespace gridtools { struct pow_f { template GT_FUNCTION constexpr auto operator()(Arg const &arg) const { - return gt_pow::template apply(arg); + return gt_pow::apply(arg); } }; From 19656bb4cf2cd352d296b45a6c05848f4394c75a Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Mon, 23 Feb 2026 14:37:56 +0100 Subject: [PATCH 02/10] Compile all tests in GitHub CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4580c04c..62b4647a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: echo "OMP_NUM_THREADS=$(nproc)" >> $GITHUB_ENV - name: build run: | - python3 pyutils/driver.py -vv build -b ${{ matrix.build_type }} -o $(pwd)/build -i $(pwd)/install -t perftests + python3 pyutils/driver.py -vv build -b ${{ matrix.build_type }} -o $(pwd)/build -i $(pwd)/install - name: run tests # no GPUs available -> no tests (for nvhpc we could run cpu, but we currently don't expose that option in pyutils/driver.py) if: (!contains(matrix.compiler, 'cuda') && !contains(matrix.compiler, 'rocm') && !contains(matrix.compiler, 'nvhpc')) From eef76121d431013ac8fea08433ac70069f4d6023 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Mon, 23 Feb 2026 14:38:30 +0100 Subject: [PATCH 03/10] Reduce compiler coverage in GitHub CI --- .github/workflows/tests.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62b4647a4..b259ac94f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,23 +12,8 @@ jobs: container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }} strategy: matrix: - compiler: [gcc-8, gcc-9, gcc-10, gcc-11, gcc-12, gcc-13, clang-11, clang-12, clang-13, clang-14, clang-15, clang-16, clang-14-cuda-11, gcc-10-cuda-11.8, gcc-11-cuda-12.0, gcc-12-cuda-12.3, gcc-12-cuda-12.4, base-rocm-6.2.2, gcc-10-hpx, nvhpc-23.3, nvhpc-23.9] + compiler: [gcc-13, clang-16, clang-14-cuda-11, gcc-12-cuda-12.4, base-rocm-6.2.2, gcc-10-hpx, nvhpc-23.9] build_type: [debug, release] - exclude: - - compiler: gcc-8 - build_type: debug - - compiler: gcc-9 - build_type: debug - - compiler: gcc-10 - build_type: debug - - compiler: gcc-11 - build_type: debug - - compiler: clang-13 - build_type: debug - - compiler: clang-14 - build_type: debug - - compiler: gcc-10-hpx - build_type: debug steps: - uses: actions/checkout@v2 - name: setup environment From 83ac8a39b3b9876f014bb89a883a7beaeb4615b2 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Tue, 24 Feb 2026 08:58:31 +0100 Subject: [PATCH 04/10] Only check release builds --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b259ac94f..00e7a8ba7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: compiler: [gcc-13, clang-16, clang-14-cuda-11, gcc-12-cuda-12.4, base-rocm-6.2.2, gcc-10-hpx, nvhpc-23.9] - build_type: [debug, release] + build_type: [release] steps: - uses: actions/checkout@v2 - name: setup environment From c61cac5d47f2078cad86faa8447085d566928147 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Tue, 24 Feb 2026 08:59:43 +0100 Subject: [PATCH 05/10] Make operators_repository not crash NVCC --- tests/regression/icosahedral/curl.cpp | 16 +- tests/regression/icosahedral/div.cpp | 16 +- tests/regression/icosahedral/lap.cpp | 32 ++-- .../icosahedral/operators_repository.hpp | 151 ++++++++++-------- 4 files changed, 116 insertions(+), 99 deletions(-) diff --git a/tests/regression/icosahedral/curl.cpp b/tests/regression/icosahedral/curl.cpp index 002b774d7..48275c0e7 100644 --- a/tests/regression/icosahedral/curl.cpp +++ b/tests/regression/icosahedral/curl.cpp @@ -41,11 +41,11 @@ namespace { run(spec, stencil_backend_t(), TypeParam ::make_grid(), - TypeParam ::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal), - TypeParam ::icosahedral_make_storage(edges(), repo.dual_edge_length), - TypeParam ::icosahedral_make_storage(edges(), repo.u), + TypeParam ::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal()), + TypeParam ::icosahedral_make_storage(edges(), repo.dual_edge_length()), + TypeParam ::icosahedral_make_storage(edges(), repo.u()), out); - TypeParam::verify(repo.curl_u, out, eq); + TypeParam::verify(repo.curl_u(), out, eq); } GT_REGRESSION_TEST(curl_flow_convention, icosahedral_test_environment<2>, stencil_backend_t) { @@ -54,10 +54,10 @@ namespace { run_single_stage(curl_functor_flow_convention(), stencil_backend_t(), TypeParam ::make_grid(), - TypeParam ::icosahedral_make_storage(edges(), repo.u), - TypeParam ::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal), - TypeParam ::icosahedral_make_storage(edges(), repo.dual_edge_length), + TypeParam ::icosahedral_make_storage(edges(), repo.u()), + TypeParam ::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal()), + TypeParam ::icosahedral_make_storage(edges(), repo.dual_edge_length()), out); - TypeParam ::verify(repo.curl_u, out, eq); + TypeParam ::verify(repo.curl_u(), out, eq); } } // namespace diff --git a/tests/regression/icosahedral/div.cpp b/tests/regression/icosahedral/div.cpp index bad4c3333..57a36c2b6 100644 --- a/tests/regression/icosahedral/div.cpp +++ b/tests/regression/icosahedral/div.cpp @@ -34,11 +34,11 @@ namespace { run(spec, stencil_backend_t(), TypeParam ::make_grid(), - TypeParam ::icosahedral_make_storage(edges(), repo.u), - TypeParam ::icosahedral_make_storage(edges(), repo.edge_length), - TypeParam ::icosahedral_make_storage(cells(), repo.cell_area_reciprocal), + TypeParam ::icosahedral_make_storage(edges(), repo.u()), + TypeParam ::icosahedral_make_storage(edges(), repo.edge_length()), + TypeParam ::icosahedral_make_storage(cells(), repo.cell_area_reciprocal()), out); - TypeParam ::verify(repo.div_u, out); + TypeParam ::verify(repo.div_u(), out); } GT_REGRESSION_TEST(div_flow_convention, icosahedral_test_environment<2>, stencil_backend_t) { @@ -47,10 +47,10 @@ namespace { run_single_stage(div_functor_flow_convention_connectivity(), stencil_backend_t(), TypeParam::make_grid(), - TypeParam ::icosahedral_make_storage(edges(), repo.u), - TypeParam ::icosahedral_make_storage(edges(), repo.edge_length), - TypeParam ::icosahedral_make_storage(cells(), repo.cell_area_reciprocal), + TypeParam ::icosahedral_make_storage(edges(), repo.u()), + TypeParam ::icosahedral_make_storage(edges(), repo.edge_length()), + TypeParam ::icosahedral_make_storage(cells(), repo.cell_area_reciprocal()), out); - TypeParam ::verify(repo.div_u, out); + TypeParam ::verify(repo.div_u(), out); } } // namespace diff --git a/tests/regression/icosahedral/lap.cpp b/tests/regression/icosahedral/lap.cpp index b953c24a6..4e078c692 100644 --- a/tests/regression/icosahedral/lap.cpp +++ b/tests/regression/icosahedral/lap.cpp @@ -81,15 +81,15 @@ namespace { run(spec, stencil_backend_t(), TypeParam::make_grid(), - TypeParam::icosahedral_make_storage(edges(), repo.edge_length), - TypeParam::icosahedral_make_storage(cells(), repo.cell_area_reciprocal), - TypeParam::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal), - TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length), - TypeParam::icosahedral_make_storage(edges(), repo.u), - TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length_reciprocal), - TypeParam::icosahedral_make_storage(edges(), repo.edge_length_reciprocal), + TypeParam::icosahedral_make_storage(edges(), repo.edge_length()), + TypeParam::icosahedral_make_storage(cells(), repo.cell_area_reciprocal()), + TypeParam::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal()), + TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length()), + TypeParam::icosahedral_make_storage(edges(), repo.u()), + TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length_reciprocal()), + TypeParam::icosahedral_make_storage(edges(), repo.edge_length_reciprocal()), out); - TypeParam::verify(TypeParam::icosahedral_make_storage(edges(), repo.lap), out); + TypeParam::verify(TypeParam::icosahedral_make_storage(edges(), repo.lap()), out); } GT_REGRESSION_TEST(lap_flow_convention, icosahedral_test_environment<2>, stencil_backend_t) { @@ -125,14 +125,14 @@ namespace { run(spec, stencil_backend_t(), TypeParam::make_grid(), - TypeParam::icosahedral_make_storage(edges(), repo.u), - TypeParam::icosahedral_make_storage(edges(), repo.edge_length), - TypeParam::icosahedral_make_storage(cells(), repo.cell_area_reciprocal), - TypeParam::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal), - TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length), - TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length_reciprocal), - TypeParam::icosahedral_make_storage(edges(), repo.edge_length_reciprocal), + TypeParam::icosahedral_make_storage(edges(), repo.u()), + TypeParam::icosahedral_make_storage(edges(), repo.edge_length()), + TypeParam::icosahedral_make_storage(cells(), repo.cell_area_reciprocal()), + TypeParam::icosahedral_make_storage(vertices(), repo.dual_area_reciprocal()), + TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length()), + TypeParam::icosahedral_make_storage(edges(), repo.dual_edge_length_reciprocal()), + TypeParam::icosahedral_make_storage(edges(), repo.edge_length_reciprocal()), out); - TypeParam::verify(TypeParam::icosahedral_make_storage(edges(), repo.lap), out); + TypeParam::verify(TypeParam::icosahedral_make_storage(edges(), repo.lap()), out); } } // namespace diff --git a/tests/regression/icosahedral/operators_repository.hpp b/tests/regression/icosahedral/operators_repository.hpp index 300b5b326..3ef49e57c 100644 --- a/tests/regression/icosahedral/operators_repository.hpp +++ b/tests/regression/icosahedral/operators_repository.hpp @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -24,8 +23,6 @@ class operators_repository { using edges = gridtools::stencil::icosahedral::edges; using vertices = gridtools::stencil::icosahedral::vertices; - using fun_t = std::function; - size_t m_d1, m_d2; const double PI = std::atan(1) * 4; @@ -38,70 +35,90 @@ class operators_repository { double y(int j) const { return j * 1. / m_d2; } public: - fun_t u = [this](int i, int j, int k, int c) { - auto t = PI * (x(i, c) + 1.5 * y(j)); - return k + 2 * (2 + cos(t) + sin(2 * t)); - }; - - fun_t edge_length = [this](int i, int j, int, int c) { - auto t = PI * (x(i, c) + 1.5 * y(j)); - return 2.95 + (2 + cos(t) + sin(2 * t)) / 4; - }; - - fun_t edge_length_reciprocal = [this](int i, int j, int k, int c) { return 1 / edge_length(i, j, k, c); }; - - fun_t cell_area_reciprocal = [this](int i, int j, int, int c) { - auto xx = x(i, c); - auto yy = y(j); - return 1 / (2.53 + (2 + cos(PI * (1.5 * xx + 2.5 * yy)) + sin(2 * PI * (xx + 1.5 * yy))) / 4); - }; - - fun_t dual_area_reciprocal = [this](int i, int j, int, int c) { - auto xx = x(i, c); - auto yy = y(j); - return 1 / (1.1 + (2 + cos(PI * (1.5 * xx + yy)) + sin(1.5 * PI * (xx + 1.5 * yy))) / 4); - }; - - fun_t dual_edge_length = [this](int i, int j, int, int c) { - auto xx = x(i, c); - auto yy = y(j); - return 2.2 + (2 + cos(PI * (xx + 2.5 * yy)) + sin(2 * PI * (xx + 3.5 * yy))) / 4; - }; - - fun_t dual_edge_length_reciprocal = [this](int i, int j, int k, int c) { return 1 / dual_edge_length(i, j, k, c); }; - - fun_t div_u = [this](int i, int j, int k, int c) { - double res = 0; - int e = 0; - for (auto &&neighbour : gridtools::neighbours_of(i, j, k, c)) { - res += (c == 0 ? 1 : -1) * neighbour.call(u) * neighbour.call(edge_length); - ++e; - } - return res * cell_area_reciprocal(i, j, k, c); - }; - - fun_t curl_u = [this](int i, int j, int k, int c) { - double res = 0; - int e = 0; - for (auto &&neighbour : gridtools::neighbours_of(i, j, k, c)) { - res += (e % 2 ? 1 : -1) * neighbour.call(u) * neighbour.call(dual_edge_length); - ++e; - } - return res * dual_area_reciprocal(i, j, k, c); - }; - - fun_t lap = [this](int i, int j, int k, int c) { - auto neighbours_ec = gridtools::neighbours_of(i, j, k, c); - assert(neighbours_ec.size() == 2); - auto grad_n = - (neighbours_ec[1].call(div_u) - neighbours_ec[0].call(div_u)) * dual_edge_length_reciprocal(i, j, k, c); - - auto neighbours_vc = gridtools::neighbours_of(i, j, k, c); - assert(neighbours_vc.size() == 2); - auto grad_tau = - (neighbours_vc[1].call(curl_u) - neighbours_vc[0].call(curl_u)) * edge_length_reciprocal(i, j, k, c); - return grad_n - grad_tau; - }; + auto u() const { + return [this](int i, int j, int k, int c) { + auto t = PI * (x(i, c) + 1.5 * y(j)); + return k + 2 * (2 + cos(t) + sin(2 * t)); + }; + } + + auto edge_length() const { + return [this](int i, int j, int, int c) { + auto t = PI * (x(i, c) + 1.5 * y(j)); + return 2.95 + (2 + cos(t) + sin(2 * t)) / 4; + }; + } + + auto edge_length_reciprocal() const { + return [this](int i, int j, int k, int c) { return 1 / edge_length()(i, j, k, c); }; + } + + auto cell_area_reciprocal() const { + return [this](int i, int j, int, int c) { + auto xx = x(i, c); + auto yy = y(j); + return 1 / (2.53 + (2 + cos(PI * (1.5 * xx + 2.5 * yy)) + sin(2 * PI * (xx + 1.5 * yy))) / 4); + }; + } + + auto dual_area_reciprocal() const { + return [this](int i, int j, int, int c) { + auto xx = x(i, c); + auto yy = y(j); + return 1 / (1.1 + (2 + cos(PI * (1.5 * xx + yy)) + sin(1.5 * PI * (xx + 1.5 * yy))) / 4); + }; + } + + auto dual_edge_length() const { + return [this](int i, int j, int, int c) { + auto xx = x(i, c); + auto yy = y(j); + return 2.2 + (2 + cos(PI * (xx + 2.5 * yy)) + sin(2 * PI * (xx + 3.5 * yy))) / 4; + }; + } + + auto dual_edge_length_reciprocal() const { + return [this](int i, int j, int k, int c) { return 1 / dual_edge_length()(i, j, k, c); }; + } + + auto div_u() const { + return [this](int i, int j, int k, int c) { + double res = 0; + int e = 0; + for (auto &&neighbour : gridtools::neighbours_of(i, j, k, c)) { + res += (c == 0 ? 1 : -1) * neighbour.call(u()) * neighbour.call(edge_length()); + ++e; + } + return res * cell_area_reciprocal()(i, j, k, c); + }; + } + + auto curl_u() const { + return [this](int i, int j, int k, int c) { + double res = 0; + int e = 0; + for (auto &&neighbour : gridtools::neighbours_of(i, j, k, c)) { + res += (e % 2 ? 1 : -1) * neighbour.call(u()) * neighbour.call(dual_edge_length()); + ++e; + } + return res * dual_area_reciprocal()(i, j, k, c); + }; + } + + auto lap() const { + return [this](int i, int j, int k, int c) { + auto neighbours_ec = gridtools::neighbours_of(i, j, k, c); + assert(neighbours_ec.size() == 2); + auto grad_n = (neighbours_ec[1].call(div_u()) - neighbours_ec[0].call(div_u())) * + dual_edge_length_reciprocal()(i, j, k, c); + + auto neighbours_vc = gridtools::neighbours_of(i, j, k, c); + assert(neighbours_vc.size() == 2); + auto grad_tau = (neighbours_vc[1].call(curl_u()) - neighbours_vc[0].call(curl_u())) * + edge_length_reciprocal()(i, j, k, c); + return grad_n - grad_tau; + }; + } operators_repository(size_t d1, size_t d2) : m_d1(d1), m_d2(d2) {} }; From 17d38ea4b8d18b689d977fa71ffd2ee475a93c7f Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Tue, 24 Feb 2026 09:00:07 +0100 Subject: [PATCH 06/10] Guard some int_vec tests from NVCC --- tests/unit_tests/common/test_int_vector.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit_tests/common/test_int_vector.cpp b/tests/unit_tests/common/test_int_vector.cpp index 63d560886..93a0dcc05 100644 --- a/tests/unit_tests/common/test_int_vector.cpp +++ b/tests/unit_tests/common/test_int_vector.cpp @@ -97,7 +97,9 @@ namespace gridtools { auto testee = int_vector::multiply(vec, 2_c); using testee_t = decltype(testee); +#ifndef __NVCC__ static_assert(element_at::value == 2); +#endif EXPECT_EQ(4, at_key(testee)); } @@ -109,7 +111,9 @@ namespace gridtools { EXPECT_EQ(1, at_key(testee)); using testee_t = decltype(testee); static_assert(!has_key()); +#ifndef __NVCC__ static_assert(element_at::value == 2); +#endif } TEST(unary_ops, smoke) { @@ -121,14 +125,18 @@ namespace gridtools { EXPECT_EQ(-1, at_key(testee)); using testee_t = decltype(testee); +#ifndef __NVCC__ static_assert(element_at::value == 0); static_assert(element_at::value == -2); +#endif auto testee2 = +vec; EXPECT_EQ(1, at_key(testee2)); using testee2_t = decltype(testee2); +#ifndef __NVCC__ static_assert(element_at::value == 0); static_assert(element_at::value == 2); +#endif } TEST(minus_op, smoke) { @@ -141,7 +149,9 @@ namespace gridtools { EXPECT_EQ(0, at_key(testee)); using testee_t = decltype(testee); +#ifndef __NVCC__ static_assert(element_at::value == 1); +#endif EXPECT_EQ(-3, at_key(testee)); } } // namespace From 0477cab71a790e4dedaa5b9c42bbb50f365ec4e2 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Wed, 25 Feb 2026 13:07:40 +0100 Subject: [PATCH 07/10] Fix nanobind compilation with NVHPC --- .../unit_tests/storage/adapter/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unit_tests/storage/adapter/CMakeLists.txt b/tests/unit_tests/storage/adapter/CMakeLists.txt index 309a30532..88b717850 100644 --- a/tests/unit_tests/storage/adapter/CMakeLists.txt +++ b/tests/unit_tests/storage/adapter/CMakeLists.txt @@ -7,6 +7,24 @@ if (${GT_TESTS_ENABLE_PYTHON_TESTS}) ) FetchContent_MakeAvailable(nanobind) nanobind_build_library(nanobind-static) + # Nvhpc does not support -ffunction-sections/-fdata-sections and + # -Wl,--gc-sections, remove those flags from the target. + if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") + foreach(opts COMPILE_OPTIONS INTERFACE_COMPILE_OPTIONS) + get_target_property(nanonbind_opts nanobind-static ${opts}) + if (nanonbind_opts) + list(FILTER nanonbind_opts EXCLUDE REGEX "ffunction-sections|fdata-sections") + set_target_properties(nanobind-static PROPERTIES ${opts} "${nanonbind_opts}") + endif() + endforeach() + foreach(opts LINK_OPTIONS INTERFACE_LINK_OPTIONS) + get_target_property(nanobind_opts nanobind-static ${opts}) + if (nanobind_opts) + list(FILTER nanobind_opts EXCLUDE REGEX "gc-sections") + set_target_properties(nanobind-static PROPERTIES ${opts} "${nanobind_opts}") + endif() + endforeach() + endif() gridtools_add_unit_test(test_nanobind_adapter SOURCES test_nanobind_adapter.cpp From e0825893e8aa0a82b8a0d8468f9339446eb78eb8 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Wed, 25 Feb 2026 13:35:09 +0100 Subject: [PATCH 08/10] Enable deduction guide for all compilers --- include/gridtools/common/hymap.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/gridtools/common/hymap.hpp b/include/gridtools/common/hymap.hpp index 8265d84b7..f0a0d123f 100644 --- a/include/gridtools/common/hymap.hpp +++ b/include/gridtools/common/hymap.hpp @@ -198,10 +198,8 @@ namespace gridtools { template struct values; -#if !defined(__NVCC__) && defined(__clang__) template values(Vs const &...) -> values; -#endif // NVCC 11 fails to do class template deduction in the case of nested templates template From c29bb51004d6abc2ce62d4da347d060ceff173d6 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Wed, 25 Feb 2026 14:58:26 +0100 Subject: [PATCH 09/10] Disable hymap deduction guide for old GCCs --- include/gridtools/common/hymap.hpp | 2 ++ tests/unit_tests/common/test_hymap.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/gridtools/common/hymap.hpp b/include/gridtools/common/hymap.hpp index f0a0d123f..49c3f98ab 100644 --- a/include/gridtools/common/hymap.hpp +++ b/include/gridtools/common/hymap.hpp @@ -198,8 +198,10 @@ namespace gridtools { template struct values; +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 11) template values(Vs const &...) -> values; +#endif // NVCC 11 fails to do class template deduction in the case of nested templates template diff --git a/tests/unit_tests/common/test_hymap.cpp b/tests/unit_tests/common/test_hymap.cpp index af73cb23d..0ba7823b7 100644 --- a/tests/unit_tests/common/test_hymap.cpp +++ b/tests/unit_tests/common/test_hymap.cpp @@ -96,7 +96,7 @@ namespace gridtools { EXPECT_EQ(7.3, at_key(dst)); } -#if !defined(__NVCC__) +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 11) TEST(deduction, smoke) { auto testee = hymap::keys::values(42, 5.3); From e306e281e1e7a511c74419872db1873f3c42fad8 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Wed, 25 Feb 2026 15:33:25 +0100 Subject: [PATCH 10/10] Disable deduction for GCC 11 --- include/gridtools/common/hymap.hpp | 2 +- tests/unit_tests/common/test_hymap.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/gridtools/common/hymap.hpp b/include/gridtools/common/hymap.hpp index 49c3f98ab..ceaeaab22 100644 --- a/include/gridtools/common/hymap.hpp +++ b/include/gridtools/common/hymap.hpp @@ -198,7 +198,7 @@ namespace gridtools { template struct values; -#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 11) +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12) template values(Vs const &...) -> values; #endif diff --git a/tests/unit_tests/common/test_hymap.cpp b/tests/unit_tests/common/test_hymap.cpp index 0ba7823b7..31f4f9cee 100644 --- a/tests/unit_tests/common/test_hymap.cpp +++ b/tests/unit_tests/common/test_hymap.cpp @@ -96,7 +96,7 @@ namespace gridtools { EXPECT_EQ(7.3, at_key(dst)); } -#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 11) +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12) TEST(deduction, smoke) { auto testee = hymap::keys::values(42, 5.3);