iccsa-17-gpulab

git clone https://git.igankevich.com/iccsa-17-gpulab.git
Log | Files | Refs

commit c569479026157b3ae685165335892f8efe231187
parent f5cc0a9c6f1af5c0c778660e7c341462041fc9ed
Author: Ivan Gankevich <igankevich@ya.ru>
Date:   Thu, 11 May 2017 11:23:49 +0300

Plot CPU/GPU performance.

Diffstat:
.gitignore | 2++
R/common.R | 22++++++++++++++++++++--
R/plot-cpu-gpu.R | 11+++++++++++
3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1 +1,3 @@ /bin/ +/Rplots.pdf +/build/ diff --git a/R/common.R b/R/common.R @@ -40,6 +40,24 @@ load_log_file_as_data_frame <- function (prefix, pattern) { arma.plot_cpu_gpu <- function () { data1 <- load_log_file_as_data_frame("data", "^linear.*\\.log$") data2 <- load_log_file_as_data_frame("data", "^high_amplitude_realtime.*\\.log$") - print(data1) - print(data2) + data1 <- aggregate(data1$t*1e-6, by=list(size=data1$size), FUN=mean) + data2 <- aggregate(data2$t*1e-6, by=list(size=data2$size), FUN=mean) + plot.new() + plot.window( + xlim=range(data1$size), + ylim=range(c(data1$x, data2$x)) + ) + lines(data1$size, data1$x, lty="solid", type="b") + lines(data2$size, data2$x, lty="dashed", type="b") + axis(1, at=data1$size, labels=data1$size) + axis(2) + title( + xlab="Wavy surface size", + ylab="Time, s" + ) + text(586, 13, "OpenMP", pos=4) + text(622, 2, "OpenCL", pos=4) + #legend("top", c("OpenMP", "OpenCL"), lty=c("solid", "dashed")) + #print(data1) + #print(data2) } diff --git a/R/plot-cpu-gpu.R b/R/plot-cpu-gpu.R @@ -2,4 +2,15 @@ source(file.path("R", "common.R")) +if (!dir.exists("build")) { + dir.create("build") +} + +pdf( + file=file.path("build", "bench-cpu-gpu.pdf"), + width=3, + height=2, + pointsize=8 +) +par(family="Times") data <- arma.plot_cpu_gpu()