public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: Thomas Schwinge <thomas@codesourcery.com>, gcc-patches@gcc.gnu.org
Subject: Re: [Patch] libgomp: Fix reverse-offload for GOMP_MAP_TO_PSET
Date: Wed, 15 Feb 2023 11:17:24 +0100	[thread overview]
Message-ID: <Y+yxNGoskOkOQC46@tucnak> (raw)
In-Reply-To: <12372b6c-1f8d-19aa-87be-99505f4712d4@codesourcery.com>

On Thu, Feb 09, 2023 at 10:23:53AM +0100, Tobias Burnus wrote:
> libgomp: Fix reverse-offload for GOMP_MAP_TO_PSET
> 
> libgomp/
> 	* target.c (gomp_target_rev): Dereference ptr
> 	to get device address.
> 	* libgomp.fortran/reverse-offload-5.f90: Add test
> 	for unallocated allocatable.
> 
> --- a/libgomp/target.c
> +++ b/libgomp/target.c
> @@ -3579,8 +3579,14 @@ gomp_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t devaddrs_ptr,
>  		      }
>  		    int k;
>  		    n2 = NULL;
> -		    cdata[i].present = true;
> +		    /* Dereference devaddrs[j] to get the device addr.  */
> +		    assert (devaddrs[j]-sizes[j] == cdata[i].devaddr);

Formatting, there should be spaces around - on both sides.

> +		    devaddrs[j] = *(uint64_t *) (uintptr_t) (devaddrs[i]
> +							     + sizes[j]);
> +		    cdata[j].present = true;
>  		    cdata[j].devaddr = devaddrs[j];
> +		    if (devaddrs[j] == 0)
> +		      continue;
>  		    k = gomp_map_cdata_lookup (cdata, devaddrs, kinds, sizes, j,
>  					       devaddrs[j],
>  					       devaddrs[j] + sizeof (void*),

Otherwise LGTM.

	Jakub


      reply	other threads:[~2023-02-15 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 11:52 Tobias Burnus
2023-02-07 22:51 ` Thomas Schwinge
2023-02-09  9:23   ` Tobias Burnus
2023-02-15 10:17     ` Jakub Jelinek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+yxNGoskOkOQC46@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas@codesourcery.com \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).