-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add performance section to documentation
- Loading branch information
Showing
5 changed files
with
114 additions
and
2 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,6 +1,9 @@ | ||
# build directory | ||
build/ | ||
|
||
# python compiled files | ||
*.pyc | ||
|
||
# vim temp files | ||
.*.sw* | ||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[section:performance Performance] | ||
|
||
The following tests were run with an AMD HD 7970 "Tahiti" GPU on a system | ||
with an Intel i7-4771 3.50GHz CPU. | ||
|
||
Source code for the benchmarks can be found under the | ||
[@https://github.com/kylelutz/compute/tree/master/perf perf] directory. All | ||
benchmarks were compiled with optimizations enabled (i.e. "gcc -O3"). | ||
|
||
[h3 Accumulate] | ||
[$images/perf/accumulate_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Count] | ||
[$images/perf/count_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Inner Product] | ||
[$images/perf/inner_product_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Merge] | ||
[$images/perf/merge_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Partial Sum] | ||
[$images/perf/partial_sum_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Partition] | ||
[$images/perf/partition_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Reverse] | ||
[$images/perf/reverse_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Rotate] | ||
[$images/perf/rotate_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Set Difference] | ||
[$images/perf/set_difference_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Sort] | ||
[$images/perf/sort_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Transform] | ||
[$images/perf/saxpy_time_plot.png [width 850px] [align center]] | ||
|
||
[h3 Unique] | ||
[$images/perf/unique_time_plot.png [width 850px] [align center]] | ||
|
||
[endsect] [/ performance] |
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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/python | ||
|
||
import os | ||
import sys | ||
import pylab | ||
|
||
from perf import run_benchmark | ||
|
||
fignum = 0 | ||
|
||
def plot_to_file(report, filename): | ||
global fignum | ||
fignum += 1 | ||
pylab.figure(fignum) | ||
|
||
run_to_label = { | ||
"stl" : "C++ STL", | ||
"compute" : "Boost.Compute" | ||
} | ||
|
||
for run in report.samples.keys(): | ||
x = [] | ||
y = [] | ||
|
||
for sample in report.samples[run]: | ||
x.append(sample[0]) | ||
y.append(sample[1]) | ||
|
||
pylab.plot(x, y, marker='o', label=run_to_label[run]) | ||
|
||
pylab.xlabel("Size") | ||
pylab.ylabel("Time (ms)") | ||
pylab.legend(loc='upper left') | ||
pylab.savefig(filename) | ||
|
||
if __name__ == '__main__': | ||
sizes = [pow(2, x) for x in range(10, 26)] | ||
algorithms = [ | ||
"accumulate", | ||
"count", | ||
"inner_product", | ||
"merge", | ||
"partial_sum", | ||
"partition", | ||
"reverse", | ||
"rotate", | ||
"saxpy", | ||
"set_difference", | ||
"sort", | ||
"unique", | ||
] | ||
|
||
try: | ||
os.mkdir("perf_plots") | ||
except OSError: | ||
pass | ||
|
||
for algorithm in algorithms: | ||
print "running '%s'" % (algorithm) | ||
report = run_benchmark(algorithm, sizes, ["stl"]) | ||
plot_to_file(report, "perf_plots/%s_time_plot.png" % algorithm) | ||
|