curandGenerateNormalDouble 因生成大量随机数而崩溃
是否有任何限制
curandGenerateNormal( curandGenerator_t 生成器, 浮动*outputPtr,size_t n, float 意味着,float stddev)
函数? curandGenerateNormal 在循环内调用,当我增加 size_t n 参数的大小时,代码在调用几次后开始崩溃。
有什么想法吗?
Is there any limitation of the
curandGenerateNormal(
curandGenerator_t generator,
float *outputPtr, size_t n,
float mean, float stddev)
function?
curandGenerateNormal is called inside a loop, when I increase the size of the size_t n parameter, the code started to crash when it has been called a few times.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能详细说明崩溃时实际发生的情况吗?您检查所有错误值吗?
您的循环应该类似于下面的代码。 cudaMalloc 是否有可能在您不知情的情况下失败,因此您传递了无效的指针或类似的东西?
关于您的评论,请注意 curandGenerateNormalDouble 将生成具有给定平均值和标准差的正态分布数字,这与您要求它们在 0 和 1 之间的要求相冲突。您需要什么分布?
Can you elaborate on what actually happens when it crashes? Do you check all the error values?
Your loop should look something like the code below. Is it possible that the cudaMalloc is failing without your knowledge and hence you are passing an invalid pointer, or something similar?
With regard to your comment, note that curandGenerateNormalDouble will generate Normally distributed numbers with a given mean and standard deviation, that conflicts with your requirement that they be between 0 and 1. What distribution do you need?