From 542a815b4ff4a02d18088b471fe9441b8269ab3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Wed, 24 Jan 2024 04:30:14 +0100 Subject: [PATCH] adapt to efficient wait in cache --- qdp_project/src/Benchmark.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/qdp_project/src/Benchmark.cpp b/qdp_project/src/Benchmark.cpp index 453076b..7c2f76b 100644 --- a/qdp_project/src/Benchmark.cpp +++ b/qdp_project/src/Benchmark.cpp @@ -30,10 +30,10 @@ constexpr uint32_t ITERATION_COUNT = 5; #ifdef MODE_PREFETCH constexpr size_t CHUNK_SIZE_B = 64_MiB; -constexpr uint32_t GROUP_COUNT = 8; +constexpr uint32_t GROUP_COUNT = 32; constexpr uint32_t TC_SCANA = 1; -constexpr uint32_t TC_SCANB = 8; -constexpr uint32_t TC_AGGRJ = 8; +constexpr uint32_t TC_SCANB = 1; +constexpr uint32_t TC_AGGRJ = 1; constexpr bool PERFORM_CACHING = true; constexpr bool DATA_IN_HBM = false; constexpr char MODE_STRING[] = "prefetch"; @@ -115,15 +115,17 @@ void scan_b(size_t gid, size_t tid) { LAUNCH_.wait(); if constexpr (PERFORM_CACHING) { + std::vector> data; + for (size_t i = start; i < end; i++) { const size_t chunk_index = get_chunk_index(gid, 0); uint64_t* chunk_ptr = get_chunk(DATA_B_, chunk_index, i); - const auto data = CACHE_.Access(reinterpret_cast(chunk_ptr), CHUNK_SIZE_B / TC_AGGRJ); - - sched_yield(); + data.emplace_back(std::move(CACHE_.Access(reinterpret_cast(chunk_ptr), CHUNK_SIZE_B / TC_AGGRJ))); + } - data->WaitOnCompletion(); + for (auto& e : data) { + e->WaitOnCompletion(); } }