public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Marcel Vollweiler <marcel@codesourcery.com>,
	<gcc-patches@gcc.gnu.org>, <fortran@gcc.gnu.org>
Subject: Re: [Patch] OpenMP, libgomp: Add new runtime routine omp_target_is_accessible.
Date: Fri, 11 Mar 2022 15:12:32 +0100	[thread overview]
Message-ID: <1b53e970-a0a7-66bc-4b2e-828e881cce73@codesourcery.com> (raw)
In-Reply-To: <7fa4a70c-60e7-fa18-0fcd-98301c0b3344@codesourcery.com>

Minor remark to the test:

On 11.03.22 13:30, Marcel Vollweiler wrote:
> +  int d = omp_get_default_device ();
...
> +  int shared_mem = 0;
> +  #pragma omp target map (alloc: shared_mem) device (d)
> +    shared_mem = 1;
> +  if (omp_target_is_accessible (p, sizeof (int), d) != shared_mem)
> +    __builtin_abort ();

I wonder whether it makes sense to do instead
   for (d = 0; d <= omp_get_num_devices(); ++d)
instead of just
   d = omp_get_default_device();
given that we have already found once in a while bugs when testing more
than just the default device - be it because devices differed or because
'0' was special.

In particular, I could image having at the same time two or three devices
available of type intelmic + gcn + nvptx, possibly mixing shared memory,
nonshared memory and semi-shared memory*

Tobias

(* semi-shared: I am especially thinking of nvptx with %dynamic_smem_size,
which requires some special handling. By contrast with HMM and Pascal GPUs,
real USM is possible.)

-----------------
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	other threads:[~2022-03-11 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 12:30 Marcel Vollweiler
2022-03-11 14:12 ` Tobias Burnus [this message]
2022-03-14 15:42   ` Marcel Vollweiler
2022-05-05  9:33     ` Jakub Jelinek
2022-05-05  9:45       ` Tobias Burnus
2022-05-05  9:51         ` Jakub Jelinek
2022-05-06 11:14       ` Marcel Vollweiler

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=1b53e970-a0a7-66bc-4b2e-828e881cce73@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcel@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).