Skip to content

Commit b7ed5c8

Browse files
authored
[flang][cuda] Check for ignore_tkr(d) when resolving generic call (#131923)
1 parent 98943c4 commit b7ed5c8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

flang/lib/Support/Fortran.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
111111
bool isCudaUnified{features
112112
? features->IsEnabled(common::LanguageFeature::CudaUnified)
113113
: false};
114+
if (ignoreTKR.test(common::IgnoreTKR::Device)) {
115+
return true;
116+
}
114117
if (!x && !y) {
115118
return true;
116119
} else if (x && y && *x == *y) {

flang/test/Semantics/cuf13.cuf

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ module matching
88
module procedure sub_unified
99
end interface
1010

11+
interface
12+
subroutine ignore(a)
13+
!dir$ ignore_tkr(d) a
14+
integer, managed :: a(:)
15+
end subroutine
16+
end interface
17+
1118
contains
1219
subroutine sub_host(a)
1320
integer :: a(:)
@@ -43,9 +50,11 @@ program m
4350
call sub(u) ! Should resolve to sub_unified
4451
call sub(d) ! Should resolve to sub_device
4552

53+
call ignore(a)
4654
end
4755

4856
! CHECK: CALL sub_host
4957
! CHECK: CALL sub_managed
5058
! CHECK: CALL sub_unified
5159
! CHECK: CALL sub_device
60+
! CHECK: CALL ignore

0 commit comments

Comments
 (0)