| 1 |
|
| 2 | #ifndef __GPU_RANDOM_H__
|
| 3 | #define __GPU_RANDOM_H__
|
| 4 |
|
| 5 | |
| 6 | * be transposed to lib/ at the earliest convenience.
|
| 7 |
|
| 8 |
|
| 9 | #include <linux/prandom.h>
|
| 10 |
|
| 11 | #define GPU_RND_STATE_INITIALIZER(seed__) ({ \
|
| 12 | struct rnd_state state__; \
|
| 13 | prandom_seed_state(&state__, (seed__)); \
|
| 14 | state__; \
|
| 15 | })
|
| 16 |
|
| 17 | #define GPU_RND_STATE(name__, seed__) \
|
| 18 | struct rnd_state name__ = GPU_RND_STATE_INITIALIZER(seed__)
|
| 19 |
|
| 20 | unsigned int *gpu_random_order(unsigned int count,
|
| 21 | struct rnd_state *state);
|
| 22 | void gpu_random_reorder(unsigned int *order,
|
| 23 | unsigned int count,
|
| 24 | struct rnd_state *state);
|
| 25 | u32 gpu_prandom_u32_max_state(u32 ep_ro,
|
| 26 | struct rnd_state *state);
|
| 27 |
|
| 28 | #endif
|