需要注意的重要一点是,这是一个汇编程序警告,因此通常的前端警告抑制选项都不相关。
ptxas
仅支持数量非常有限的警告控制选项。在 CUDA 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
调用都应该消除警告。