Incomplete iffalse in specific lstlisting regardless of contentsIncomplete iffalse related listlisting,...

Does Windows 10's telemetry include sending *.doc files if Word crashed?

Visa application for Canada: Should douments in the local language of the consulate's location be translated?

Two functions in the same line

Do commercial flights continue with an engine out?

Does this pattern of summing polygonal numbers to get a square repeat indefinitely?

Word to be used for "standing with your toes pointing out"

Finding ratio of the area of triangles

How to push a box with physics engine by another object?

Cyclical Argument in Plato's Phaedo

List of numbers giving a particular sum

Is the theory of the category of topological spaces computable?

By American Standards

How do you enable SQL Server 2019's result set caching?

Making an empty box next to text

How to add multiple differently colored borders around a node?

Incompressible fluid definition

c++ How can I make an algorithm for finding variations of a set without repetition (i.e. n elements, choose k)?

Activating a Alphanet Faucet Wallet Remotely (without tezos-client)

What do these brackets mean?

If all harmonics are generated by plucking, how does a guitar string produce a pure frequency sound?

Does the UA Artillerist Artificer's Wand Prototype feature increase cantrip damage once per damage roll, or per casting?

What is the wife of a henpecked husband called?

Why didn't Eru and/or the Valar intervene when Sauron corrupted Númenor?

Overfitting and Underfitting



Incomplete iffalse in specific lstlisting regardless of contents


Incomplete iffalse related listlisting, textit and textcolor“Incomplete iffalse; all text was ignored after line x” with lstlistingnewenvironment gives error with lstlistingLstlisting format Java codeEmphasize hex number in lstlisting using font colorUnderscore and asterisk color in lstlisting stringError to compile lstlistingCustomize keyword lstlistinglstlisting - macro only for specific languagehow to use accents inside a lstlistingIncomplete iffalse related listlisting, textit and textcolor













0















I have a LaTeX code which gives me these errors at a specific line :




  • Incomplete iffalse; all text was ignored after line 140.


  • Forbidden control sequence found while scanning text of write. at line 140


and then in at the end of the document:




  • Argument of @gobble has an extra }. end{document}

  • Missing } inserted. end{document}

  • etc.


The following code threw the error (line 140 being y[ row[i] ] += ... in section{COO Kernel}):



documentclass[11pt,oneside,czech,american]{book}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}
geometry{verbose,tmargin=4cm,bmargin=3cm,lmargin=3cm,rmargin=2cm,headheight=0.8cm,headsep=1cm,footskip=0.5cm}
pagestyle{headings}
setcounter{secnumdepth}{3}
usepackage{url}
usepackage{listings}
usepackage{textcomp}
usepackage{amsmath}
usepackage{xcolor}

makeatletter

