This contains my bachelors thesis and associated tex files, code snippets and maybe more. Topic: Data Movement in Heterogeneous Memories with Intel Data Streaming Accelerator
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.

43 lines
1.1 KiB

  1. #include <dml/dml.hpp>
  2. #include <vector>
  3. #include <iostream>
  4. #include <fstream>
  5. #include "benchmark.cpp"
  6. int main(int argc, char **argv) {
  7. if (argc < 3) {
  8. std::cout << "Missing input and output file names." << std::endl;
  9. std::cout << "Usage: ./benchmarks [input.json] [output.json]" << std::endl;
  10. return 1;
  11. }
  12. const std::string input = argv[1];
  13. const std::string output = argv[2];
  14. std::string path;
  15. uint64_t repetitions;
  16. std::vector<TaskData> args;
  17. std::ifstream is(input);
  18. ReadWorkDescription(args, path, repetitions, is);
  19. is.close();
  20. if (path == "hw") {
  21. execute_dml_memcpy<dml::hardware>(args, repetitions);
  22. }
  23. else if (path == "sw") {
  24. execute_dml_memcpy<dml::software>(args, repetitions);
  25. }
  26. else if (path == "auto") {
  27. execute_dml_memcpy<dml::automatic>(args, repetitions);
  28. }
  29. else {
  30. std::cerr << "Path is neither hw/sw/auto." << std::endl;
  31. }
  32. std::ofstream os(output);
  33. WriteResultLog(args, path, ITERATION_TIMING_, os);
  34. os.close();
  35. }