Skip to content

Flang OpenMP doesn't appear to correctly process metadirectives in .F files and warn the user its not yet implemented. #148386

@scamp-nvidia

Description

@scamp-nvidia

Testing SPEC Accel V2 OMP has presented an issue with how Flang OpenMP processes .F files when metadirectives are used. Consider the following example:
test.F

#define OMP_TARGET        .true.
#define OMP_SIMD    .false.
      program test
      implicit none
      integer     i,j,n
      n = 100
!$omp  metadirective
!$omp& when(user={condition(OMP_TARGET.or.OMP_SIMD)}:
!$omp&      target teams distribute parallel do )
!$omp& default(target teams loop)
      do i=0,n
        do j=0,n
          write(*,*) "Test"
        enddo
      enddo
      return
      end program

If I try to compile this with a recent Flang build, it "appears" to compile correctly using the OpenMP directive. However, it entirely ignores it as a comment instead, I suspect. Whereas, if I copy the same .F file to a .F90 file, then I correctly get an error message telling me that Flang does not yet have metadirectives implemented.

scamp@genx4:/local/home/scamp/450.md_lop_1$ flang test.F -fopenmp -fopenmp-version=50 -c
warning: OpenMP support for version 50 in flang is still incomplete
scamp@genx4:/local/home/scamp/450.md_lop_1$ cp -f test.F test.F90
scamp@genx4:/local/home/scamp/450.md_lop_1$ flang test.F90 -fopenmp -fopenmp-version=50 -c
warning: OpenMP support for version 50 in flang is still incomplete
error: loc("/local/home/scamp/450.md_lop_1/test.F90":6:7): /proj/build/llvm/Linux_x86_64/flang/lib/Lower/OpenMP/OpenMP.cpp:3495: not yet implemented: METADIRECTIVE
LLVM ERROR: aborting

Obviously this behavior could lead to user confusion.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions