plot-cpu-gpu.R (989B)
1 #!/usr/bin/Rscript 2 3 source(file.path("R", "common.R")) 4 5 args <- commandArgs(trailingOnly=TRUE) 6 fmt <- args[1] 7 palette <- args[2] 8 9 if (fmt == 'pdf') { 10 pdf( 11 file=file.path("build", "bench-cpu-gpu.pdf"), 12 width=3, 13 height=2.5, 14 pointsize=8 15 ) 16 } else if (fmt == 'eps') { 17 cairo_ps( 18 file=file.path("build", "bench-cpu-gpu.eps"), 19 width=3, 20 height=2.5, 21 pointsize=8 22 ) 23 } else { 24 png( 25 file=file.path("build", "bench-cpu-gpu.png"), 26 width=800, 27 height=600, 28 pointsize=20 29 ) 30 } 31 par(family="Times") 32 data <- arma.plot_cpu_gpu() 33 34 dev.off() 35 36 if (fmt == 'pdf') { 37 pdf( 38 file=file.path("build", "breakdown-cpu-gpu.pdf"), 39 width=4.5, 40 height=4, 41 pointsize=8 42 ) 43 } else if (fmt == 'eps') { 44 cairo_ps( 45 file=file.path("build", "breakdown-cpu-gpu.eps"), 46 width=4.5, 47 height=4, 48 pointsize=8 49 ) 50 } else { 51 png( 52 file=file.path("build", "breakdown-cpu-gpu.png"), 53 width=1100, 54 height=600, 55 pointsize=20 56 ) 57 } 58 par(family="Times") 59 data <- arma.plot_performance_breakdown(palette=palette) 60