Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions sources/benchmark/amd/kawpow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <common/opencl/buffer_mapped.hpp>
#include <common/kernel_generator/opencl.hpp>
#include <common/custom.hpp>
#include <common/date.hpp>


bool benchmark::BenchmarkWorkflow::runAmdKawpow()
Expand All @@ -21,15 +20,10 @@ bool benchmark::BenchmarkWorkflow::runAmdKawpow()
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark AMD Kawpow";

common::Dashboard dashboard{};
dashboard.setTitle("[AMD] KAWPOW");
dashboard.addColumn("Kernel");
dashboard.addColumn("Blocks");
dashboard.addColumn("Threads");
dashboard.addColumn("Hashrate");
dashboard.addColumn("Time");
dashboard.setDate(common::getDate());
////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[AMD] KAWPOW") };

////////////////////////////////////////////////////////////////////////////
bool dagInitialized{ false };
Expand Down Expand Up @@ -201,7 +195,7 @@ bool benchmark::BenchmarkWorkflow::runAmdKawpow()
)
);
OPENCL_ER(propertiesAmd.clQueue.finish());
stopChrono(i, dashboard);
stopChrono(dashboard);
}

return true;
Expand Down
9 changes: 9 additions & 0 deletions sources/benchmark/nvidia/autolykos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ bool benchmark::BenchmarkWorkflow::runNvidiaAutolykosv2()
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Autolykos V2";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] AUTOLYKOS V2") };

////////////////////////////////////////////////////////////////////////////
t_result_64* result{ nullptr };
if (false == initCleanResult64(&result))
Expand Down Expand Up @@ -150,6 +156,9 @@ bool benchmark::BenchmarkWorkflow::runNvidiaAutolykosv2()
CU_SAFE_DELETE(dagHash);
CU_SAFE_DELETE(BHashes);

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

////////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
9 changes: 9 additions & 0 deletions sources/benchmark/nvidia/ethash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ bool benchmark::BenchmarkWorkflow::runNvidiaEthash()
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Etash";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] ETHASH") };

////////////////////////////////////////////////////////////////////////////
uint64_t const dagItems{ 45023203ull };
auto const headerHash
Expand Down Expand Up @@ -120,6 +126,9 @@ bool benchmark::BenchmarkWorkflow::runNvidiaEthash()
CU_SAFE_DELETE(dagHash);
CU_SAFE_DELETE_HOST(result);

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

////////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
9 changes: 9 additions & 0 deletions sources/benchmark/nvidia/ethash_light_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

bool benchmark::BenchmarkWorkflow::runNvidiaEthashLightCache()
{
////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Light Cache";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] Light Cache") };

///////////////////////////////////////////////////////////////////////////
uint32_t* lightCache{ nullptr };
uint32_t* seedCache{ nullptr };
Expand Down Expand Up @@ -81,6 +87,9 @@ bool benchmark::BenchmarkWorkflow::runNvidiaEthashLightCache()
CUDA_ER(cudaMemset(seedCache, 0, seedCacheSize));
CUDA_ER(cudaMemset(lightCache, 0, lightCacheSize));

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

///////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
9 changes: 9 additions & 0 deletions sources/benchmark/nvidia/fnv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ bool benchmark::BenchmarkWorkflow::runNvidiaFnv1()
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Fnv1";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] FNV1") };

////////////////////////////////////////////////////////////////////////////
uint32_t const commonLoop{ 10u };
uint32_t const commonThread{ 1024u };
Expand Down Expand Up @@ -53,6 +59,9 @@ bool benchmark::BenchmarkWorkflow::runNvidiaFnv1()
////////////////////////////////////////////////////////////////////////////
CU_SAFE_DELETE(result);

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

////////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
9 changes: 9 additions & 0 deletions sources/benchmark/nvidia/kawpow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ bool benchmark::BenchmarkWorkflow::runNvidiaKawpow()
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Kawpow";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] KAWPOW") };

////////////////////////////////////////////////////////////////////////////
t_result* result{ nullptr };
if (false == initCleanResult(&result))
Expand Down Expand Up @@ -305,6 +311,9 @@ bool benchmark::BenchmarkWorkflow::runNvidiaKawpow()
CU_SAFE_DELETE(headerHash);
CU_SAFE_DELETE_HOST(result);

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

////////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
10 changes: 10 additions & 0 deletions sources/benchmark/nvidia/keccak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ bool benchmark::BenchmarkWorkflow::runNvidiaKeccak()
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////
logInfo() << "Running benchmark NVIDIA Keccak";

////////////////////////////////////////////////////////////////////////////
common::Dashboard dashboard{ createNewDashboard("[NVIDIA] KECCAK") };

