Issue 244122
Summary [flang][OpenMP] Support ALLOCATABLE/POINTER components with the iterator modifier in declare mapper
Labels flang
Assignees
Reporter ravurvi20
    After #235491, a `declare mapper` map clause with an iterator modifier is rejected when the component path contains an ALLOCATABLE or POINTER:

    not yet implemented: iterator modifier with ALLOCATABLE or POINTER component in declare mapper

This only happens when compiling for offload (`-fopenmp-targets=...`).

Reproducers:

```fortran
subroutine alloc_component()
  type :: t
    integer, allocatable :: a(:)
  end type
  !$omp declare mapper(m: t :: v) map(iterator(i = 1:size(v%a)): v%a(i))
end subroutine
```
```
subroutine pointer_parent()
  type :: inner
    integer :: a(4)
  end type
  type :: t
    type(inner), pointer :: p
  end type
  !$omp declare mapper(m: t :: v) map(iterator(i = 1:4): v%p%a(i))
end subroutine
```
The per-iteration map entry currently carries only the element's data address. For an allocatable or pointer component the mapper also needs to map the descriptor and emit an attach entry so the device-side descriptor points at the device data. Without this, each element was mapped as a separate device allocation with no attachment (seen with the host offload plugin during review of #235491), so the TODO was added instead.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to