Bug 114002 - [OpenACC][OpenACC 3.3] Add 'acc_attach'/'acc_detach' routine
Summary: [OpenACC][OpenACC 3.3] Add 'acc_attach'/'acc_detach' routine
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: openacc
Depends on:
Blocks:
 
Reported: 2024-02-19 20:26 UTC by Tobias Burnus
Modified: 2024-02-19 20:26 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
OpenACC run-time testcase (329 bytes, text/plain)
2024-02-19 20:26 UTC, Tobias Burnus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2024-02-19 20:26:50 UTC
Created attachment 57466 [details]
OpenACC run-time testcase

The problem with acc_attach is that it does not like any temporary variable.

For
   call acc_attach(var%v)

We need at the end:
   acc_attach(&var.v.data)

But we will easily get:
   parm.v.data = var.v.data;
   ...
   acc_attach(&parm.v.data)
which won't work


=> This requires a builtin in the GCC front end to handle this as no Fortran semantic will handle this. Note that:

    subroutine acc_attach (ptr_addr) bind(C)
      type(*), dimension(*), target, optional :: ptr_addr
    end subroutine

comes close but gets 'acc_attach (var.v.data)' and not '&var.v.data' as argument.