Hi Tobias!

On 24.10.22 21:11, Thomas Schwinge wrote:
On 2022-10-24T21:05:46+0200, I wrote:
On 2022-10-24T16:07:25+0200, Jakub Jelinek via Gcc-patches 
<gcc-patches@gcc.gnu.org> wrote:
On Wed, Oct 12, 2022 at 10:55:26AM +0200, Tobias Burnus wrote:
libgomp/nvptx: Prepare for reverse-offload callback handling
Well.
     +  struct rev_offload *rev_data;
... but as far as I can tell, this is never initialized in
'nvptx_open_device', which does 'ptx_dev = GOMP_PLUGIN_malloc ([...]);'.
Would the following be the correct fix (currently testing)?

     --- libgomp/plugin/plugin-nvptx.c
     +++ libgomp/plugin/plugin-nvptx.c
     @@ -546,6 +546,8 @@ nvptx_open_device (int n)
        ptx_dev->omp_stacks.size = 0;
        pthread_mutex_init (&ptx_dev->omp_stacks.lock, NULL);

     +  ptx_dev->rev_data = NULL;
     +
        return ptx_dev;
      }

LGTM and I think it is obvious – albeit I am not sure why it did not
fail when testing it here.

Thanks,

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to