nvptx: Cache stacks block for OpenMP kernel launch
authorJulian Brown <julian@codesourcery.com>
Wed, 21 Oct 2020 17:00:19 +0000 (10:00 -0700)
committerJulian Brown <julian@codesourcery.com>
Tue, 5 Jan 2021 17:56:36 +0000 (09:56 -0800)
commit6b577a17b26347e78c8b9167f24fc5c9d9724270
tree6b81c6a7319ca62e499d75538f4d3c57dab4dea1
parent407bcf8e28f417a2be94d9a0a38a0b7effcf2b94
nvptx: Cache stacks block for OpenMP kernel launch

2021-01-05  Julian Brown  <julian@codesourcery.com>

libgomp/
* plugin/plugin-nvptx.c (SOFTSTACK_CACHE_LIMIT): New define.
(struct ptx_device): Add omp_stacks struct.
(nvptx_open_device): Initialise cached-stacks housekeeping info.
(nvptx_close_device): Free cached stacks block and mutex.
(nvptx_stacks_free): New function.
(nvptx_alloc): Add SUPPRESS_ERRORS parameter.
(GOMP_OFFLOAD_alloc): Add strategies for freeing soft-stacks block.
(nvptx_stacks_alloc): Rename to...
(nvptx_stacks_acquire): This.  Cache stacks block between runs if same
size or smaller is required.
(nvptx_stacks_free): Remove.
(GOMP_OFFLOAD_run): Call nvptx_stacks_acquire and lock stacks block
during kernel execution.
libgomp/plugin/plugin-nvptx.c