Browse Source

add small testing function in main.cpp to test whether the new move-helper works

master
Constantin Fürst 1 year ago
parent
commit
06600f4179
  1. 27
      benchmarks/main.cpp

27
benchmarks/main.cpp

@ -6,6 +6,27 @@
#include "error.hpp" #include "error.hpp"
#include "execute-move.hpp" #include "execute-move.hpp"
template <typename path>
int testrunner() {
std::vector<ThreadArgs> args;
ThreadArgs a;
a.core = 0;
a.numa_node = 0;
a.size = 4096;
a.nnode_dst = 0;
a.nnode_src = 0;
args.emplace_back(a);
execute_mem_move<path>(args);
const auto status = args.front().status.front();
std::cout << "Operation Result Status: " << status << std::endl;
return 0;
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
if (argc < 2) { if (argc < 2) {
std::cout << "Missing the execution path as the first parameter. Use hardware_path, software_path or automatic_path." << std::endl; std::cout << "Missing the execution path as the first parameter. Use hardware_path, software_path or automatic_path." << std::endl;
@ -16,15 +37,15 @@ int main(int argc, char **argv) {
if (path == "hardware_path") { if (path == "hardware_path") {
std::cout << "Executing using dml::hardware path" << std::endl; std::cout << "Executing using dml::hardware path" << std::endl;
return execute_mem_move<dml::hardware>();
return testrunner<dml::hardware>();
} }
else if (path == "software_path") { else if (path == "software_path") {
std::cout << "Executing using dml::software path" << std::endl; std::cout << "Executing using dml::software path" << std::endl;
return execute_mem_move<dml::software>();
return testrunner<dml::software>();
} }
else if (path == "auto_path") { else if (path == "auto_path") {
std::cout << "Executing using dml::automatic path" << std::endl; std::cout << "Executing using dml::automatic path" << std::endl;
return execute_mem_move<dml::automatic>();
return testrunner<dml::automatic>();
} }
else { else {
std::cout << "Unrecognized value for parameter. Use hardware_path, software_path or automatic_path." << std::endl; std::cout << "Unrecognized value for parameter. Use hardware_path, software_path or automatic_path." << std::endl;

Loading…
Cancel
Save