moved prng before cuda at linking