# How to generate a random number in CUDA kernel function

**URL:** <https://discourse.julialang.org/t/how-to-generate-a-random-number-in-cuda-kernel-function/50364>\
**Category:** GPU\
**Tags:** question\
**Created:** [November 18, 2020, 9:14am UTC](https://discourse.julialang.org/t/how-to-generate-a-random-number-in-cuda-kernel-function/50364 "2020-11-18T09:14:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [November 20, 2020, 1:11am UTC](https://discourse.julialang.org/t/how-to-generate-a-random-number-in-cuda-kernel-function/50364/5 "2020-11-20T01:11:56Z")

</div>

FYI here’s a follow-up comment on the FoldsCUDA.jl link: [Advice for improving Monte-Carlo code - #25 by tkf](https://discourse.julialang.org/t/advice-for-improving-monte-carlo-code/49782/25)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-generate-a-random-number-in-cuda-kernel-function/50364)._
