在编译CUDA设备代码时,您可能会得到错误(为可读性设置行间隔):
ptxas warning : Stack size for entry function '_ZN7kernels11print_stuffIiEEvv'
cannot be statically determined这可以有有几个原因,比如动态内存分配或递归的使用。,但是现在这些并不重要。我想禁用警告,至少在某些功能范围内。问题是,我不知道该用哪一种令牌。搜索这份清单 (按照这里的建议如此关于禁用特定警告)是没用的,因为这是NVCC的C/C++前端中的警告,而不是汇编程序。
那么我怎样才能禁用这个警告呢?
发布于 2019-12-30 15:30:12
需要注意的一点是,这是一个汇编程序警告,所以没有一个通常的前端警告抑制选项是相关的。
ptxas只支持数量非常有限的警告控制选项。在建立数据自动化系统9之前,只有以下几点得到了支持:
--suppress-double-demote-warning (-suppress-double-demote-warning)
Suppress the warning that is otherwise emitted when a double precision instruction
is encountered in PTX that is targeted for an SM version that does not have
double precision support
--disable-warnings (-w)
Inhibit all warning messages.
--warn-on-double-precision-use (-warn-double-usage)
Warning if double(s) are used in an instruction.
--warn-on-local-memory-usage (-warn-lmem-usage)
Warning if local memory is used.
--warn-on-spills (-warn-spills)
Warning if registers are spilled to local memory.
--warning-as-error (-Werror)
Make all warnings into errors.在您的情况下,唯一的选择是禁止所有警告。将-Xptxas='-w'添加到任何nvcc调用中都可以实现这一点。
CUDA 9及更新版本添加另一个选项ptxas,该选项将取消您询问的警告:
--suppress-stack-size-warning (-suppress-stack-size-warning)
Suppress the warning that otherwise is printed when stack size cannot be
determined.在这种情况下,将-Xptxas='-suppress-stack-size-warning'添加到任何nvcc调用都会消除警告。
https://stackoverflow.com/questions/59524303
复制相似问题