You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
#include <dml/dml.hpp>
|
|
|
|
#include <vector>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
|
|
#include "benchmark.hpp"
|
|
|
|
int main(int argc, char **argv) {
|
|
if (argc < 3) {
|
|
std::cout << "Missing input and output file names." << std::endl;
|
|
std::cout << "Usage: ./benchmarks [input.json] [output.json]" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
const std::string input = argv[1];
|
|
const std::string output = argv[2];
|
|
|
|
std::string path;
|
|
uint64_t repetitions;
|
|
std::vector<TaskData> args;
|
|
std::vector<uint64_t> timing;
|
|
|
|
std::ifstream is(input);
|
|
ReadWorkDescription(args, path, repetitions, is);
|
|
is.close();
|
|
|
|
if (path == "hw") {
|
|
timing = execute_dml_memcpy<dml::hardware>(args, repetitions);
|
|
}
|
|
else if (path == "sw") {
|
|
timing = execute_dml_memcpy<dml::software>(args, repetitions);
|
|
}
|
|
else if (path == "auto") {
|
|
timing = execute_dml_memcpy<dml::automatic>(args, repetitions);
|
|
}
|
|
else {
|
|
std::cerr << "Path is neither hw/sw/auto." << std::endl;
|
|
}
|
|
|
|
std::ofstream os(output);
|
|
WriteResultLog(args, path, timing, os);
|
|
os.close();
|
|
}
|