public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Norris <jnorris@codesourcery.com>
To: Cesar Philippidis <cesar@codesourcery.com>,
	GCC Patches	<gcc-patches@gcc.gnu.org>
Cc: <fortran@gcc.gnu.org>, Thomas Schwinge <Thomas_Schwinge@mentor.com>
Subject: Re: [gomp4] Fix Fortran deviceptr
Date: Tue, 08 Dec 2015 16:22:00 -0000	[thread overview]
Message-ID: <566703BC.7030202@codesourcery.com> (raw)
In-Reply-To: <5665AC01.2020008@codesourcery.com>

Cesar,

On 12/07/2015 09:55 AM, Cesar Philippidis wrote:

> [snip snip]
> Two observations:
>
>   1. Why is deviceptr so special that gomp_map_vars can't handle it
>      directly?

Recall that the deviceptr clause in Fortran presents as two
mappings: FORCE_DEVICEPTR and POINTER. The former
has the device address in hostaddr, while the latter has the
host address of the pointer in hostaddr. The new code
detects a properly formed pair and if found, proceeds to
turn the latter into the FORCE_DEVICEPTR map, while the
former is effectively discarded by setting hostaddr to NULL.

This behavior is specific to OpenACC, so I decided put it where
I did. Could it be put into gomp_map_vars? Probably. Would it
be messy? Probably. But what may be a better solution would
be to use the functionality that handles the use_device_ptr
clause in OpenMP4.1 and eliminate FORCE_DEVICEPTR from
gomp_map_var. Have to look into that.


>
>   2. It appears that deviceptr code in GOACC_parallel_keyed is mostly
>      identical to GOACC_data_start. Can you put that duplicate code into
>      a function? That would be easier to maintain in the long run.
>

Fixed.

Thanks,
Jim


  reply	other threads:[~2015-12-08 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 14:52 James Norris
2015-12-07 15:55 ` Cesar Philippidis
2015-12-08 16:22   ` James Norris [this message]
2015-12-08 17:11     ` Cesar Philippidis
2015-12-09 16:34       ` James Norris

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=566703BC.7030202@codesourcery.com \
    --to=jnorris@codesourcery.com \
    --cc=Thomas_Schwinge@mentor.com \
    --cc=cesar@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /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).