How to use curand_discrete()?

I want to multinomially sample a single event from vector of probabilities. The function curand_discrete() listed in the device API seems the one I need. But there is no further documentation on how to use it, especially how to construct the discrete_distribution from a vector of probabilities? Can anybody give an example?