From 829504289afe7215746011a1e4eaeb4c20b71078 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Thu, 3 Dec 2026 10:45:19 +0100 Subject: [PATCH] fn naive backend: allocate temporaries without zero-initialization std::make_unique value-initializes, which zero-fills every temporary serially on each call. --- include/gridtools/fn/backend/naive.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/gridtools/fn/backend/naive.hpp b/include/gridtools/fn/backend/naive.hpp index f4cb34bee..b934afe5f 100644 --- a/include/gridtools/fn/backend/naive.hpp +++ b/include/gridtools/fn/backend/naive.hpp @@ -9,6 +9,9 @@ */ #pragma once +#include +#include + #include "../../common/functional.hpp" #include "../../common/hymap.hpp" #include "../../common/tuple_util.hpp" @@ -90,7 +93,8 @@ namespace gridtools::fn::backend { template inline auto tmp_allocator(naive_with_threadpool be) { - return std::make_tuple(be, sid::allocator(&std::make_unique)); + return std::make_tuple( + be, sid::allocator([](std::size_t n) { return std::unique_ptr(new char[n]); })); } template