From 78be06acc12fcd57616e8c197a6793c4467be9d3 Mon Sep 17 00:00:00 2001 From: Kahina Date: Mon, 2 May 2016 08:48:40 +0200 Subject: [PATCH] Ajout du code Kernel testConvergence --- maj.tex | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/maj.tex b/maj.tex index 30c1a9e..2b24a34 100644 --- a/maj.tex +++ b/maj.tex @@ -740,8 +740,7 @@ function Eq.~\ref{Eq:Hi} is executed, else the EA.EL function Eq.~\ref{Log_H2} i \end{itemize} -\KG{Listing ~\ref{lst:01} shows the main kernel of the iterative function -shows the a simplified version of second kernel +\KG{Listing ~\ref{lst:01} shows a simplified version of second kernel code (some parameters in the kernels have been simplified in order to increase the readability). As can be seen this kernel calls multiple kernels, all the kernels for complex numbers and @@ -763,7 +762,7 @@ This kernel is executed by a large number of GPU threads such that each thread i \[ Blocks=\frac{N+Threads-1}{Threads}, N: Polynomial size \] %$ Blocks=\frac{N+Threads-1}{Threads}, N: Polynomial size$ -Each GPU threads in grid compute one root en parallel, if the polynomial size exceed the capacity of the grid the G.S schema are finely executed, like the grid can only compute << Blocks,Threads>> roots at the same time, if we ned to compute more roots, the grid can used the roots previously executed to compute other root ih the same iteration, like the following schema: +Each GPU threads in grid compute one root en parallel, if the polynomial size exceed the capacity of the grid the G.S schema are finely executed, like the grid can only compute << Blocks,Threads>> roots at the same time, if we need to compute more roots, the grid can used the roots previously executed to compute other root ih the same iteration, like the following schema: %\begin{figure}[htbp] %\centering @@ -771,9 +770,13 @@ Each GPU threads in grid compute one root en parallel, if the polynomial size ex %\caption{Gauss Seidel iteration} %\label{fig:08} -The kernel are executed from << DimGrid, DimBlock>>, + The last kernel checks the convergence of the roots after each update of $Z^{k}$, according to formula Eq.~\ref{eq:Aberth-Conv-Cond}. We used the functions of the CUBLAS Library (CUDA Basic Linear Algebra Subroutines) to implement this kernel. +This listing shows the kernel \textit{TestConvergence} code + \begin{footnotesize} +\lstinputlisting[label=lst:01,caption=Kernel to test the convergence of the roots]{code1.c} +\end{footnotesize} The kernel terminates its computations when all the roots have converged. It should be noticed that, as blocks of threads are -- 2.39.5