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.

14 lines
517 B

  1. # calculates throughput in gib/s from the meassured
  2. # transfer duration (in nanoseconds) for a given element
  3. # with the size of this given in bytes
  4. def calc_throughput(size_bytes,time_ns):
  5. time_seconds = time_ns * 1e-9
  6. size_gib = size_bytes / (1024 ** 3)
  7. throughput_gibs = size_gib / time_seconds
  8. return throughput_gibs
  9. # reverse array search: return index of value in array
  10. def index_from_element(value,array):
  11. for (idx,val) in enumerate(array):
  12. if val == value: return idx
  13. return 0