public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ilya Verbin <iverbin@gmail.com>,
	Aldy Hernandez <aldyh@redhat.com>,
	       gcc-patches@gcc.gnu.org,
	Kirill Yukhin <kirill.yukhin@gmail.com>,
	       Thomas Schwinge <thomas@codesourcery.com>,
	       Alexander Monakov <amonakov@ispras.ru>
Subject: Re: [hsa] depend nowait support for target
Date: Mon, 23 Nov 2015 14:25:00 -0000	[thread overview]
Message-ID: <20151123141642.GD5675@tucnak.redhat.com> (raw)
In-Reply-To: <20151123141205.GN14925@virgil.suse.cz>

On Mon, Nov 23, 2015 at 03:12:05PM +0100, Martin Jambor wrote:
> +/* Thread routine to run a kernel asynchronously.  */
> +
> +static void *
> +run_kernel_asynchronously (void *thread_arg)
> +{
> +  struct async_run_info *info = (struct async_run_info *) thread_arg;
> +  int device = info->device;
> +  void *tgt_fn = info->tgt_fn;
> +  void *tgt_vars = info->tgt_vars;
> +  void **args = info->args;
> +  void *async_data = info->async_data;
> +
> +  free (info);
> +  GOMP_OFFLOAD_run (device, tgt_fn, tgt_vars, args);
> +  GOMP_PLUGIN_target_task_completion (async_data);
> +  return NULL;

Is this just a temporary hack to work-around the missing task.c/target.c
support for plugins that need polling (calling some hook) to determine
completion of the tasks, or there is no way to tell HSA to spawn something
asynchronously?
Short term it is ok this way.

> +  int err = pthread_create (&pt, NULL, &run_kernel_asynchronously, info);
> +  if (err != 0)
> +    GOMP_PLUGIN_fatal ("HSA asynchronous thread creation failed: %s",
> +		       strerror (err));
> +  err = pthread_detach (pt);
> +  if (err != 0)
> +    GOMP_PLUGIN_fatal ("Failed to detach a thread to run HRA kernel "
> +		       "asynchronously: %s", strerror (err));

HSA instead of HRA?

	Jakub

  reply	other threads:[~2015-11-23 14:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08  9:26 [gomp4.1] depend nowait support for target {update,{enter,exit} data} Jakub Jelinek
2015-10-02 19:28 ` Ilya Verbin
2015-10-15 14:02   ` Jakub Jelinek
2015-10-15 16:18     ` Alexander Monakov
2015-10-15 17:18       ` Jakub Jelinek
2015-10-15 18:11         ` Alexander Monakov
2015-10-15 16:42     ` Ilya Verbin
2015-10-16 11:50     ` Martin Jambor
2015-10-19 19:55     ` Ilya Verbin
2015-11-11 16:52       ` [gomp4.5] depend nowait support for target Jakub Jelinek
2015-11-12 17:44         ` Ilya Verbin
2015-11-12 17:58           ` Jakub Jelinek
2015-11-12 18:07             ` Ilya Verbin
2015-11-12 17:45         ` Jakub Jelinek
2015-11-12 20:52           ` Ilya Verbin
2015-11-13 10:18             ` Jakub Jelinek
2015-11-13 15:12               ` Jakub Jelinek
2015-11-13 16:37                 ` Ilya Verbin
2015-11-13 16:42                   ` Jakub Jelinek
2015-11-13 18:37                     ` Ilya Verbin
2015-11-23 14:16                 ` [hsa] " Martin Jambor
2015-11-23 14:25                   ` Jakub Jelinek [this message]
2015-11-25 15:41                     ` Martin Jambor

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=20151123141642.GD5675@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iverbin@gmail.com \
    --cc=kirill.yukhin@gmail.com \
    --cc=thomas@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).