Skip to content

Commit cd815d9

Browse files
committed
merge main into amd-staging
land and revert: 785a5b4 [MLIR][OpenMP] Add LLVM translation support for OpenMP UserDefinedMappers (llvm#124746) d6ab12c [MLIR][OpenMP] Add conversion support from FIR to LLVM Dialect for OMP DeclareMapper (llvm#121005) 886b2ed [MLIR][OpenMP] Add Lowering support for OpenMP custom mappers in map clause (llvm#121001) ee17955 [MLIR][OpenMP] Add OMP Mapper field to MapInfoOp (llvm#120994)
2 parents 5fa3897 + 785a5b4 commit cd815d9

File tree

3 files changed

+61
-17
lines changed

3 files changed

+61
-17
lines changed

flang/test/Lower/OpenMP/Todo/map-mapper.f90

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
! Offloading test checking lowering of arrays with dynamic extents.
2+
! REQUIRES: flang, amdgpu
3+
4+
! RUN: %libomptarget-compile-fortran-run-and-check-generic
5+
6+
program test_openmp_mapper
7+
implicit none
8+
integer, parameter :: n = 1024
9+
type :: mytype
10+
integer :: data(n)
11+
end type mytype
12+
13+
type :: mytype2
14+
type(mytype) :: my_data
15+
end type mytype2
16+
17+
! Declare custom mappers for the derived type `mytype`
18+
!$omp declare mapper(my_mapper1 : mytype :: t) map(to: t%data(1 : n))
19+
20+
! Declare custom mappers for the derived type `mytype2`
21+
!$omp declare mapper(my_mapper2 : mytype2 :: t) map(mapper(my_mapper1): t%my_data)
22+
23+
type(mytype2) :: obj
24+
integer :: i, sum_host, sum_device
25+
26+
! Initialize the host data
27+
do i = 1, n
28+
obj%my_data%data(i) = 1
29+
end do
30+
31+
! Compute the sum on the host for verification
32+
sum_host = sum(obj%my_data%data)
33+
34+
! Offload computation to the device using the named mapper `my_mapper2`
35+
sum_device = 0
36+
!$omp target map(tofrom: sum_device) map(mapper(my_mapper2) : obj)
37+
do i = 1, n
38+
sum_device = sum_device + obj%my_data%data(i)
39+
end do
40+
!$omp end target
41+
42+
! Check results
43+
print *, "Sum on host: ", sum_host
44+
print *, "Sum on device: ", sum_device
45+
46+
if (sum_device == sum_host) then
47+
print *, "Test passed!"
48+
else
49+
print *, "Test failed!"
50+
end if
51+
end program test_openmp_mapper
52+
53+
! CHECK: Test passed!

revert_patches.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Revert "Recommit "[InstCombine] Expand `foldSelectICmpAndOr` -> `foldSelectICmpA
77
Backup fix for SWDEV-454675
88
This reverts commit 54ec8bcaf
99
contact: Selehov
10-
A revert is pending on gerrit
10+
b2659ca44 [InstCombine] Propagate flags in `foldSelectICmpAndBinOp` (#127437)
1111
---
1212
breaks devicelibs
1313
6e0b0038 [clang][OpenCL][CodeGen][AMDGPU] Do not use `private` as the default AS for when `generic` is available (#112442)
@@ -31,3 +31,10 @@ Ron and Saiyed
3131
build/run issues: Scott Linder
3232
1083ec647f16 [reland][DebugInfo] Update DIBuilder insertion to take
3333
---
34+
conflicts flang/mlir : akash
35+
785a5b4676e7 [MLIR][OpenMP] Add LLVM translation support for OpenMP UserDefinedMappers (#124746)
36+
d6ab12c7cc70 [MLIR][OpenMP] Add conversion support from FIR to LLVM Dialect for OMP DeclareMapper (#121005)
37+
886b2edfbeea [MLIR][OpenMP] Add Lowering support for OpenMP custom mappers in map clause (#121001)
38+
ee17955dfe45 [MLIR][OpenMP] Add OMP Mapper field to MapInfoOp (#120994)
39+
40+
---

0 commit comments

Comments
 (0)