From: couturie Date: Tue, 3 Nov 2015 17:05:24 +0000 (-0500) Subject: new X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/kahina_paper1.git/commitdiff_plain/6dcd06b01e947fd9dba5e4a45b2e1ac19835e5db?ds=sidebyside new --- diff --git a/paper.tex b/paper.tex index 8506d85..52fe61c 100644 --- a/paper.tex +++ b/paper.tex @@ -558,9 +558,14 @@ Both steps 3 and 4 use 1 thread to compute all the $n$ roots on CPU, which is ve \subsection{Parallel implementation with CUDA } On the CPU, both steps 3 and 4 contain the loop \verb=for= and a single thread executes all the instructions in the loop $n$ times. In this subsection, we explain how the GPU architecture can compute this loop and reduce the execution time. -In the GPU, the schduler assigns the execution of this loop to a group of threads organised as a grid of blocks with block containing a number of threads. All threads within a block are executed concurrently in parallel. The instructions run on the GPU are grouped in special function called kernels. It's up to the programmer, to describe the execution context, that is the size of the Grid, the number of blocks and the number of threads per block upon the call of a given kernel, according to a special syntax defined by CUDA. +In the GPU, the scheduler assigns the execution of this loop to a +group of threads organised as a grid of blocks with block containing a +number of threads. All threads within a block are executed +concurrently in parallel. The instructions run on the GPU are grouped +in special function called kernels. With CUDA, a programmer must +describe the kernel execution context: the size of the Grid, the number of blocks and the number of threads per block. -In CUDA programming, all the instructions of the \verb=for= loop are executed by the GPU as a kernel. A kernel is a function written in CUDA and defined by the \verb=__global__= qualifier added before a usual \verb=C= function, which instructs the compiler to generate appropriate code to pass it to the CUDA runtime in order to be executed on the GPU. +%In CUDA programming, all the instructions of the \verb=for= loop are executed by the GPU as a kernel. A kernel is a function written in CUDA and defined by the \verb=__global__= qualifier added before a usual \verb=C= function, which instructs the compiler to generate appropriate code to pass it to the CUDA runtime in order to be executed on the GPU. Algorithm~\ref{alg2-cuda} shows a sketch of the Ehrlich-Aberth algorithm using CUDA. @@ -569,13 +574,13 @@ Algorithm~\ref{alg2-cuda} shows a sketch of the Ehrlich-Aberth algorithm using C %\LinesNumbered \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), $\Delta z_{max}$ (maximum value of stop condition)} +\KwIn{$Z^{0}$ (Initial root's vector), $\varepsilon$ (error tolerance threshold), P(Polynomial to solve), $\Delta z_{max}$ (maximum value of stop condition)} -\KwOut {Z(The solution root's vector)} +\KwOut {Z (The solution root's vector)} \BlankLine -Initialization of the coeffcients of the polynomial to solve\; +Initialization of the coefficients of the polynomial to solve\; Initialization of the solution vector $Z^{0}$\; Allocate and copy initial data to the GPU global memory\; k=0\;