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.

31 lines
949 B

  1. import os
  2. import json
  3. import shutil
  4. import copy
  5. def process_json_file(file_path):
  6. fr = open(file_path, 'r')
  7. json_data = json.load(fr)
  8. entries = json_data["count"]
  9. for i in range(entries):
  10. bs = json_data["list"][i]["task"]["batching"]["batch_size"]
  11. del json_data["list"][i]["task"]["batching"]
  12. del json_data["list"][i]["task"]["iterations"]
  13. json_data["list"][i]["task"]["batch_size"] = bs
  14. json_data["repetitions"] = 10
  15. with open(file_path, 'w') as f:
  16. json.dump(json_data, f, indent=2)
  17. def process_files_in_folder(folder_path):
  18. for filename in os.listdir(folder_path):
  19. file_path = os.path.join(folder_path, filename)
  20. if os.path.isfile(file_path) and filename.endswith('.json'):
  21. process_json_file(file_path)
  22. if __name__ == "__main__":
  23. folder_path = "./benchmark-descriptors/peak-perf-smart-cpu/"
  24. process_files_in_folder(folder_path)