#include "dawn/tests/perf_tests/DawnPerfTest.h"
#include <algorithm>
#include <fstream>
#include <limits>
#include "dawn/common/Assert.h"
#include "dawn/common/Log.h"
#include "dawn/platform/tracing/TraceEvent.h"
#include "dawn/tests/perf_tests/DawnPerfTestPlatform.h"
#include "dawn/utils/Timer.h"
namespace dawn {
namespace {
DawnPerfTestEnvironment* gTestEnv = …;
void DumpTraceEventsToJSONFile(
const std::vector<DawnPerfTestPlatform::TraceEvent>& traceEventBuffer,
const char* traceFile) { … }
}
}
void InitDawnPerfTestEnvironment(int argc, char** argv) { … }
namespace dawn {
DawnPerfTestEnvironment::DawnPerfTestEnvironment(int argc, char** argv)
: … { … }
DawnPerfTestEnvironment::~DawnPerfTestEnvironment() = default;
void DawnPerfTestEnvironment::SetUp() { … }
void DawnPerfTestEnvironment::TearDown() { … }
bool DawnPerfTestEnvironment::IsCalibrating() const { … }
unsigned int DawnPerfTestEnvironment::OverrideStepsToRun() const { … }
const char* DawnPerfTestEnvironment::GetTraceFile() const { … }
DawnPerfTestPlatform* DawnPerfTestEnvironment::GetPlatform() const { … }
DawnPerfTestBase::DawnPerfTestBase(DawnTestBase* test,
unsigned int iterationsPerStep,
unsigned int maxStepsInFlight)
: … { … }
DawnPerfTestBase::~DawnPerfTestBase() = default;
void DawnPerfTestBase::AbortTest() { … }
void DawnPerfTestBase::RunTest() { … }
void DawnPerfTestBase::DoRunLoop(double maxRunTime) { … }
void DawnPerfTestBase::OutputResults() { … }
void DawnPerfTestBase::AddGPUTime(double time) { … }
void DawnPerfTestBase::PrintPerIterationResultFromSeconds(const std::string& trace,
double valueInSeconds,
bool important) const { … }
void DawnPerfTestBase::PrintResult(const std::string& trace,
double value,
const std::string& units,
bool important) const { … }
void DawnPerfTestBase::PrintResult(const std::string& trace,
unsigned int value,
const std::string& units,
bool important) const { … }
void DawnPerfTestBase::PrintResultImpl(const std::string& trace,
const std::string& value,
const std::string& units,
bool important) const { … }
}