kernel.

It is interesting to note that although the unit of synchronous execution is a warp of 32 threads, the threads inside a warp may diverge in their execution paths (occurrence of bifurcations), at the cost of having to re-execute the warp once for each choice taken. Needless to say that in general this impacts negatively in the performance and has to be avoided.

The present code is divided in two main functions: spin update and energy and magnetization computation. The first function is implemented in host code by the function [`update`]{} and this comprises calling the device kernel [`updateCUDA`]{} once updating white cells and next updating black cells in a checkerboard scheme. The energy and magnetization (and their related moments) summarization is done by [`calculate`]{} that calls the kernel [`calculateCUDA`]{} and two more auxiliary kernels: [`sumupECUDA`]{} and [`sumupMCUDA`]{}.

Random Number Generator
-----------------------

The Potts model simulation requires a great amount of random numbers. Namely, each cell updating its spin needs one integer random number in $\{0,\dots, q\!-\!1\}$ and possibly a second one in the real range $[0,1)$ to decide the acceptance of the flip. Hence, a key factor to performance is using a good parallel random number generator.

Given 