X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/prng_gpu.git/blobdiff_plain/807fde0ea31c414c79ee3922e51251371e227185..6f71a8e8c76974cada0ce140b630cb1c38835336:/prng_gpu.tex diff --git a/prng_gpu.tex b/prng_gpu.tex index db219a1..27702e8 100644 --- a/prng_gpu.tex +++ b/prng_gpu.tex @@ -724,6 +724,11 @@ the list of cells to update in the state $x^n$ of the system (represented as an integer having $\mathsf{N}$ bits too). More precisely, the $k-$th component of this state (a binary digit) changes if and only if the $k-$th digit in the binary decomposition of $S^n$ is 1. +\begin{color}{red} +Obviously, when $S$ is periodic of period $p$, then $x$ is periodic too of +period either $p$ or $2p$, depending of the fact that, after $p$ iterations, +the state of the system may or not be the same than before these iterations. +\end{color} The single basic component presented in Eq.~\ref{equation Oplus} is of ordinary use as a good elementary brick in various PRNGs. It corresponds @@ -1539,20 +1544,20 @@ NumThreads: Number of threads\; array\_comb1, array\_comb2: Arrays containing combinations of size combination\_size\;} \KwOut{NewNb: array containing random numbers in global memory} -\If{threadId is concerned} { - retrieve data from InternalVarXorLikeArray[threadId] in local variables including shared memory and x\; +\If{threadIdx is concerned} { + retrieve data from InternalVarXorLikeArray[threadIdx] in local variables including shared memory and x\; offset = threadIdx\%combination\_size\; o1 = threadIdx-offset+array\_comb1[offset]\; o2 = threadIdx-offset+array\_comb2[offset]\; \For{i=1 to n} { t=xor-like()\; t=t\textasciicircum shmem[o1]\textasciicircum shmem[o2]\; - shared\_mem[threadId]=t\; + shared\_mem[threadIdx]=t\; x = x\textasciicircum t\; - store the new PRNG in NewNb[NumThreads*threadId+i]\; + store the new PRNG in NewNb[NumThreads*threadIdx+i]\; } - store internal variables in InternalVarXorLikeArray[threadId]\; + store internal variables in InternalVarXorLikeArray[threadIdx]\; } \end{small} \caption{Main kernel for the chaotic iterations based PRNG GPU efficient @@ -1942,8 +1947,8 @@ array\_shift[4]=\{0,1,3,7\}\; } \KwOut{NewNb: array containing random numbers in global memory} -\If{threadId is concerned} { - retrieve data from InternalVarBBSArray[threadId] in local variables including shared memory and x\; +\If{threadIdx is concerned} { + retrieve data from InternalVarBBSArray[threadIdx] in local variables including shared memory and x\; we consider that bbs1 ... bbs8 represent the internal states of the 8 BBS numbers\; offset = threadIdx\%combination\_size\; o1 = threadIdx-offset+array\_comb[bbs1\&7][offset]\; @@ -1962,12 +1967,12 @@ array\_shift[4]=\{0,1,3,7\}\; t$<<$=shift\; t|=BBS2(bbs2)\&array\_shift[shift]\; t=t\textasciicircum shmem[o1]\textasciicircum shmem[o2]\; - shared\_mem[threadId]=t\; + shared\_mem[threadIdx]=t\; x = x\textasciicircum t\; - store the new PRNG in NewNb[NumThreads*threadId+i]\; + store the new PRNG in NewNb[NumThreads*threadIdx+i]\; } - store internal variables in InternalVarXorLikeArray[threadId] using a rotation\; + store internal variables in InternalVarXorLikeArray[threadIdx] using a rotation\; } \end{small} \caption{main kernel for the BBS based PRNG GPU}