intel / intel-application-migration-tool-for-openacc-to-openmp

OpenACC* to OpenMP* API assisting migration tool
BSD 3-Clause "New" or "Revised" License
32 stars 5 forks source link

Mapper declarations include #ifdef #13

Closed Pennycook closed 9 months ago

Pennycook commented 10 months ago

If a preprocessor directive appears inside a type, the macro name and all guarded variables appear inside the mapper.

Original

module test_module

  type test_type
    integer :: n
#ifdef SOME_MACRO
    integer :: m
#endif
  end type test_type

end module

Migrated

module test_module

  type test_type
    integer :: n
#ifdef SOME_MACRO
    integer :: m
#endif
  end type test_type
!$omp declare mapper (test_type::x) map (x%n,x%some_macro,x%m)

end module

Expected

I'm not 100% sure on how to get the line continuation to work here, but I think it's something like the below.

module test_module

  type test_type
    integer :: n
#ifdef SOME_MACRO
    integer :: m
#endif
  end type test_type
!$omp declare mapper (test_type::x) map(x%n&
#ifdef SOME_MACRO
!$omp ,x%m&
#endif
!$omp )

end module