This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Update the global ctor for descriptor
ClosedPublic

Authored by clementval on Aug 7 2023, 3:02 PM.

Details

Summary

The global ctor for acc declare when the variable is a descriptor
is treated differently. The descriptor is implicity copied in.
An additional registering function will be generated to deal with
the data pointer when the data is actually allocated. This will come in
a follow up patch.

The descriptor is not a user visible detail but an implementation detail.
The intent for declare is that the lifetime is implicitly managed - and the
data must be on device. Since descriptor holds pointer to the data,
it makes sense to also make this available on device at same time.
Copyin is used because it contains relevant details about the data such
as bounds.

Diff Detail

Event Timeline

clementval created this revision.Aug 7 2023, 3:02 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 7 2023, 3:02 PM
clementval requested review of this revision.Aug 7 2023, 3:02 PM
razvanlupusoru accepted this revision.Aug 8 2023, 8:24 AM

Change looks great to me.

Just a few misspellings in the commit message:
delcare -> declare
addition -> additional
registreing -> registering

Maybe also add a clarification why the descriptor is copied in:
The descriptor is not an user visible detail but an implementation detail. The intent for declare is that the lifetime is implicitly managed - and the data must be on device. Since descriptor holds pointer to the data, it makes sense to also make this available on device at same time. Copyin is used because it contains relevant details about the data such as bounds.

This revision is now accepted and ready to land.Aug 8 2023, 8:24 AM
clementval edited the summary of this revision. (Show Details)Aug 8 2023, 9:37 AM
This revision was automatically updated to reflect the committed changes.