https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105274
Bug ID: 105274
Summary: [libgomp][nvptx] Provide means to set the stack size
on the device side (+ improve doc)
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: documentation, openmp
Severity: normal
Priority: P3
Component: libgomp
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, vries at gcc dot gnu.org
Target Milestone: ---
Currently, for offloading code, nvptx has
(A) for SIMT
-msoft-stack-reserve-local= (default: 128)
Undocumented in .texi. From .opt:
msoft-stack-reserve-local=
Target Joined RejectNegative UInteger Var(nvptx_softstack_size) Init(128)
Specify size of .local memory used for stack when the exact amount is not
known.
(For -msoft-stack, see:
https://gcc.gnu.org/onlinedocs/gcc/Nvidia-PTX-Options.html#index-msoft-stack
)
(B) For non-SIMT, there is (fixed + undocumented):
nvptx_stacks_size() in libgomp/plugin/plugin-nvptx.c (always returns
128*1024)
I know that for some (program, compiler) combinations, setting
OMP_DEV_STACKSIZE to some higher value is required. (Was required to get a
program running with the xlf compiler with nvptx offload.)
Thus, it seems as if making it settable in GCC is also highly desirable – plus
actually document everything.
Regarding OMP_DEV_... itself, see also the by-device-env-support patch
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588728.html