From 74f659e5a416be1d30b003450deaf2cb6d5c2d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Tue, 23 Jan 2024 18:05:40 +0100 Subject: [PATCH] potential fix for lifetime of cache data --- qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h index a913ac3..197c2f5 100755 --- a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h +++ b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h @@ -313,12 +313,14 @@ public: // calculate pointers size_t chunk_id = gid + gcnt * i; base_t* chunk_ptr = get_sub_chunk_ptr(data_b, chunk_id, chunk_size_w, tid, tcnt); + + std::unique_ptr data; base_t* data_ptr; if constexpr (caching) { // access the cache for the given chunk which will have been accessed in scan_b - const auto data = cache_.Access(reinterpret_cast(chunk_ptr), chunk_size_b / tcnt); + data = cache_.Access(reinterpret_cast(chunk_ptr), chunk_size_b / tcnt); // wait on the caching task to complete, this will give time for other processes // to make progress here which will therefore not hurt performance