public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] openmp: Add support for HBW or large capacity or interleaved memory through the libmemkind.so library
Date: Tue, 28 Jun 2022 22:29:53 +0100	[thread overview]
Message-ID: <b128fdaa-48f7-efa6-72f1-73307577a158@codesourcery.com> (raw)
In-Reply-To: <YqGs96PqQhyxj0yV@tucnak>

On 09/06/2022 09:19, Jakub Jelinek via Gcc-patches wrote:
> +  switch (memspace)
> +    {
> +    case omp_high_bw_mem_space:
> +#ifdef LIBGOMP_USE_MEMKIND
> +      struct gomp_memkind_data *memkind_data;
> +      memkind_data = gomp_get_memkind ();
> +      if (data.partition == omp_atv_interleaved
> +	  && memkind_data->kinds[GOMP_MEMKIND_HBW_INTERLEAVE])
> +	{
> +	  data.memkind = GOMP_MEMKIND_HBW_INTERLEAVE;
> +	  break;
> +	}
> +      else if (memkind_data->kinds[GOMP_MEMKIND_HBW_PREFERRED])
> +	{
> +	  data.memkind = GOMP_MEMKIND_HBW_PREFERRED;
> +	  break;
> +	}
> +#endif
> +      return omp_null_allocator;
> +    case omp_large_cap_mem_space:
> +#ifdef LIBGOMP_USE_MEMKIND
> +      memkind_data = gomp_get_memkind ();
> +      if (memkind_data->kinds[GOMP_MEMKIND_DAX_KMEM_ALL])
> +	data.memkind = GOMP_MEMKIND_DAX_KMEM_ALL;
> +      else if (memkind_data->kinds[GOMP_MEMKIND_DAX_KMEM])
> +	data.memkind = GOMP_MEMKIND_DAX_KMEM;
> +#endif
> +      break;
> +    default:
> +#ifdef LIBGOMP_USE_MEMKIND
> +      if (data.partition == omp_atv_interleaved)
> +	{
> +	  memkind_data = gomp_get_memkind ();
> +	  if (memkind_data->kinds[GOMP_MEMKIND_INTERLEAVE])
> +	    data.memkind = GOMP_MEMKIND_INTERLEAVE;
> +	}
> +#endif
> +      break;
> +    }
> +

This conflicts with mine and Abid's patches to implement the device 
allocators and host unified shared memory via the overridable 
"MEMSPACE_ALLOC" hooks. I can still use those for the "else" case, but 
they'll be inactive on any configuration where libmemkind exists. That's 
fine for the device code, and may be OK for USM (given that libmemkind 
won't have an option for that). There's a problem for the 
NVidia-specific host-memory pinning I have planned though.

How do you propose we resolve this conflict, please?

Ideally it will be in such a way that the conditional is resolved at 
compile time and the routine can be inlined (so no fake-OO function 
pointers in structs, I think).

Thanks

Andrew

  parent reply	other threads:[~2022-06-28 21:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  8:19 Jakub Jelinek
2022-06-09 10:11 ` Thomas Schwinge
2022-06-09 11:57   ` Jakub Jelinek
2022-06-10 19:23     ` Jakub Jelinek
2022-06-09 17:07 ` Richard Sandiford
2022-06-09 17:48   ` Jakub Jelinek
2022-06-28 21:29 ` Andrew Stubbs [this message]
2022-06-29 10:45   ` Jakub Jelinek
2022-06-29 12:24     ` Andrew Stubbs

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=b128fdaa-48f7-efa6-72f1-73307577a158@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).