X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/prng_gpu.git/blobdiff_plain/3c253b8871482ed4e74d60ab23edaf08052e7c72..ab8b9d20e04e131eb774c30874380721ca122b86:/prng_gpu.tex diff --git a/prng_gpu.tex b/prng_gpu.tex index fa71e5b..d1fb7a6 100644 --- a/prng_gpu.tex +++ b/prng_gpu.tex @@ -674,7 +674,7 @@ achieved out. Then in order to apply the negation on these bits we can simply apply the xor operator between the current number and the strategy. In order to obtain the strategy we also use a classical PRNG. -Here is an example with 16-bits numbers showing how the bit operations are +Here is an example with 16-bits numbers showing how the bitwise operations are applied. Suppose that $x$ and the strategy $S^i$ are defined in binary mode. Then the following table shows the result of $x$ xor $S^i$. $$ @@ -738,17 +738,18 @@ unsigned int CIprng() { -In listing~\ref{algo:seqCIprng} a sequential version of our chaotic iterations -based PRNG is presented. The xor operator is represented by \textasciicircum. This function uses three classical 64-bits PRNG: the -\texttt{xorshift}, the \texttt{xor128} and the \texttt{xorwow}. In the -following, we call them xor-like PRNGSs. These three PRNGs are presented -in~\cite{Marsaglia2003}. As each xor-like PRNG used works with 64-bits and as our PRNG -works with 32-bits, the use of \texttt{(unsigned int)} selects the 32 least -significant bits whereas \texttt{(unsigned int)(t3$>>$32)} selects the 32 most -significants bits of the variable \texttt{t}. So to produce a random number -realizes 6 xor operations with 6 32-bits numbers produced by 3 64-bits PRNG. -This version successes the BigCrush of the TestU01 battery [P. L’ecuyer and - R. Simard. Testu01]. +In listing~\ref{algo:seqCIprng} a sequential version of our chaotic iterations +based PRNG is presented. The xor operator is represented by +\textasciicircum. This function uses three classical 64-bits PRNG: the +\texttt{xorshift}, the \texttt{xor128} and the \texttt{xorwow}. In the +following, we call them xor-like PRNGSs. These three PRNGs are presented +in~\cite{Marsaglia2003}. As each xor-like PRNG used works with 64-bits and as +our PRNG works with 32-bits, the use of \texttt{(unsigned int)} selects the 32 +least significant bits whereas \texttt{(unsigned int)(t3$>>$32)} selects the 32 +most significants bits of the variable \texttt{t}. So to produce a random +number realizes 6 xor operations with 6 32-bits numbers produced by 3 64-bits +PRNG. This version successes the BigCrush of the TestU01 battery [P. L’ecuyer + and R. Simard. Testu01]. \section{Efficient prng based on chaotic iterations on GPU} @@ -835,6 +836,8 @@ which represent the indexes of the other threads for which the results are used by the current thread. In the algorithm, we consider that a 64-bits xor-like PRNG is used, that is why both 32-bits parts are used. +This version also succeed to the BigCrush batteries of tests. + \begin{algorithm} \KwIn{InternalVarXorLikeArray: array with internal variables of 1 xor-like PRNGs in global memory\; @@ -863,10 +866,20 @@ tab1, tab2: Arrays containing permutations of size permutation\_size\;} \caption{main kernel for the chaotic iterations based PRNG GPU efficient version} \label{algo:gpu_kernel2} \end{algorithm} + + + \section{Experiments} Differents experiments have been performed in order to measure the generation speed. +\begin{figure}[t] +\begin{center} + \includegraphics[scale=.5]{curve_time_gpu.pdf} +\end{center} +\caption{Number of random numbers generated per second} +\label{fig:time_naive_gpu} +\end{figure} First of all we have compared the time to generate X random numbers with both the CPU version and the GPU version.