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.

53 lines
1.4 KiB

  1. #include <dml/dml.hpp>
  2. #include <vector>
  3. #include <iostream>
  4. #include "error.hpp"
  5. #include "execute-move.hpp"
  6. template <typename path>
  7. int testrunner() {
  8. std::vector<ThreadArgs> args;
  9. ThreadArgs a;
  10. a.core = 0;
  11. a.numa_node = 0;
  12. a.size = 4096;
  13. a.nnode_dst = 0;
  14. a.nnode_src = 0;
  15. args.emplace_back(a);
  16. execute_mem_move<path>(args);
  17. const auto status = args.front().status.front();
  18. std::cout << "Operation Result Status: " << status << std::endl;
  19. return 0;
  20. }
  21. int main(int argc, char **argv) {
  22. if (argc < 2) {
  23. std::cout << "Missing the execution path as the first parameter. Use hardware_path, software_path or automatic_path." << std::endl;
  24. return 1;
  25. }
  26. const std::string path = argv[1];
  27. if (path == "hardware_path") {
  28. std::cout << "Executing using dml::hardware path" << std::endl;
  29. return testrunner<dml::hardware>();
  30. }
  31. else if (path == "software_path") {
  32. std::cout << "Executing using dml::software path" << std::endl;
  33. return testrunner<dml::software>();
  34. }
  35. else if (path == "auto_path") {
  36. std::cout << "Executing using dml::automatic path" << std::endl;
  37. return testrunner<dml::automatic>();
  38. }
  39. else {
  40. std::cout << "Unrecognized value for parameter. Use hardware_path, software_path or automatic_path." << std::endl;
  41. return 1;
  42. }
  43. }