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
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
}
\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]\;
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}