This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add OpenACC acc_get_property support for AMD GCN
Hi Thomas,
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. But why "re-"? It has not been implemented before.
>> --- 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.
>
>> + 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.
Best regards,
Frederik