Browse Source

resize source and destination pointer holders properly before use and use path from template and not dml::software for cache flush in benchmark loop

master
Constantin Fürst 11 months ago
parent
commit
3bfbeca21f
  1. 7
      benchmarks/benchmark.cpp

7
benchmarks/benchmark.cpp

@ -71,6 +71,9 @@ void execute_dml_memcpy(std::vector<TaskData>& args, const uint64_t iterations)
// initialize data fields for use // initialize data fields for use
SOURCE_.resize(args.size());
DESTINATION_.resize(args.size());
for (uint32_t tid = 0; tid < args.size(); tid++) { for (uint32_t tid = 0; tid < args.size(); tid++) {
SOURCE_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_src); SOURCE_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_src);
DESTINATION_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_dst); DESTINATION_[tid] = numa_alloc_onnode(args[tid].size, args[tid].nnode_dst);
@ -90,8 +93,8 @@ void execute_dml_memcpy(std::vector<TaskData>& args, const uint64_t iterations)
dml::data_view srcv = dml::make_view(reinterpret_cast<uint8_t*>(SOURCE_[tid]), args[tid].size); dml::data_view srcv = dml::make_view(reinterpret_cast<uint8_t*>(SOURCE_[tid]), args[tid].size);
dml::data_view dstv = dml::make_view(reinterpret_cast<uint8_t*>(DESTINATION_[tid]), args[tid].size); dml::data_view dstv = dml::make_view(reinterpret_cast<uint8_t*>(DESTINATION_[tid]), args[tid].size);
auto rsrc = dml::execute<dml::software>(dml::cache_flush, srcv);
auto rdst = dml::execute<dml::software>(dml::cache_flush, dstv);
auto rsrc = dml::execute<path>(dml::cache_flush, srcv);
auto rdst = dml::execute<path>(dml::cache_flush, dstv);
TaskData* task = &args[tid]; TaskData* task = &args[tid];
CHECK_STATUS(rsrc.status, "Flushing Cache for Source failed!"); CHECK_STATUS(rsrc.status, "Flushing Cache for Source failed!");
CHECK_STATUS(rdst.status, "Flushing Cache for Destination failed!"); CHECK_STATUS(rdst.status, "Flushing Cache for Destination failed!");

Loading…
Cancel
Save