From: Thomas Schwinge <thomas@codesourcery.com>
To: Frederik Harwath <frederik@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>,
Andrew Stubbs <ams@codesourcery.com>
Subject: Re: [PATCH] Add OpenACC acc_get_property support for AMD GCN
Date: Fri, 31 Jan 2020 14:49:00 -0000 [thread overview]
Message-ID: <87y2tnln3o.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <ff4d6cff-c824-6cf4-732d-95dd086c053a@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 3178 bytes --]
Hi Frederik!
On 2020-01-31T13:17:52+0100, "Harwath, Frederik" <frederik@codesourcery.com> wrote:
> On 30.01.20 17:08, Thomas Schwinge wrote:
>
>> I understand correctly that the only reason for:
>>
>> On 2020-01-29T10:52:57+0100, "Harwath, Frederik" <frederik@codesourcery.com> wrote:
>>> * testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c
>>> (expect_device_properties): Split function into ...
>>> (expect_device_string_properties): ... this new function ...
>>> (expect_device_memory): ... and this new function.
>>
>> ... this split is that we can't test 'expect_device_memory' here:
>
>> [...]
>
>> ..., because that one doesn't (re-)implement the 'acc_property_memory'
>> interface?
>
> Correct.
OK, thanks for confirming.
> But why "re-"? It has not been implemented before.
Well, yes, it has already been implemented: in
'libgomp/plugin/plugin-gcn.c' ;-) -- that's why I meant it's
re-implemented in the test case(s): in a similar yet slightly different
way compared to the respective plugin(s). And for avoidance of doubt: I
agree that's a good approach to verify that we're getting some consistent
and meaningful results.)
>>> --- a/libgomp/plugin/plugin-gcn.c
>>> +++ b/libgomp/plugin/plugin-gcn.c
>>> + case GOACC_PROPERTY_MEMORY:
>>> + {
>>> + size_t size;
>>> + hsa_region_t region = agent->data_region;
>>> + hsa_status_t status =
>>> + hsa_fns.hsa_region_get_info_fn (region, HSA_REGION_INFO_SIZE, &size);
>>> + if (status == HSA_STATUS_SUCCESS)
>>> + propval.val = size;
>>> + break;
>>> + }
>>> [...]
>>> }
>>
>> Here we got 'acc_property_memory' implemented, but not here:
>>
>>> --- /dev/null
>>> +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/acc_get_property-gcn.c
>
> Yes, there seems to be no straightforward way to determine the expected value through
> the runtime API. We might of course try to replicate the logic that is
> used in plugin-gcn.c.
No need to do that now; I was just curious whether that's the reason.
>>> --- a/libgomp/plugin/plugin-gcn.c
>>> +++ b/libgomp/plugin/plugin-gcn.c
>>
>>> @@ -4115,12 +4141,37 @@ GOMP_OFFLOAD_openacc_async_dev2host (int device, void *dst, const void *src,
>>> union goacc_property_value
>>> GOMP_OFFLOAD_openacc_get_property (int device, enum goacc_property prop)
>>> {
>>> [...]
>>> + switch (prop)
>>> + {
>>> + case GOACC_PROPERTY_FREE_MEMORY:
>>> + /* Not supported. */
>>> + break;
>>
>> (OK, can be added later when somebody feels like doing that.)
>
> Well, "not supported" means that there seems to be no (reasonable) way to obtain
> the necessary information from the runtime - in contrast to the nvptx plugin
> where it can be obtained easily through the CUDA API.
OK, I see, and again that's fine. (The API explicitly permits such
"zero" returns.)
And, I don't know what a user is actually supposed to tell from
'acc_property_free_memory' given that this can change at any point in
time, arbitrarily, not under control of the executing processe, given
that multiple processes may be using the GPU concurrently.
Grüße
Thomas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]
next prev parent reply other threads:[~2020-01-31 14:25 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 16:51 [PATCH, og8] Add OpenACC 2.6 `acc_get_property' support Maciej W. Rozycki
2018-12-05 10:12 ` Chung-Lin Tang
2018-12-05 18:17 ` Maciej W. Rozycki
2018-12-10 9:06 ` Chung-Lin Tang
2018-12-20 14:25 ` Maciej W. Rozycki
2019-01-08 17:42 ` Thomas Schwinge
2019-10-07 18:41 ` Thomas Schwinge
2019-11-05 15:09 ` Harwath, Frederik
2019-11-14 15:41 ` [PATCH] " Frederik Harwath
2019-12-16 23:06 ` Thomas Schwinge
2019-12-17 9:39 ` Martin Jambor
2019-12-17 9:47 ` Andrew Stubbs
2019-12-20 17:11 ` Harwath, Frederik
2019-12-21 23:01 ` Thomas Schwinge
2019-12-22 22:20 ` Harwath, Frederik
2020-01-10 23:44 ` Thomas Schwinge
2020-01-30 16:14 ` Make OpenACC 'acc_get_property' with 'acc_device_current' work (was: [PATCH] Add OpenACC 2.6 `acc_get_property' support) Thomas Schwinge
2020-02-03 12:16 ` Harwath, Frederik
2020-02-03 14:41 ` Make OpenACC 'acc_get_property' with 'acc_device_current' work Tobias Burnus
2020-01-16 16:03 ` [PATCH] Add OpenACC 2.6 `acc_get_property' support Thomas Schwinge
2020-01-20 14:20 ` Harwath, Frederik
2020-01-23 15:08 ` Thomas Schwinge
2020-01-24 9:36 ` Harwath, Frederik
2020-01-27 14:57 ` Fortran 'acc_get_property' return type (was: [PATCH] Add OpenACC 2.6 `acc_get_property' support) Thomas Schwinge
2020-01-28 15:31 ` [PATCH] Add OpenACC acc_get_property support for AMD GCN Harwath, Frederik
2020-01-28 16:14 ` Andrew Stubbs
2020-01-29 10:10 ` Harwath, Frederik
2020-01-29 11:07 ` Andrew Stubbs
2020-01-29 11:47 ` Harwath, Frederik
2020-01-29 17:58 ` Thomas Schwinge
2020-01-29 18:12 ` Andrew Stubbs
2020-01-30 8:04 ` Harwath, Frederik
2020-01-30 16:28 ` Thomas Schwinge
2020-01-30 16:54 ` Andrew Stubbs
2020-01-31 9:32 ` Thomas Schwinge
2020-01-31 12:32 ` Harwath, Frederik
2020-01-31 14:49 ` Thomas Schwinge [this message]
2020-04-29 9:19 ` [PATCH] Add OpenACC 2.6 `acc_get_property' support Thomas Schwinge
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=87y2tnln3o.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=ams@codesourcery.com \
--cc=frederik@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).