-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update timing demo run scripts to print output in CSV format.
- Loading branch information
Showing
2 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Run timing test | ||
Run timing test (non-GPU). | ||
""" | ||
|
||
import numpy as np | ||
|
||
import csv | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
script_name = 'timing_demo.py' | ||
|
||
for spikes in xrange(100, 1100, 100): | ||
out = subprocess.check_output(['python', script_name, | ||
'-u', '2', '-s', str(spikes), '-g', '0', '-m', '1000']) | ||
throughput, runtime = out.strip().split(',') | ||
print spikes, throughput, runtime | ||
w = csv.writer(sys.stdout) | ||
for spikes in np.linspace(100, 10000, 10, dtype=int): | ||
average_throughput_list = [] | ||
total_throughput_list = [] | ||
runtime_list = [] | ||
for i in xrange(3): | ||
out = subprocess.check_output(['python', script_name, | ||
'-u', '2', '-s', str(spikes), '-g', '0', '-m', '500']) | ||
average_throughput, total_throughput, runtime = out.strip('()\n\"').split(', ') | ||
average_throughput_list.append(float(average_throughput)) | ||
total_throughput_list.append(float(total_throughput)) | ||
runtime_list.append(float(runtime)) | ||
w.writerow([spikes, np.average(average_throughput_list), | ||
np.average(total_throughput_list), | ||
np.average(runtime_list)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Run timing test | ||
Run timing test (GPU). | ||
""" | ||
|
||
import numpy as np | ||
|
||
import csv | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
script_name = 'timing_demo_gpu.py' | ||
|
||
for spikes in xrange(100, 1100, 100): | ||
out = subprocess.check_output(['python', script_name, | ||
'-u', '2', '-s', str(spikes), '-g', '0', '-m', '1000']) | ||
throughput, runtime = out.strip().split(',') | ||
print spikes, throughput, runtime | ||
w = csv.writer(sys.stdout) | ||
for spikes in np.linspace(100, 10000, 10, dtype=int): | ||
average_throughput_list = [] | ||
total_throughput_list = [] | ||
runtime_list = [] | ||
for i in xrange(3): | ||
out = subprocess.check_output(['python', script_name, | ||
'-u', '2', '-s', str(spikes), '-g', '0', '-m', '500']) | ||
average_throughput, total_throughput, runtime = out.strip('()\n\"').split(', ') | ||
average_throughput_list.append(float(average_throughput)) | ||
total_throughput_list.append(float(total_throughput)) | ||
runtime_list.append(float(runtime)) | ||
w.writerow([spikes, np.average(average_throughput_list), | ||
np.average(total_throughput_list), | ||
np.average(runtime_list)]) |