CUDA ptxas警告(条目的堆栈大小) [英] CUDA ptxas warnings (Stack size for entry)

查看:42
本文介绍了CUDA ptxas警告(条目的堆栈大小)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编译CUDA代码时收到以下我不理解的警告:

I am getting the following warning which I dont understand when compiling CUDA code:

CUDACOMPILE : ptxas warning : Stack size for entry function
'_Z24gpu_kernel_get_3d_pointsiPK8RtmPointS1_PKfS3_P10RtmPoint3DPif' cannot be statically
determined.

内核原型为:

__global__ void gpu_kernel_get_3d_points(int count1, const RtmPoint *pPoints1,
const RtmPoint *pPoints2, const float *PL, const float *PR, RtmPoint3D *pPoints3D,
int *pGlobalCount, float bbox)

所有指针都是指向设备内存的指针。我看不出为什么编译器在确定堆栈大小时会有问题。内核中有一些局部变量,但没有很多。有任何想法吗?这个警告重要吗?

All the pointers are pointers to device memory. I dont see why the compiler should have a problem determing the stack size. There are a few local variables in the kernel but not many. Any ideas? Does this warning matter?

推荐答案

此警告在函数递归时发生。 Cuda尝试在执行之前分配堆栈空间,这并不重要,除非您使用递归。问题在于堆栈大小无法预测。递归的深度不是一个已知值,因此堆栈将使用的内存是未知的。此警告不是很相关,但是如果您的数据超出了GPU堆栈,则必须手动增加堆栈大小。

This warning happens when a function is recursive. Cuda tries to allocate the stack space before the execution which is not a big deal, unless you are using recursion. The problem with it is that the stack size isn't predictible. The depth of the recursion isn't a known value so the memory that the stack will use isn't known. This warning isn't really relevant but if you exceed the GPU stack with your data, you must manually increase the stack size.

这篇关于CUDA ptxas警告(条目的堆栈大小)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