Coalesced memory access - commented out delete [] solution and curandDestroyGenerator(), which cause crashing
Coalesced memory access - changed computation of BLOCK and THREAD(is now constant 128)