\caption{CUDA Algorithm to find roots with the Ehrlich-Aberth method}
\KwIn{$Z^{0}$ (Initial root's vector), $\varepsilon$ (error tolerance
- threshold), P(Polynomial to solve), Pu (the derivative of P), $n$ (Polynomial's degrees), $\Delta z_{max}$ (maximum value of stop condition)}
+ threshold), P (Polynomial to solve), Pu (Derivative of P), $n$ (Polynomial's degrees), $\Delta z_{max}$ (Maximum value of stop condition)}
-\KwOut {$Z$ (The solution root's vector), $ZPrec$ (the previous solution root's vector)}
+\KwOut {$Z$ (Solution root's vector), $ZPrec$ (Previous solution root's vector)}
\BlankLine
\end{algorithm}
~\\
-After the initialization step, all data of the root finding problem to be solved must be copied from the CPU memory to the GPU global memory, because the GPUs only access data already present in their memories. Next, all the data-parallel arithmetic operations inside the main loop \verb=(do ... while(...))= are executed as kernels by the GPU. The first kernel named \textit{save} in line 6 of Algorithm~\ref{alg2-cuda} consists in saving the vector of polynomial's root found at the previous time-step in GPU memory, in order to check the convergence of the roots after each iteration (line 8, Algorithm~\ref{alg2-cuda}).
+After the initialization step, all data of the root finding problem
+must be copied from the CPU memory to the GPU global memory. Next, all
+the data-parallel arithmetic operations inside the main loop
+\verb=(while(...))= are executed as kernels by the GPU. The
+first kernel named \textit{save} in line 6 of
+Algorithm~\ref{alg2-cuda} consists in saving the vector of
+polynomial's root found at the previous time-step in GPU memory, in
+order to check the convergence of the roots after each iteration (line
+8, Algorithm~\ref{alg2-cuda}).
The second kernel executes the iterative function $H$ and updates
-$d\_Z$, according to Algorithm~\ref{alg3-update}. We notice that the
-update kernel is called in two forms, separated with the value of
+Z, according to Algorithm~\ref{alg3-update}. We notice that the
+update kernel is called in two forms, according to the value
\emph{R} which determines the radius beyond which we apply the
exponential logarithm algorithm.
\caption{Kernel update}
\eIf{$(\left|Z\right|<= R)$}{
-$kernel\_update((Z,P,Pu)$\;}
+$kernel\_update(Z,P,Pu)$\;}
{
-$kernel\_update\_ExpoLog((Z,P,Pu))$\;
+$kernel\_update\_ExpoLog(Z,P,Pu)$\;
}
\end{algorithm}