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}