\documentclass[]{standalone}
\input{config-gfx}

\begin{document}
\def\axisdefaultwidth{10cm}
\def\axisdefaultheight{7cm}
%% read data
\pgfplotstableread[col sep=comma, header=true, read completely=true]{outputs_runtime_measurement.csv}\outputsTable %_nonpinned
\begin{tikzpicture}
  \begin{loglogaxis}[
      scalingplot,
      xlabel=Number of Input Elements (216 input features per element),
      ylabel=Run Time per Inference Step,
      y unit=\si{\second},
      ymin=1e-5,
      ymax=3,
      xmax=32768,
    ]
    % \foreach \c [count=\x from 0] in { deeprleddy-gcc-open-dnnl,deeprleddy-gcc-open-libtorch,deeprleddy-gcc-open-pytorch,deeprleddy-gcc-mkl-dnnl,deeprleddy-intel-open-fortran,deeprleddy-intel-open-dnnl,deeprleddy-intel-open-libtorch,deeprleddy-intel-open-pytorch,deeprleddy-intel-mkl-dnnl}
    %     {\addplot+ table[y expr=\thisrow{\c}] {\outputsTable};\addlegendentry{\c{}};}
    \addplot[pytorch] table[y expr=\thisrow{deeprleddy-intel-mkl-pytorch}] {\outputsTable};\label{plot:pytorch}
    \addlegendentry{\torchpython};
    \addplot[libtorch] table[y expr=\thisrow{deeprleddy-intel-open-libtorch}] {\outputsTable};\label{plot:libtorch}
    \addlegendentry{\torchcpp};
    % \addplot[dnnl-open] table[y expr=\thisrow{deeprleddy-intel-open-dnnl}] {\outputsTable};\label{plot:onednnopen}
    % \addlegendentry{\onednnopen};
    \addplot[dnnl-mkl] table[y expr=\thisrow{deeprleddy-intel-mkl-dnnl}] {\outputsTable};\label{plot:onednnmkl}
    \addlegendentry{\onednnmkl};
    \addplot[fortran-only] table[y expr=\thisrow{deeprleddy-intel-open-fortran}] {\outputsTable};\label{plot:fortran}
    \addlegendentry{\fortran};
    % have a function plot for linear slope
    \addplot+ [domain=512:262144, linear] {x/180000};
  \coordinate[xshift=10ex](legendpos) at (170, 0.000045);
\end{loglogaxis}
  \matrix[
    matrix of nodes,
    % anchor=west,
    draw,
    inner sep=0.2em,
    nodes={font=\footnotesize},
    fill=white,
  ]at(legendpos)
  {
    \ref{plot:pytorch} \ref{plot:libtorch} & without \dalotia{}         & [5pt]\\
    \ref{plot:onednnmkl} \ref{plot:fortran} & with \dalotia{}           & [5pt]\\
    };
\end{tikzpicture}
\end{document}
