Browse Source

adapt to efficient wait in cache

master
Constantin Fürst 11 months ago
parent
commit
542a815b4f
  1. 16
      qdp_project/src/Benchmark.cpp

16
qdp_project/src/Benchmark.cpp

@ -30,10 +30,10 @@ constexpr uint32_t ITERATION_COUNT = 5;
#ifdef MODE_PREFETCH #ifdef MODE_PREFETCH
constexpr size_t CHUNK_SIZE_B = 64_MiB; 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_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 PERFORM_CACHING = true;
constexpr bool DATA_IN_HBM = false; constexpr bool DATA_IN_HBM = false;
constexpr char MODE_STRING[] = "prefetch"; constexpr char MODE_STRING[] = "prefetch";
@ -115,15 +115,17 @@ void scan_b(size_t gid, size_t tid) {
LAUNCH_.wait(); LAUNCH_.wait();
if constexpr (PERFORM_CACHING) { if constexpr (PERFORM_CACHING) {
std::vector<std::unique_ptr<dsacache::CacheData>> data;
for (size_t i = start; i < end; i++) { for (size_t i = start; i < end; i++) {
const size_t chunk_index = get_chunk_index(gid, 0); const size_t chunk_index = get_chunk_index(gid, 0);
uint64_t* chunk_ptr = get_chunk<TC_AGGRJ>(DATA_B_, chunk_index, i); uint64_t* chunk_ptr = get_chunk<TC_AGGRJ>(DATA_B_, chunk_index, i);
const auto data = CACHE_.Access(reinterpret_cast<uint8_t *>(chunk_ptr), CHUNK_SIZE_B / TC_AGGRJ);
sched_yield();
data.emplace_back(std::move(CACHE_.Access(reinterpret_cast<uint8_t *>(chunk_ptr), CHUNK_SIZE_B / TC_AGGRJ)));
}
data->WaitOnCompletion();
for (auto& e : data) {
e->WaitOnCompletion();
} }
} }

Loading…
Cancel
Save