1

I'm getting a CUDA warning saying

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

Now, I know what it means, and there's a SO question about why it happens. What I want to suppress the warning (when compiling with nvcc 10.x). Can I? If so, where exactly do I put the warning suppression #pragma for this?

einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • Dynamic memory allocation doesn't cause that warning, recursion does – talonmies Dec 13 '19 at 20:46
  • @talonmies: First answer in the SO question about this says dynamic allocation, and I don't think I have recursion in my code, but I might be wrong. Edited. – einpoklum Dec 13 '19 at 21:16

1 Answers1

2

Add --nvlink-options -suppress-stack-size-warning when compiling with nvcc.

Serge Rogatch
  • 13,865
  • 7
  • 86
  • 158
zingdle
  • 491
  • 5
  • 17
  • ... but wouldn't that disable other warnings about stack size? – einpoklum Dec 14 '19 at 08:40
  • `-suppress-stack-size-warning, Suppress the warning that otherwise is printed when stack size cannot be determined.` I haven't encountered other warnings about stack size yet. Sorry I don't know if there's a `#pragma` way to suppress the warning... – zingdle Dec 14 '19 at 09:12
  • There is, I was just worried this would suppress warnings in other problematic situations. – einpoklum Dec 14 '19 at 09:15