newenvironment{lyxlist}[1]
{begin{list}{}
{settowidth{labelwidth}{#1}
setlength{leftmargin}{labelwidth}
addtolength{leftmargin}{labelsep}
renewcommand{makelabel}[1]{##1hfil}}}
{end{list}}
usepackage[varg]{txfonts}
usepackage{indentfirst}

clubpenalty=9500

widowpenalty=9500

hyphenation{CDFA HARDI HiPPIES IKEM InterTrack MEGIDDO MIMD MPFA DICOM ASCLEPIOS MedInria}

definecolor{light-gray}{gray}{0.95}
newcommand{code}[1]{colorbox{light-gray}{texttt{#1}}}

definecolor{listinggray}{gray}{0.9}
definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
definecolor{Darkgreen}{rgb}{0.0, 0.2, 0.13}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=[GNU]C++,
basicstyle=scriptsize,
upquote=true,
aboveskip={0.001baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=false,
breaklines=true,
prebreak = raisebox{0ex}[0ex][0ex]{ensuremath{hookleftarrow}},
frame=single,
numbers=left,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=ttfamily,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color[rgb]{0.026,0.112,0.095},
stringstyle=color[rgb]{0.627,0.126,0.941},
numberstyle=color[rgb]{0.205, 0.142, 0.73},
}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=C++,
captionpos=b,
tabsize=3,
frame=lines,
numbers=left,
numberstyle=tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
basicstyle=footnotesize,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color{Darkgreen},
stringstyle=color{red},
}
lstset{
morekeywords={__global__},
alsoletter={.},
morekeywords={blockDim.x},
morekeywords={blockIdx.x},
morekeywords={threadIdx.x}
}

usepackage{babel}
begin{document}
tableofcontents{}

chapter*{Implementation/Kernels of formats}

addcontentsline{toc}{chapter}{Implementation/Kernels of formats}

setcounter{chapter}{3}
setcounter{section}{0}

section{DIAG Kernel}

begin{lstlisting}[caption= SpMV pseudocode using DIAG format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_dia_kernel ( const int num_rows,
const int num_cols,
const int num_diags,
const int * offsets,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_diags; n++ ){
int col = row + offsets[ n ];
float val = data[ num_rows * n + row ];

if ( col >= 0 && col < num_cols )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}
label{Code:Diagonal-matrix-example}

section{COO Kernel}

begin{lstlisting}[caption= SpMV pseudocode using COO format for storing a matrix cite{Parallel-Uppsala}.]
__global__ void
spmv_coo_kernel ( const int num_non_zero_elements,
const float * data,
const int * row,
const int * col,
const float * x,
float * y )
{
int i = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_non_zero_elements )
y[ row[i] ] += data[i] * x[ col[i] ];
}
end{lstlisting}

section{ELL Oriented Kernels}

subsection{ELL Kernel}

begin{lstlisting}[caption = SpMV pseudocode using ELL format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_ell_kernel ( const int num_rows,
const int num_cols,
const int num_cols_per_row,
const int * indices,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;

if( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_cols_per_row; n++ ){
int col = indices[ num_rows * n + row ];
float val = data[ num_rows * n + row ];

if ( val != 0 )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}

begin{thebibliography}{1}
bibitem{Bell-Garland}N Bell, M. Garland: emph{Efficient sparse matrix-vector multiplication on CUDA}. NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation, 1-32, 2008.

bibitem{Parallel-Uppsala}D. Lukarski: emph{Sparse Matrix-Vector Multiplication and Matrix Formats}. Parallel Algorithms for Scientific Computing, Uppsala University, 2013. url{https://www.it.uu.se/education/phd_studies/phd_courses/pasc/lecture-1}
end{thebibliography}

end{document}


For some reason, citations to bibitems are undefined, even though there don't seem to be any spelling error.



To even compile the document correctly if I roll back the changes that led to the error, I have to delete the .aux and .toc files.



I'm pretty much dumb founded.



PS: The preamble was created by a professor as a template for all students to use, I was told not to meddle with it.



[EDIT]: Created minimal same-error outputting example as suggested.



[EDIT]: Added log file.



[EDIT]: Removed GitHub link, full project link and log file link, since they aren't necessary for the answer. I'll put them in a separate folder and won't remove it, if anyone wants to look at them. If for any reason the links will be broken, please let me know, and I'll renew them somehow, since I'll be keeping a backup of said files aswell.










share|improve this question









New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Don't link to external files like that. Try to make a complete minimal example that you can copy here.

    – Ulrike Fischer
    yesterday











  • But try if it works if you remove the cite command.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

    – Kappasenpai
    yesterday













  • Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

    – Kappasenpai
    yesterday
















0















I have a LaTeX code which gives me these errors at a specific line :




  • Incomplete iffalse; all text was ignored after line 140.


  • Forbidden control sequence found while scanning text of write. at line 140


and then in at the end of the document:




  • Argument of @gobble has an extra }. end{document}

  • Missing } inserted. end{document}

  • etc.


The following code threw the error (line 140 being y[ row[i] ] += ... in section{COO Kernel}):



documentclass[11pt,oneside,czech,american]{book}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}
geometry{verbose,tmargin=4cm,bmargin=3cm,lmargin=3cm,rmargin=2cm,headheight=0.8cm,headsep=1cm,footskip=0.5cm}
pagestyle{headings}
setcounter{secnumdepth}{3}
usepackage{url}
usepackage{listings}
usepackage{textcomp}
usepackage{amsmath}
usepackage{xcolor}

makeatletter

newenvironment{lyxlist}[1]
{begin{list}{}
{settowidth{labelwidth}{#1}
setlength{leftmargin}{labelwidth}
addtolength{leftmargin}{labelsep}
renewcommand{makelabel}[1]{##1hfil}}}
{end{list}}
usepackage[varg]{txfonts}
usepackage{indentfirst}

clubpenalty=9500

widowpenalty=9500

hyphenation{CDFA HARDI HiPPIES IKEM InterTrack MEGIDDO MIMD MPFA DICOM ASCLEPIOS MedInria}

definecolor{light-gray}{gray}{0.95}
newcommand{code}[1]{colorbox{light-gray}{texttt{#1}}}

definecolor{listinggray}{gray}{0.9}
definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
definecolor{Darkgreen}{rgb}{0.0, 0.2, 0.13}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=[GNU]C++,
basicstyle=scriptsize,
upquote=true,
aboveskip={0.001baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=false,
breaklines=true,
prebreak = raisebox{0ex}[0ex][0ex]{ensuremath{hookleftarrow}},
frame=single,
numbers=left,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=ttfamily,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color[rgb]{0.026,0.112,0.095},
stringstyle=color[rgb]{0.627,0.126,0.941},
numberstyle=color[rgb]{0.205, 0.142, 0.73},
}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=C++,
captionpos=b,
tabsize=3,
frame=lines,
numbers=left,
numberstyle=tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
basicstyle=footnotesize,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color{Darkgreen},
stringstyle=color{red},
}
lstset{
morekeywords={__global__},
alsoletter={.},
morekeywords={blockDim.x},
morekeywords={blockIdx.x},
morekeywords={threadIdx.x}
}

usepackage{babel}
begin{document}
tableofcontents{}

chapter*{Implementation/Kernels of formats}

addcontentsline{toc}{chapter}{Implementation/Kernels of formats}

setcounter{chapter}{3}
setcounter{section}{0}

section{DIAG Kernel}

begin{lstlisting}[caption= SpMV pseudocode using DIAG format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_dia_kernel ( const int num_rows,
const int num_cols,
const int num_diags,
const int * offsets,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_diags; n++ ){
int col = row + offsets[ n ];
float val = data[ num_rows * n + row ];

if ( col >= 0 && col < num_cols )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}
label{Code:Diagonal-matrix-example}

section{COO Kernel}

begin{lstlisting}[caption= SpMV pseudocode using COO format for storing a matrix cite{Parallel-Uppsala}.]
__global__ void
spmv_coo_kernel ( const int num_non_zero_elements,
const float * data,
const int * row,
const int * col,
const float * x,
float * y )
{
int i = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_non_zero_elements )
y[ row[i] ] += data[i] * x[ col[i] ];
}
end{lstlisting}

section{ELL Oriented Kernels}

subsection{ELL Kernel}

begin{lstlisting}[caption = SpMV pseudocode using ELL format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_ell_kernel ( const int num_rows,
const int num_cols,
const int num_cols_per_row,
const int * indices,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;

if( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_cols_per_row; n++ ){
int col = indices[ num_rows * n + row ];
float val = data[ num_rows * n + row ];

if ( val != 0 )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}

begin{thebibliography}{1}
bibitem{Bell-Garland}N Bell, M. Garland: emph{Efficient sparse matrix-vector multiplication on CUDA}. NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation, 1-32, 2008.

bibitem{Parallel-Uppsala}D. Lukarski: emph{Sparse Matrix-Vector Multiplication and Matrix Formats}. Parallel Algorithms for Scientific Computing, Uppsala University, 2013. url{https://www.it.uu.se/education/phd_studies/phd_courses/pasc/lecture-1}
end{thebibliography}

end{document}


For some reason, citations to bibitems are undefined, even though there don't seem to be any spelling error.



To even compile the document correctly if I roll back the changes that led to the error, I have to delete the .aux and .toc files.



I'm pretty much dumb founded.



PS: The preamble was created by a professor as a template for all students to use, I was told not to meddle with it.



[EDIT]: Created minimal same-error outputting example as suggested.



[EDIT]: Added log file.



[EDIT]: Removed GitHub link, full project link and log file link, since they aren't necessary for the answer. I'll put them in a separate folder and won't remove it, if anyone wants to look at them. If for any reason the links will be broken, please let me know, and I'll renew them somehow, since I'll be keeping a backup of said files aswell.










share|improve this question









New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Don't link to external files like that. Try to make a complete minimal example that you can copy here.

    – Ulrike Fischer
    yesterday











  • But try if it works if you remove the cite command.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

    – Kappasenpai
    yesterday













  • Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

    – Kappasenpai
    yesterday














0












0








0








I have a LaTeX code which gives me these errors at a specific line :




  • Incomplete iffalse; all text was ignored after line 140.


  • Forbidden control sequence found while scanning text of write. at line 140


and then in at the end of the document:




  • Argument of @gobble has an extra }. end{document}

  • Missing } inserted. end{document}

  • etc.


The following code threw the error (line 140 being y[ row[i] ] += ... in section{COO Kernel}):



documentclass[11pt,oneside,czech,american]{book}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}
geometry{verbose,tmargin=4cm,bmargin=3cm,lmargin=3cm,rmargin=2cm,headheight=0.8cm,headsep=1cm,footskip=0.5cm}
pagestyle{headings}
setcounter{secnumdepth}{3}
usepackage{url}
usepackage{listings}
usepackage{textcomp}
usepackage{amsmath}
usepackage{xcolor}

makeatletter

newenvironment{lyxlist}[1]
{begin{list}{}
{settowidth{labelwidth}{#1}
setlength{leftmargin}{labelwidth}
addtolength{leftmargin}{labelsep}
renewcommand{makelabel}[1]{##1hfil}}}
{end{list}}
usepackage[varg]{txfonts}
usepackage{indentfirst}

clubpenalty=9500

widowpenalty=9500

hyphenation{CDFA HARDI HiPPIES IKEM InterTrack MEGIDDO MIMD MPFA DICOM ASCLEPIOS MedInria}

definecolor{light-gray}{gray}{0.95}
newcommand{code}[1]{colorbox{light-gray}{texttt{#1}}}

definecolor{listinggray}{gray}{0.9}
definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
definecolor{Darkgreen}{rgb}{0.0, 0.2, 0.13}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=[GNU]C++,
basicstyle=scriptsize,
upquote=true,
aboveskip={0.001baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=false,
breaklines=true,
prebreak = raisebox{0ex}[0ex][0ex]{ensuremath{hookleftarrow}},
frame=single,
numbers=left,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=ttfamily,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color[rgb]{0.026,0.112,0.095},
stringstyle=color[rgb]{0.627,0.126,0.941},
numberstyle=color[rgb]{0.205, 0.142, 0.73},
}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=C++,
captionpos=b,
tabsize=3,
frame=lines,
numbers=left,
numberstyle=tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
basicstyle=footnotesize,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color{Darkgreen},
stringstyle=color{red},
}
lstset{
morekeywords={__global__},
alsoletter={.},
morekeywords={blockDim.x},
morekeywords={blockIdx.x},
morekeywords={threadIdx.x}
}

usepackage{babel}
begin{document}
tableofcontents{}

chapter*{Implementation/Kernels of formats}

addcontentsline{toc}{chapter}{Implementation/Kernels of formats}

setcounter{chapter}{3}
setcounter{section}{0}

section{DIAG Kernel}

begin{lstlisting}[caption= SpMV pseudocode using DIAG format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_dia_kernel ( const int num_rows,
const int num_cols,
const int num_diags,
const int * offsets,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_diags; n++ ){
int col = row + offsets[ n ];
float val = data[ num_rows * n + row ];

if ( col >= 0 && col < num_cols )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}
label{Code:Diagonal-matrix-example}

section{COO Kernel}

begin{lstlisting}[caption= SpMV pseudocode using COO format for storing a matrix cite{Parallel-Uppsala}.]
__global__ void
spmv_coo_kernel ( const int num_non_zero_elements,
const float * data,
const int * row,
const int * col,
const float * x,
float * y )
{
int i = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_non_zero_elements )
y[ row[i] ] += data[i] * x[ col[i] ];
}
end{lstlisting}

section{ELL Oriented Kernels}

subsection{ELL Kernel}

begin{lstlisting}[caption = SpMV pseudocode using ELL format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_ell_kernel ( const int num_rows,
const int num_cols,
const int num_cols_per_row,
const int * indices,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;

if( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_cols_per_row; n++ ){
int col = indices[ num_rows * n + row ];
float val = data[ num_rows * n + row ];

if ( val != 0 )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}

begin{thebibliography}{1}
bibitem{Bell-Garland}N Bell, M. Garland: emph{Efficient sparse matrix-vector multiplication on CUDA}. NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation, 1-32, 2008.

bibitem{Parallel-Uppsala}D. Lukarski: emph{Sparse Matrix-Vector Multiplication and Matrix Formats}. Parallel Algorithms for Scientific Computing, Uppsala University, 2013. url{https://www.it.uu.se/education/phd_studies/phd_courses/pasc/lecture-1}
end{thebibliography}

end{document}


For some reason, citations to bibitems are undefined, even though there don't seem to be any spelling error.



To even compile the document correctly if I roll back the changes that led to the error, I have to delete the .aux and .toc files.



I'm pretty much dumb founded.



PS: The preamble was created by a professor as a template for all students to use, I was told not to meddle with it.



[EDIT]: Created minimal same-error outputting example as suggested.



[EDIT]: Added log file.



[EDIT]: Removed GitHub link, full project link and log file link, since they aren't necessary for the answer. I'll put them in a separate folder and won't remove it, if anyone wants to look at them. If for any reason the links will be broken, please let me know, and I'll renew them somehow, since I'll be keeping a backup of said files aswell.










share|improve this question









New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have a LaTeX code which gives me these errors at a specific line :




  • Incomplete iffalse; all text was ignored after line 140.


  • Forbidden control sequence found while scanning text of write. at line 140


and then in at the end of the document:




  • Argument of @gobble has an extra }. end{document}

  • Missing } inserted. end{document}

  • etc.


The following code threw the error (line 140 being y[ row[i] ] += ... in section{COO Kernel}):



documentclass[11pt,oneside,czech,american]{book}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[a4paper]{geometry}
geometry{verbose,tmargin=4cm,bmargin=3cm,lmargin=3cm,rmargin=2cm,headheight=0.8cm,headsep=1cm,footskip=0.5cm}
pagestyle{headings}
setcounter{secnumdepth}{3}
usepackage{url}
usepackage{listings}
usepackage{textcomp}
usepackage{amsmath}
usepackage{xcolor}

makeatletter

newenvironment{lyxlist}[1]
{begin{list}{}
{settowidth{labelwidth}{#1}
setlength{leftmargin}{labelwidth}
addtolength{leftmargin}{labelsep}
renewcommand{makelabel}[1]{##1hfil}}}
{end{list}}
usepackage[varg]{txfonts}
usepackage{indentfirst}

clubpenalty=9500

widowpenalty=9500

hyphenation{CDFA HARDI HiPPIES IKEM InterTrack MEGIDDO MIMD MPFA DICOM ASCLEPIOS MedInria}

definecolor{light-gray}{gray}{0.95}
newcommand{code}[1]{colorbox{light-gray}{texttt{#1}}}

definecolor{listinggray}{gray}{0.9}
definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
definecolor{Darkgreen}{rgb}{0.0, 0.2, 0.13}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=[GNU]C++,
basicstyle=scriptsize,
upquote=true,
aboveskip={0.001baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=false,
breaklines=true,
prebreak = raisebox{0ex}[0ex][0ex]{ensuremath{hookleftarrow}},
frame=single,
numbers=left,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=ttfamily,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color[rgb]{0.026,0.112,0.095},
stringstyle=color[rgb]{0.627,0.126,0.941},
numberstyle=color[rgb]{0.205, 0.142, 0.73},
}
lstset{
backgroundcolor=color{lbcolor},
tabsize=4,
language=C++,
captionpos=b,
tabsize=3,
frame=lines,
numbers=left,
numberstyle=tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
basicstyle=footnotesize,
keywordstyle=color[rgb]{0,0,1},
commentstyle=color{Darkgreen},
stringstyle=color{red},
}
lstset{
morekeywords={__global__},
alsoletter={.},
morekeywords={blockDim.x},
morekeywords={blockIdx.x},
morekeywords={threadIdx.x}
}

usepackage{babel}
begin{document}
tableofcontents{}

chapter*{Implementation/Kernels of formats}

addcontentsline{toc}{chapter}{Implementation/Kernels of formats}

setcounter{chapter}{3}
setcounter{section}{0}

section{DIAG Kernel}

begin{lstlisting}[caption= SpMV pseudocode using DIAG format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_dia_kernel ( const int num_rows,
const int num_cols,
const int num_diags,
const int * offsets,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_diags; n++ ){
int col = row + offsets[ n ];
float val = data[ num_rows * n + row ];

if ( col >= 0 && col < num_cols )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}
label{Code:Diagonal-matrix-example}

section{COO Kernel}

begin{lstlisting}[caption= SpMV pseudocode using COO format for storing a matrix cite{Parallel-Uppsala}.]
__global__ void
spmv_coo_kernel ( const int num_non_zero_elements,
const float * data,
const int * row,
const int * col,
const float * x,
float * y )
{
int i = blockDim.x * blockIdx.x + threadIdx.x;
if ( row < num_non_zero_elements )
y[ row[i] ] += data[i] * x[ col[i] ];
}
end{lstlisting}

section{ELL Oriented Kernels}

subsection{ELL Kernel}

begin{lstlisting}[caption = SpMV pseudocode using ELL format for storing a matrix from textit{Efficient sparse matrix-vector multiplication on CUDA} cite{Bell-Garland}.]
__global__ void
spmv_ell_kernel ( const int num_rows,
const int num_cols,
const int num_cols_per_row,
const int * indices,
const float * data,
const float * x,
float * y )
{
int row = blockDim.x * blockIdx.x + threadIdx.x;

if( row < num_rows ){
float dot = 0;

for ( int n = 0; n < num_cols_per_row; n++ ){
int col = indices[ num_rows * n + row ];
float val = data[ num_rows * n + row ];

if ( val != 0 )
dot += val * x[ col ];
}

y[ row ] += dot;
}
}
end{lstlisting}

begin{thebibliography}{1}
bibitem{Bell-Garland}N Bell, M. Garland: emph{Efficient sparse matrix-vector multiplication on CUDA}. NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation, 1-32, 2008.

bibitem{Parallel-Uppsala}D. Lukarski: emph{Sparse Matrix-Vector Multiplication and Matrix Formats}. Parallel Algorithms for Scientific Computing, Uppsala University, 2013. url{https://www.it.uu.se/education/phd_studies/phd_courses/pasc/lecture-1}
end{thebibliography}

end{document}


For some reason, citations to bibitems are undefined, even though there don't seem to be any spelling error.



To even compile the document correctly if I roll back the changes that led to the error, I have to delete the .aux and .toc files.



I'm pretty much dumb founded.



PS: The preamble was created by a professor as a template for all students to use, I was told not to meddle with it.



[EDIT]: Created minimal same-error outputting example as suggested.



[EDIT]: Added log file.



[EDIT]: Removed GitHub link, full project link and log file link, since they aren't necessary for the answer. I'll put them in a separate folder and won't remove it, if anyone wants to look at them. If for any reason the links will be broken, please let me know, and I'll renew them somehow, since I'll be keeping a backup of said files aswell.







bibliographies compiling lstlisting






share|improve this question









New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday







Kappasenpai













New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









KappasenpaiKappasenpai

32




32




New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Don't link to external files like that. Try to make a complete minimal example that you can copy here.

    – Ulrike Fischer
    yesterday











  • But try if it works if you remove the cite command.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

    – Kappasenpai
    yesterday













  • Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

    – Kappasenpai
    yesterday



















  • Don't link to external files like that. Try to make a complete minimal example that you can copy here.

    – Ulrike Fischer
    yesterday











  • But try if it works if you remove the cite command.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

    – Kappasenpai
    yesterday













  • Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

    – Ulrike Fischer
    yesterday











  • @UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

    – Kappasenpai
    yesterday

















Don't link to external files like that. Try to make a complete minimal example that you can copy here.

– Ulrike Fischer
yesterday





Don't link to external files like that. Try to make a complete minimal example that you can copy here.

– Ulrike Fischer
yesterday













But try if it works if you remove the cite command.

– Ulrike Fischer
yesterday





But try if it works if you remove the cite command.

– Ulrike Fischer
yesterday













@UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

– Kappasenpai
yesterday







@UlrikeFischer The problem with this error, is that it seems to all be connected, not specific lstlisting based, so I have no idea which parts are actually causing it. That's why I included the example where it happens and then the entire code for context. I tried removing all cite commands and each of them separately, still exactly the same output.

– Kappasenpai
yesterday















Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

– Ulrike Fischer
yesterday





Well I won't go to some external site, download a complete project and debug your code. Copy your code to some test folder and then start to remove stuff until you get something small enough that you can post it here.

– Ulrike Fischer
yesterday













@UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

– Kappasenpai
yesterday





@UlrikeFischer I've edited my question, tried to minimize the entire document to the relevant code. It's still 184 lines, but if I delete some more, it loses the error producing structure.

– Kappasenpai
yesterday










1 Answer
1






active

oldest

votes


















0














The solution to this problem was to update my MiKTeX in user and admin mode, just like @UlrikeFischer said:




Update your tex system - most importantly the listings package. With the newest version it works again. (Check for updates in user and admin mode).




Apologies for stealing the answer, I just want to close this solved question and not spam further, by asking for a comment to be written as an answer.



If you would like for me to accept your answer, please, answer anytime, and I'll accept it back.






share|improve this answer










New contributor




Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Kappasenpai is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477417%2fincomplete-iffalse-in-specific-lstlisting-regardless-of-contents%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The solution to this problem was to update my MiKTeX in user and admin mode, just like @UlrikeFischer said:




    Update your tex system - most importantly the listings package. With the newest version it works again. (Check for updates in user and admin mode).




    Apologies for stealing the answer, I just want to close this solved question and not spam further, by asking for a comment to be written as an answer.



    If you would like for me to accept your answer, please, answer anytime, and I'll accept it back.






    share|improve this answer










    New contributor




    Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      The solution to this problem was to update my MiKTeX in user and admin mode, just like @UlrikeFischer said:




      Update your tex system - most importantly the listings package. With the newest version it works again. (Check for updates in user and admin mode).




      Apologies for stealing the answer, I just want to close this solved question and not spam further, by asking for a comment to be written as an answer.



      If you would like for me to accept your answer, please, answer anytime, and I'll accept it back.






      share|improve this answer










      New contributor




      Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        The solution to this problem was to update my MiKTeX in user and admin mode, just like @UlrikeFischer said:




        Update your tex system - most importantly the listings package. With the newest version it works again. (Check for updates in user and admin mode).




        Apologies for stealing the answer, I just want to close this solved question and not spam further, by asking for a comment to be written as an answer.



        If you would like for me to accept your answer, please, answer anytime, and I'll accept it back.






        share|improve this answer










        New contributor




        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        The solution to this problem was to update my MiKTeX in user and admin mode, just like @UlrikeFischer said:




        Update your tex system - most importantly the listings package. With the newest version it works again. (Check for updates in user and admin mode).




        Apologies for stealing the answer, I just want to close this solved question and not spam further, by asking for a comment to be written as an answer.



        If you would like for me to accept your answer, please, answer anytime, and I'll accept it back.







        share|improve this answer










        New contributor




        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer








        edited 5 hours ago





















        New contributor




        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 12 hours ago









        KappasenpaiKappasenpai

        32




        32




        New contributor




        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Kappasenpai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






















            Kappasenpai is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Kappasenpai is a new contributor. Be nice, and check out our Code of Conduct.













            Kappasenpai is a new contributor. Be nice, and check out our Code of Conduct.












            Kappasenpai is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477417%2fincomplete-iffalse-in-specific-lstlisting-regardless-of-contents%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

            How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...