how to get random number in __global__function?

thrust::default_random_engine can make random data,but in global function we can not use thrust::
then how can I make random number in global function ?

take a look at curand library

the device api allows for direct generation of random numbers in device code

and there are a variety of curand sample codes for you to study