https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106846
Bug ID: 106846
Summary: [OpenMP][5.1] Permit 'declare target' with clauses
inside INTERFACE
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: openmp, rejects-valid
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Target Milestone: ---
This is target_task_reduction.1.f90 from the OpenMP examples document; it is
5.2 (due to 'enter') but it applies already to 5.1:
interface
subroutine device_compute(res)
!$omp declare target enter(device_compute)
integer :: res
end subroutine device_compute
! ...
end interface
is rejected with:
Error: Only the !$OMP DECLARE TARGET form without clauses is allowed in
interface block at (1)
That's based on OpenMP 5.0's
• Any declare target directive with clauses must appear in a specification part
of a
subroutine subprogram, function subprogram, program or module.
• Any declare target directive without clauses must appear in a specification
part of a
subroutine subprogram, function subprogram or interface body to which it
applies.
However, that is gone with OpenMP 5.1 and later.