# 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 "accel-all.svg"
set xlabel "samples"
set ylabel "seconds / sample"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

threads = 1
stride = 2
j = 1

unset arrow

# L1cache = 32*1024
# set arrow from L1cache/4,graph(0,0) to L1cache/4,graph(1,1) nohead

# L2cache = 3072*1024
# set arrow from L2cache/4,graph(0,0) to L2cache/4,graph(1,1) nohead

plot \
	sprintf(format, arch, node, dir, threads, 0, stride, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "ML (0)", \
	sprintf(format, arch, node, dir, threads, 4, stride, j, arr, workers, type) with lines lc rgb "#00ff7f" lw 2 title "DL (4)", \
	sprintf(format, arch, node, dir, threads, 5, stride, j, arr, workers, type) with lines lc rgb "#3f3f3f" lw 2 title "SDL (5)", \
	sprintf(format, arch, node, dir, threads, 9, stride, j, arr, workers, type) with lines lc rgb "#000000" lw 2 title "SDL (9)", \
	sprintf(format, arch, node, dir, threads, 13, stride, j, arr, workers, type) with lines lc rgb "#007f00" lw 2 title "ML no-sse (13)", \
	sprintf(format, arch, node, dir, threads, 14, stride, j, arr, workers, type) with lines lc rgb "#7f007f" lw 2 title "DL no-sse (14)", \
	sprintf(format, arch, node, dir, threads, 15, stride, j, arr, workers, type) with lines lc rgb "#007f7f" lw 2 title "DL (15)", \
	sprintf(format, arch, node, dir, threads, 16, stride, j, arr, workers, type) with lines lc rgb "#00ff00" lw 2 title "DL (16)"

#############################################################################

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

threads = 1
stride = 2
j = 1

unset arrow

# L1cache = 32*1024
# set arrow from L1cache/4,graph(0,0) to L1cache/4,graph(1,1) nohead

# L2cache = 3072*1024
# set arrow from L2cache/4,graph(0,0) to L2cache/4,graph(1,1) nohead

plot \
	sprintf(format, arch, node, dir, threads,  0, stride, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "horizontal", \
	sprintf(format, arch, node, dir, threads,  9, stride, j, arr, workers, type) with lines lc rgb "#000000" lw 2 title "diagonal", \
	sprintf(format, arch, node, dir, threads, 16, stride, j, arr, workers, type) with lines lc rgb "#00ff00" lw 2 title "vertical"

#############################################################################

set terminal svg enhanced size 640 420
set output "accel-asvp.svg"
set xlabel "samples"
set ylabel "seconds / sample"
set format x "%.1s%c"
set format y "%.1s%c"
set logscale x
set logscale y

arch = "microblaze"
node = "asvpsys"
threads = 1
stride = 2
j = 1

unset arrow

plot \
	sprintf(format, arch, node, dir, threads, 0, stride, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "ML/CPU (0)", \
	sprintf(format, arch, node, dir, threads, 1, stride, j, arr, workers, type) with lines lc rgb "#0000ff" lw 2 title "ML/BCE (1)", \
	sprintf(format, arch, node, dir, threads, 4, stride, j, arr, workers, type) with lines lc rgb "#00ff00" lw 2 title "DL (4)", \
	sprintf(format, arch, node, dir, threads, 5, stride, j, arr, workers, type) with lines lc rgb "#000000" lw 2 title "SDL (5)"
