Browse Source

use vector for timing - this update got lost somehow

master
Constantin Fürst 1 year ago
parent
commit
e6df656845
  1. 2
      benchmarks/benchmark.hpp
  2. 1
      benchmarks/util/array_utils.h
  3. 26
      benchmarks/util/statuscode-tostring.hpp
  4. 14
      benchmarks/util/task-data.hpp

2
benchmarks/benchmark.hpp

@ -12,7 +12,7 @@
#include <dml/dml.hpp> #include <dml/dml.hpp>
#include "util/barrier.hpp" #include "util/barrier.hpp"
#include "util/statuscode-tostring.hpp"
#include "util/dml-helper.hpp"
#include "util/task-data.hpp" #include "util/task-data.hpp"
#include "util/array_utils.h" #include "util/array_utils.h"

1
benchmarks/util/array_utils.h

@ -2,6 +2,7 @@
// author: Andre Berthold // author: Andre Berthold
#pragma once #pragma once
#include <cstdlib> #include <cstdlib>
#include <ctime> #include <ctime>
#include <cstdint> #include <cstdint>

26
benchmarks/util/statuscode-tostring.hpp

@ -1,26 +0,0 @@
#pragma once
#include <dml/dml.hpp>
inline const std::string StatusCodeToString(const dml::status_code code) {
switch(code) {
case dml::status_code::ok: return "ok";
case dml::status_code::false_predicate: return "false predicate";
case dml::status_code::partial_completion: return "partial completion";
case dml::status_code::nullptr_error: return "nullptr error";
case dml::status_code::bad_size: return "bad size";
case dml::status_code::bad_length: return "bad length";
case dml::status_code::inconsistent_size: return "inconsistent size";
case dml::status_code::dualcast_bad_padding: return "dualcast bad padding";
case dml::status_code::bad_alignment: return "bad alignment";
case dml::status_code::buffers_overlapping: return "buffers overlapping";
case dml::status_code::delta_delta_empty: return "delta delta empty";
case dml::status_code::batch_overflow: return "batch overflow";
case dml::status_code::execution_failed: return "execution failed";
case dml::status_code::unsupported_operation: return "unsupported operation";
case dml::status_code::queue_busy: return "queue busy";
case dml::status_code::error: return "unknown error";
case dml::status_code::config_error: return "config error";
default: return "unhandled error";
}
}

14
benchmarks/util/task-data.hpp

@ -4,8 +4,8 @@
#include "json/single_include/nlohmann/json.hpp" #include "json/single_include/nlohmann/json.hpp"
#include "statuscode-tostring.hpp"
#include "barrier.hpp" #include "barrier.hpp"
#include "dml-helper.hpp"
struct TaskData { struct TaskData {
// thread placement / engine selection // thread placement / engine selection
@ -21,12 +21,9 @@ struct TaskData {
// thread output // thread output
dml::status_code status; dml::status_code status;
// average run duration in microseconds // average run duration in microseconds
double combined_duration;
double submit_duration;
double complete_duration;
double combined_duration_stdev;
double submit_duration_stdev;
double complete_duration_stdev;
std::vector<double> combined_duration;
std::vector<double> submit_duration;
std::vector<double> complete_duration;
// completed iterations // completed iterations
uint32_t rep_completed; uint32_t rep_completed;
// set by execution // set by execution
@ -45,9 +42,6 @@ inline void to_json(nlohmann::json& j, const TaskData& a) {
j["report"]["time"]["completion_avg"] = a.complete_duration; j["report"]["time"]["completion_avg"] = a.complete_duration;
j["report"]["time"]["submission_avg"] = a.submit_duration; j["report"]["time"]["submission_avg"] = a.submit_duration;
j["report"]["time"]["combined_avg"] = a.combined_duration; j["report"]["time"]["combined_avg"] = a.combined_duration;
j["report"]["time"]["completion_stdev"] = a.complete_duration_stdev;
j["report"]["time"]["submission_stdev"] = a.submit_duration_stdev;
j["report"]["time"]["combined_stdev"] = a.combined_duration_stdev;
j["report"]["iterations_completed"] = a.rep_completed; j["report"]["iterations_completed"] = a.rep_completed;
j["report"]["status"] = StatusCodeToString(a.status); j["report"]["status"] = StatusCodeToString(a.status);
} }

Loading…
Cancel
Save