# sprintf(format, arch, node, dir, threads, accel, stride, j, arr, workers, type)
format = "data/arch=%s.node=%s.dir=%s.threads=%d.accel=%i.opt-stride=%i.j=%i.arr=%s.workers=%i.type=%s.txt"
arch = "x86_64"
node = "pc"
dir = "fwd"
threads = 1
accel = 9
stride = 2
j = 1
arr = "packed"
workers = 1
type = "float"

#############################################################################
set terminal svg enhanced size 640 420
set output "array.svg"
set xlabel "pixels"
set ylabel "seconds / pixel"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

threads = 1
accel = 9
stride = 2
j = -1
workers = 1

plot \
	sprintf(format, arch, node, dir, threads,  accel, stride, j, "simple", workers, type) with lines lc rgb "#ff0000" lw 2 title "simple", \
	sprintf(format, arch, node, dir, threads,  accel, stride, j, "sparse", workers, type) with lines lc rgb "#00ff00" lw 2 title "sparse", \
	sprintf(format, arch, node, dir, threads,  accel, stride, j, "packed", workers, type) with lines lc rgb "#0000ff" lw 2 title "packed"

#############################################################################
set terminal svg enhanced size 640 420
set output "stride.svg"
set xlabel "pixels"
set ylabel "seconds / pixel"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

threads = 1
accel = 9
j = 1
arr = "packed"
workers = 1

plot \
	sprintf(format, arch, node, dir, threads,  accel, 0, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "non-optimal stride (0)", \
	sprintf(format, arch, node, dir, threads,  accel, 1, j, arr, workers, type) with lines lc rgb "#0000ff" lw 2 title "prime stride (1)", \
	sprintf(format, arch, node, dir, threads,  accel, 2, j, arr, workers, type) with lines lc rgb "#00ffff" lw 2 title "prime-set stride (2)"

#############################################################################
set terminal svg enhanced size 640 420
set output "threads.svg"
set xlabel "pixels"
set ylabel "seconds / pixel"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

accel = 9
stride = 2
j = 1
arr = "packed"
workers = 1

plot \
	sprintf(format, arch, node, dir, 1,  accel, stride, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "1 thread", \
	sprintf(format, arch, node, dir, 2,  accel, stride, j, arr, workers, type) with lines lc rgb "#0000ff" lw 2 title "2 threads"

#############################################################################
set terminal svg enhanced size 640 420
set output "accel.svg"
set xlabel "pixels"
set ylabel "seconds / pixel"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

threads = 1
stride = 2
j = 1
arr = "packed"

plot \
	sprintf(format, arch, node, dir, threads,  0, stride, j, arr, 1, type) with lines lc rgb "#ff0000" lw 2 title "ML (0)", \
	sprintf(format, arch, node, dir, threads,  9, stride, j, arr, 1, type) with lines lc rgb "#000000" lw 2 title "SDL (9)", \
	sprintf(format, arch, node, dir, threads, 11, stride, j, arr, 4, type) with lines lc rgb "#00ff00" lw 2 title "DL4 (11)", \
	sprintf(format, arch, node, dir, threads, 12, stride, j, arr, 4, type) with lines lc rgb "#ff8000" lw 2 title "ML4 (12)", \
	sprintf(format, arch, node, dir, threads, 13, stride, j, arr, 1, type) with lines lc rgb "#c0c0c0" lw 2 title "ML no-sse (13)", \
	sprintf(format, arch, node, dir, threads, 14, stride, j, arr, 1, type) with lines lc rgb "#808080" lw 2 title "DL no-sse (14)"
