arma-thesis

git clone https://git.igankevich.com/arma-thesis.git
Log | Files | Refs | LICENSE

commit 76cbd036fd3ec6db78e7c0be6365a35a1ab6a2fd
parent 3bd1b32739235286d0f724c085687795a13c230a
Author: Ivan Gankevich <igankevich@ya.ru>
Date:   Wed, 16 Aug 2017 14:25:29 +0300

Add OpenCL/OpenGL performance graph.

Diffstat:
R/benchmarks.R | 22++++++++++++++++------
arma-thesis.org | 6+-----
2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/R/benchmarks.R b/R/benchmarks.R @@ -213,23 +213,33 @@ arma.aggregate_by_size <- function (data, framework) { fwdata } +arma.filter_copy_to_host <- function (data) { + data[data["routine"] == "harts_copy_to_host",] +} + +arma.add_text <- function (data, str, pos=4, off=1) { + len <- length(data$t) + text(data$size[[len-1]], data$t[[len-1]], str, pos=pos, offset=off) +} + arma.plot_realtime_data <- function (data, ...) { args <- list(...) openmp <- arma.aggregate_by_size(data, "openmp") opencl <- arma.aggregate_by_size(data, "opencl") - openmp_len <- length(openmp$t) - opencl_len <- length(opencl$t) + opengl <- arma.aggregate_by_size(arma.filter_copy_to_host(data), "opencl") plot.new() plot.window( - xlim=range(c(openmp$size, opencl$size)), - ylim=range(c(openmp$t, opencl$t))) + xlim=range(c(openmp$size, opencl$size, opengl$size)), + ylim=range(c(openmp$t, opencl$t, opengl$t))) lines(openmp$size, openmp$t, lty="solid", type="b") lines(opencl$size, opencl$t, lty="dashed", type="b") + lines(opengl$size, opengl$t, lty="dotted", type="b") axis(1, at=2^c(7:14)) axis(2) box() - text(openmp$size[[openmp_len-1]], openmp$t[[openmp_len-1]], "OpenMP", pos=4, offset=1) - text(opencl$size[[opencl_len-1]], opencl$t[[opencl_len-1]], "OpenCL", pos=4, offset=1) + arma.add_text(openmp, "OpenMP", pos=3, off=1.5) + arma.add_text(opencl, "OpenCL", pos=3, off=1.5) + arma.add_text(opengl, "OpenCL/OpenGL") } arma.filter_by_framework_and_size <- function (data, size, framework) { diff --git a/arma-thesis.org b/arma-thesis.org @@ -3846,11 +3846,7 @@ table\nbsp{}[[tab-storm]]. source(file.path("R", "benchmarks.R")) par(family="serif") data <- arma.load_realtime_data() -params <- list( - titles <- c("OpenMP", "OpenCL"), - linetypes = c("solid", "dashed") -) -arma.plot_realtime_data(data, params) +arma.plot_realtime_data(data) title(xlab="Wavy surface size", ylab="Time, s") #+end_src