From 3bfbeca21f3b1d5e6e9610b2a89e54d365345991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Tue, 30 Jan 2024 14:46:50 +0100 Subject: [PATCH] resize source and destination pointer holders properly before use and use path from template and not dml::software for cache flush in benchmark loop --- benchmarks/benchmark.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmarks/benchmark.cpp b/benchmarks/benchmark.cpp index 031275f..0c1efd0 100644 --- a/benchmarks/benchmark.cpp +++ b/benchmarks/benchmark.cpp @@ -71,6 +71,9 @@ void execute_dml_memcpy(std::vector& args, const uint64_t iterations) // initialize data fields for use + SOURCE_.resize(args.size()); + DESTINATION_.resize(args.size()); + for (uint32_t tid = 0; tid < args.size(); tid++) { SOURCE_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_src); DESTINATION_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_dst); @@ -90,8 +93,8 @@ void execute_dml_memcpy(std::vector& args, const uint64_t iterations) dml::data_view srcv = dml::make_view(reinterpret_cast(SOURCE_[tid]), args[tid].size); dml::data_view dstv = dml::make_view(reinterpret_cast(DESTINATION_[tid]), args[tid].size); - auto rsrc = dml::execute(dml::cache_flush, srcv); - auto rdst = dml::execute(dml::cache_flush, dstv); + auto rsrc = dml::execute(dml::cache_flush, srcv); + auto rdst = dml::execute(dml::cache_flush, dstv); TaskData* task = &args[tid]; CHECK_STATUS(rsrc.status, "Flushing Cache for Source failed!"); CHECK_STATUS(rdst.status, "Flushing Cache for Destination failed!");