# sprintf(format, arch, node, dir, threads, accel, stride, j, arr, workers, type)
format = "data/dir=%s.threads=%d.accel=%i.opt-stride=%i.j=%i.arr=%s.workers=%i.type=%s.txt"

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

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

dir = "fwd"
threads = 1
stride = 2
j = 1
arr = "packed"
workers = 1
type = "float"

unset arrow

if("x86_64" eq system("uname -m")){
	L1cache = system("getconf LEVEL1_DCACHE_SIZE")
	set arrow from L1cache/4,graph(0,0) to L1cache/4,graph(1,1) nohead
	L2cache = system("getconf LEVEL2_CACHE_SIZE")
	set arrow from L2cache/4,graph(0,0) to L2cache/4,graph(1,1) nohead
}

plot \
	sprintf(format, dir, threads,  0, stride, j, arr, workers, type) with lines lc rgb "#ff0000" lw 2 title "ML (0)", \
	sprintf(format, dir, threads,  1, stride, j, arr, workers, type) with lines lc rgb "#ff007f" lw 2 title "ML/BCE (1)", \
	sprintf(format, dir, threads,  4, stride, j, arr, workers, type) with lines lc rgb "#00ff00" lw 2 title "DL (4)", \
	sprintf(format, dir, threads,  5, stride, j, arr, workers, type) with lines lc rgb "#000000" lw 2 title "SDL (5)", \
	sprintf(format, dir, threads,  6, stride, j, arr, workers, type) with lines lc rgb "#00003f" lw 2 title "SDL2 (6)", \
	sprintf(format, dir, threads,  7, stride, j, arr, workers, type) with lines lc rgb "#003f00" lw 2 title "SDL6 (7)", \
	sprintf(format, dir, threads,  9, stride, j, arr, workers, type) with lines lc rgb "#003f3f" lw 2 title "SDL6/SSE (9)", \
	sprintf(format, dir, threads, 13, stride, j, arr, workers, type) with lines lc rgb "#ff7f00" lw 2 title "ML/NOSSE (13)", \
	sprintf(format, dir, threads, 14, stride, j, arr, workers, type) with lines lc rgb "#3fff00" lw 2 title "DL/NOSSE (14)", \
	sprintf(format, dir, threads, 15, stride, j, arr, workers, type) with lines lc rgb "#3fff3f" lw 2 title "DL4L (15)", \
	sprintf(format, dir, threads, 16, stride, j, arr, workers, type) with lines lc rgb "#00ff7f" lw 2 title "DL4L/SSE (16)"
