X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/prng_gpu.git/blobdiff_plain/cae68b58b70de455ef66b7312c8625f25e83a37f..6f71a8e8c76974cada0ce140b630cb1c38835336:/prng_gpu.tex diff --git a/prng_gpu.tex b/prng_gpu.tex index 8d4f21b..27702e8 100644 --- a/prng_gpu.tex +++ b/prng_gpu.tex @@ -1544,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 @@ -1947,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]\; @@ -1967,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}