[llvm-branch-commits] [clang] [llvm] [mlir] [MLIR][OpenMP] Add LLVM translation support for OpenMP UserDefinedMappers (PR #124746)
Sergio Afonso via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Feb 11 06:08:56 PST 2025
================
@@ -0,0 +1,47 @@
+! Offloading test checking lowering of arrays with dynamic extents.
+! REQUIRES: flang, amdgpu
+
+! RUN: %libomptarget-compile-fortran-run-and-check-generic
+
+program test_openmp_mapper
+ implicit none
+ integer, parameter :: n = 1024
+ type :: mytype
+ integer :: data(n)
+ end type mytype
+
+ ! Declare custom mappers for the derived type `mytype`
+ !$omp declare mapper(my_mapper1 : mytype :: t) map(to: t%data)
+ !$omp declare mapper(my_mapper2 : mytype :: t) map(mapper(my_mapper1): t%data)
----------------
skatrak wrote:
I don't know if I follow this example. `my_mapper1` is a mapper for a `mytype` data type, so it shouldn't be applicable to an `integer(n)`, which is what `t%data` here represents (which is also not a derived type). Am I misunderstanding something here?
https://github.com/llvm/llvm-project/pull/124746
More information about the llvm-branch-commits
mailing list