////////////////////////////////////////////////////////////////////////////
uint32_t const commonLoop{ 10u };
uint32_t const commonThreads{ 128u };
Expand Down Expand Up @@ -153,6 +159,10 @@ bool benchmark::BenchmarkWorkflow::runNvidiaKeccak()
blocks,
threads)
)

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

return true;
}

Expand Down
51 changes: 21 additions & 30 deletions sources/benchmark/workflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <common/formater_hashrate.hpp>
#include <common/log/log.hpp>
#include <common/custom.hpp>
#include <common/date.hpp>


benchmark::BenchmarkWorkflow::BenchmarkWorkflow(
Expand Down Expand Up @@ -118,44 +119,15 @@ void benchmark::BenchmarkWorkflow::startChrono(
}


void benchmark::BenchmarkWorkflow::stopChrono(uint32_t const index)
{
////////////////////////////////////////////////////////////////////////////
stats.increaseKernelExecuted();
stats.stop();
stats.updateHashrate();
double const hashrate{ (stats.getHashrate() * multiplicator) / divisor };
logInfo() << currentBenchName << ": " << common::hashrateToString(hashrate);

////////////////////////////////////////////////////////////////////////////
if (index == 0u)
{
return;
}

////////////////////////////////////////////////////////////////////////////
benchmark::Snapshot snapshot{};
snapshot.deviceType = currentdeviceType;
snapshot.name = currentBenchName;
snapshot.threads = threads;
snapshot.blocks = blocks;
snapshot.perform = hashrate;

////////////////////////////////////////////////////////////////////////////
snapshots.emplace_back(snapshot);
}


void benchmark::BenchmarkWorkflow::stopChrono(
uint32_t const index,
common::Dashboard& dashboard)
{
////////////////////////////////////////////////////////////////////////////
stats.increaseKernelExecuted();
stats.stop();
stats.updateHashrate();
double const hashrate{ (stats.getHashrate() * multiplicator) / divisor };
logInfo() << currentBenchName << ": " << common::hashrateToString(hashrate);
logDebug() << currentBenchName << ": " << common::hashrateToString(hashrate);

////////////////////////////////////////////////////////////////////////////
benchmark::Snapshot snapshot{};
Expand All @@ -182,6 +154,25 @@ void benchmark::BenchmarkWorkflow::stopChrono(
}


common::Dashboard benchmark::BenchmarkWorkflow::createNewDashboard(
std::string const& title)
{
common::Dashboard dashboard{};

dashboard.setTitle(title);

dashboard.addColumn("Kernel");
dashboard.addColumn("Blocks");
dashboard.addColumn("Threads");
dashboard.addColumn("Hashrate");
dashboard.addColumn("Time");

dashboard.setDate(common::getDate());

return dashboard;
}


void benchmark::BenchmarkWorkflow::writeReport()
{
boost::json::object root{};
Expand Down
10 changes: 5 additions & 5 deletions sources/benchmark/workflow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


#define RUN_BENCH(name, loopCount, _threads, _blocks, function) \
logInfo() << "================================"; \
logDebug() << "================================"; \
setGrid(_threads, _blocks); \
for (uint32_t i{ 0u }; i < loopCount; ++i) \
{ \
Expand All @@ -20,11 +20,11 @@
{ \
return false; \
} \
stopChrono(i); \
stopChrono(dashboard); \
} \
setMultiplicator(1u); \
setDivisor(1u); \
logInfo() << "================================";
logDebug() << "================================";


#define BENCH_INIT_RESET_RESULT(result) \
Expand Down Expand Up @@ -86,14 +86,14 @@ namespace benchmark
std::vector<benchmark::Snapshot> snapshots{};
std::vector<common::Dashboard> dashboards{};

common::Dashboard createNewDashboard(std::string const& title);
void writeReport();

void setMultiplicator(uint32_t const _multiplicator);
void setDivisor(uint32_t const _divisor);
void setGrid(uint32_t const _threads, uint32_t _blocks);
void startChrono(std::string const& benchName);
void stopChrono(uint32_t const index);
void stopChrono(uint32_t const index, common::Dashboard& dashboard);
void stopChrono(common::Dashboard& dashboard);

bool initCleanResult(t_result** result);
bool initCleanResult32(t_result_32** result);
Expand Down
1 change: 0 additions & 1 deletion sources/common/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void common::Dashboard::addLine(std::vector<std::string> const& line)
for (auto const& value : line)
{
common::Dashboard::Line l{ value, value.size() };
logInfo() << "line: " << l.value;
data.emplace_back(std::move(l));
}
lines.emplace_back(data);
Expand Down
Loading